28 #ifndef V8_FRAMES_INL_H_
29 #define V8_FRAMES_INL_H_
35 #if V8_TARGET_ARCH_IA32
37 #elif V8_TARGET_ARCH_X64
39 #elif V8_TARGET_ARCH_ARM64
41 #elif V8_TARGET_ARCH_ARM
43 #elif V8_TARGET_ARCH_MIPS
46 #error Unsupported target architecture.
53 inline Address StackHandler::address()
const {
54 return reinterpret_cast<Address>(
const_cast<StackHandler*
>(
this));
58 inline StackHandler* StackHandler::next()
const {
64 inline bool StackHandler::includes(
Address address)
const {
65 Address start = this->address();
67 return start <= address && address <= end;
71 inline void StackHandler::Iterate(ObjectVisitor* v, Code* holder)
const {
72 v->VisitPointer(context_address());
73 v->VisitPointer(code_address());
77 inline StackHandler* StackHandler::FromAddress(
Address address) {
78 return reinterpret_cast<StackHandler*
>(address);
82 inline bool StackHandler::is_js_entry()
const {
83 return kind() == JS_ENTRY;
87 inline bool StackHandler::is_catch()
const {
88 return kind() == CATCH;
92 inline bool StackHandler::is_finally()
const {
93 return kind() == FINALLY;
97 inline StackHandler::Kind StackHandler::kind()
const {
103 inline unsigned StackHandler::index()
const {
109 inline Object** StackHandler::context_address()
const {
111 return reinterpret_cast<Object**
>(address() + offset);
115 inline Object** StackHandler::code_address()
const {
117 return reinterpret_cast<Object**
>(address() + offset);
122 : iterator_(iterator), isolate_(iterator_->isolate()) {
126 inline StackHandler* StackFrame::top_handler()
const {
127 return iterator_->handler();
131 inline Code* StackFrame::LookupCode()
const {
132 return GetContainingCode(isolate(),
pc());
136 inline Code* StackFrame::GetContainingCode(Isolate* isolate,
Address pc) {
137 return isolate->inner_pointer_to_code_cache()->GetCacheEntry(pc)->code;
141 inline Address* StackFrame::ResolveReturnAddressLocation(
Address* pc_address) {
142 if (return_address_location_resolver_ ==
NULL) {
145 return reinterpret_cast<Address*
>(
146 return_address_location_resolver_(
147 reinterpret_cast<uintptr_t>(pc_address)));
152 inline EntryFrame::EntryFrame(StackFrameIteratorBase* iterator)
158 StackFrameIteratorBase* iterator)
230 ASSERT(-1 <= index && index < param_count);
231 int parameter_offset = (param_count - index - 1) *
kPointerSize;
232 return caller_sp() + parameter_offset;
264 ASSERT(stack_size_in_bytes >= 0);
310 StackFrameIteratorBase* iterator) :
StandardFrame(iterator) {
319 inline JavaScriptFrameIterator::JavaScriptFrameIterator(
321 : iterator_(isolate) {
322 if (!done()) Advance();
326 inline JavaScriptFrameIterator::JavaScriptFrameIterator(
327 Isolate* isolate, ThreadLocalTop* top)
328 : iterator_(isolate, top) {
329 if (!done()) Advance();
333 inline JavaScriptFrame* JavaScriptFrameIterator::frame()
const {
339 ASSERT(frame->is_java_script() || frame->is_arguments_adaptor());
340 return static_cast<JavaScriptFrame*
>(frame);
346 ASSERT(frame_->is_java_script() || frame_->is_exit());
353 #endif // V8_FRAMES_INL_H_
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter NULL
static Object *& Object_at(Address addr)
static const int kStateOffset
bool IsAddressAligned(Address addr, intptr_t alignment, int offset=0)
ConstructFrame(StackFrameIteratorBase *iterator)
static const int kCodeOffset
static Smi * FromInt(int value)
static Address ComputeConstantPoolAddress(Address fp)
Address GetParameterSlot(int index) const
static bool IsArgumentsAdaptorFrame(Address fp)
Address GetExpressionAddress(int n) const
kSerializedDataOffset Object
Address caller_fp() const
Object * GetExpression(int index) const
EntryConstructFrame(StackFrameIteratorBase *iterator)
#define ASSERT(condition)
static const int kContextOffset
const int kPointerSizeLog2
static const int kNextOffset
ExitFrame(StackFrameIteratorBase *iterator)
static const int kCallerFPOffset
ArgumentsAdaptorFrame(StackFrameIteratorBase *iterator)
int ComputeParametersCount() const
Object * receiver() const
HANDLE HANDLE LPSTACKFRAME64 StackFrame
InternalFrame(StackFrameIteratorBase *iterator)
static Address ComputePCAddress(Address fp)
void SetExpression(int index, Object *value)
static Address & Address_at(Address addr)
int ComputeOperandsCount() const
bool IsAligned(T value, U alignment)
static const int kConstantPoolOffset
#define ASSERT_LE(v1, v2)
static const int kCallerPCOffset
void set_receiver(Object *value)
static const int kMarkerOffset
Address caller_pc() const
StubFrame(StackFrameIteratorBase *iterator)
#define ASSERT_LT(v1, v2)
StubFailureTrampolineFrame(StackFrameIteratorBase *iterator)
static const int kContextOffset
Object * GetOperand(int index) const
JavaScriptFrame(StackFrameIteratorBase *iterator)
#define ASSERT_EQ(v1, v2)
static bool IsConstructFrame(Address fp)
StackFrame * frame() const
static unsigned & unsigned_at(Address addr)
virtual Type type() const
Address GetOperandSlot(int index) const
StandardFrame(StackFrameIteratorBase *iterator)
static const int kLocal0Offset
Object * GetParameter(int index) const
bool has_adapted_arguments() const
JSFunction * function() const
OptimizedFrame(StackFrameIteratorBase *iterator)
static JSFunction * cast(Object *obj)