38 #if V8_TARGET_ARCH_ARM64
54 class ExternalCallbackScope;
55 class StackFrameIteratorBase;
75 memset(&cache_[0], 0,
sizeof(cache_));
81 InnerPointerToCodeCacheEntry* cache(
int index) {
return &cache_[index]; }
85 static const int kInnerPointerToCodeCacheSize = 1024;
86 InnerPointerToCodeCacheEntry cache_[kInnerPointerToCodeCacheSize];
114 static const int kKindWidth = 2;
116 static const int kIndexWidth = 32 - kKindWidth;
121 inline Address address()
const;
124 inline StackHandler* next()
const;
127 inline bool includes(
Address address)
const;
130 inline void Iterate(ObjectVisitor* v,
Code* holder)
const;
133 static inline StackHandler* FromAddress(
Address address);
136 inline bool is_js_entry()
const;
137 inline bool is_catch()
const;
138 inline bool is_finally()
const;
142 int previous_handler_offset)
const;
147 inline Kind kind()
const;
148 inline unsigned index()
const;
150 inline Object** constant_pool_address()
const;
151 inline Object** context_address()
const;
152 inline Object** code_address()
const;
159 #define STACK_FRAME_TYPE_LIST(V) \
160 V(ENTRY, EntryFrame) \
161 V(ENTRY_CONSTRUCT, EntryConstructFrame) \
163 V(JAVA_SCRIPT, JavaScriptFrame) \
164 V(OPTIMIZED, OptimizedFrame) \
166 V(STUB_FAILURE_TRAMPOLINE, StubFailureTrampolineFrame) \
167 V(INTERNAL, InternalFrame) \
168 V(CONSTRUCT, ConstructFrame) \
169 V(ARGUMENTS_ADAPTOR, ArgumentsAdaptorFrame)
200 #define DECLARE_TYPE(type, ignore) type,
223 INNER_JSENTRY_FRAME = 0,
224 OUTERMOST_JSENTRY_FRAME = 1
229 constant_pool_address(
NULL) { }
239 this->state_ = original.state_;
240 this->iterator_ =
NULL;
241 this->isolate_ = original.isolate_;
247 bool is_exit()
const {
return type() == EXIT; }
252 return type() == STUB_FAILURE_TRAMPOLINE;
258 Type type = this->type();
259 return (type == JAVA_SCRIPT) || (type == OPTIMIZED);
277 *constant_pool_address() =
reinterpret_cast<Address>(constant_pool);
280 virtual void SetCallerFp(
Address caller_fp) = 0;
288 return state_.constant_pool_address;
295 bool HasHandler()
const;
298 virtual Type type()
const = 0;
302 virtual Code* unchecked_code()
const = 0;
305 inline Code* LookupCode()
const;
315 SafepointEntry* safepoint_entry,
316 unsigned* stack_slots);
318 virtual void Iterate(ObjectVisitor* v)
const = 0;
319 static void IteratePc(ObjectVisitor* v,
Address* pc_address,
Code* holder);
324 static void SetReturnAddressLocationResolver(
328 static inline Address* ResolveReturnAddressLocation(
Address* pc_address);
340 inline explicit StackFrame(StackFrameIteratorBase* iterator);
344 virtual Address GetCallerStackPointer()
const = 0;
352 inline StackHandler* top_handler()
const;
355 static Type ComputeType(
const StackFrameIteratorBase* iterator, State* state);
358 bool can_access_heap_objects()
const;
362 const StackFrameIteratorBase* iterator_;
369 virtual void ComputeCallerState(State* state)
const = 0;
372 virtual Type GetCallerState(State* state)
const;
374 static const intptr_t kIsolateTag = 1;
377 friend class StackFrameIteratorBase;
378 friend class StackHandlerIterator;
391 virtual Code* unchecked_code()
const;
394 virtual void Iterate(ObjectVisitor* v)
const;
397 ASSERT(frame->is_entry());
400 virtual void SetCallerFp(
Address caller_fp);
403 inline explicit EntryFrame(StackFrameIteratorBase* iterator);
411 virtual void ComputeCallerState(State* state)
const;
412 virtual Type GetCallerState(State* state)
const;
414 friend class StackFrameIteratorBase;
420 virtual Type type()
const {
return ENTRY_CONSTRUCT; }
422 virtual Code* unchecked_code()
const;
425 ASSERT(frame->is_entry_construct());
433 friend class StackFrameIteratorBase;
442 virtual Code* unchecked_code()
const;
444 Object*& code_slot()
const;
445 Object*& constant_pool_slot()
const;
448 virtual void Iterate(ObjectVisitor* v)
const;
450 virtual void SetCallerFp(
Address caller_fp);
460 static Type GetStateForFramePointer(
Address fp, State* state);
465 inline explicit ExitFrame(StackFrameIteratorBase* iterator);
467 virtual Address GetCallerStackPointer()
const;
470 virtual void ComputeCallerState(State* state)
const;
472 friend class StackFrameIteratorBase;
482 inline Object* context()
const;
485 inline Object* GetExpression(
int index)
const;
486 inline void SetExpression(
int index,
Object* value);
487 int ComputeExpressionsCount()
const;
490 virtual void SetCallerFp(
Address caller_fp);
493 ASSERT(frame->is_standard());
498 inline explicit StandardFrame(StackFrameIteratorBase* iterator);
500 virtual void ComputeCallerState(State* state)
const;
503 inline Address caller_fp()
const;
504 inline Address caller_pc()
const;
516 void IterateExpressions(ObjectVisitor* v)
const;
519 Address GetExpressionAddress(
int n)
const;
524 bool IsExpressionInsideHandler(
int n)
const;
528 static inline bool IsArgumentsAdaptorFrame(
Address fp);
532 static inline bool IsConstructFrame(
Address fp);
535 void IterateCompiledFrame(ObjectVisitor* v)
const;
550 : receiver_(receiver, function->GetIsolate()),
554 is_constructor_(is_constructor) { }
569 bool is_constructor_;
579 inline Object* receiver()
const;
580 inline void set_receiver(
Object* value);
583 inline Address GetParameterSlot(
int index)
const;
584 inline Object* GetParameter(
int index)
const;
586 return GetNumberOfIncomingArguments();
590 inline Address GetOperandSlot(
int index)
const;
591 inline Object* GetOperand(
int index)
const;
592 inline int ComputeOperandsCount()
const;
595 void SaveOperandStack(
FixedArray* store,
int* stack_handler_index)
const;
596 void RestoreOperandStack(
FixedArray* store,
int stack_handler_index);
599 void SetParameterValue(
int index,
Object* value)
const;
602 bool IsConstructor()
const;
607 inline bool has_adapted_arguments()
const;
608 int GetArgumentsLength()
const;
611 virtual void Iterate(ObjectVisitor* v)
const;
619 virtual Code* unchecked_code()
const;
633 static Register constant_pool_pointer_register();
636 ASSERT(frame->is_java_script());
640 static void PrintTop(
Isolate* isolate,
643 bool print_line_number);
648 virtual Address GetCallerStackPointer()
const;
650 virtual int GetNumberOfIncomingArguments()
const;
654 void IterateArguments(ObjectVisitor* v)
const;
657 inline Object* function_slot_object()
const;
659 friend class StackFrameIteratorBase;
668 virtual void Iterate(ObjectVisitor* v)
const;
671 virtual Code* unchecked_code()
const;
674 inline explicit StubFrame(StackFrameIteratorBase* iterator);
676 virtual Address GetCallerStackPointer()
const;
678 virtual int GetNumberOfIncomingArguments()
const;
680 friend class StackFrameIteratorBase;
689 virtual void Iterate(ObjectVisitor* v)
const;
691 virtual int GetInlineCount();
708 friend class StackFrameIteratorBase;
720 virtual Code* unchecked_code()
const;
723 ASSERT(frame->is_arguments_adaptor());
735 virtual int GetNumberOfIncomingArguments()
const;
737 virtual Address GetCallerStackPointer()
const;
740 friend class StackFrameIteratorBase;
749 virtual void Iterate(ObjectVisitor* v)
const;
752 virtual Code* unchecked_code()
const;
755 ASSERT(frame->is_internal());
760 inline explicit InternalFrame(StackFrameIteratorBase* iterator);
762 virtual Address GetCallerStackPointer()
const;
765 friend class StackFrameIteratorBase;
773 static const int kFirstRegisterParameterFrameOffset =
776 static const int kCallerStackParameterCountFrameOffset =
779 virtual Type type()
const {
return STUB_FAILURE_TRAMPOLINE; }
783 virtual Code* unchecked_code()
const;
785 virtual void Iterate(ObjectVisitor* v)
const;
790 static Register constant_pool_pointer_register();
794 StackFrameIteratorBase* iterator);
796 virtual Address GetCallerStackPointer()
const;
799 friend class StackFrameIteratorBase;
810 ASSERT(frame->is_construct());
818 friend class StackFrameIteratorBase;
830 StackFrameIteratorBase(
Isolate* isolate,
bool can_access_heap_objects);
833 #define DECLARE_SINGLETON(ignore, type) type type##_;
835 #undef DECLARE_SINGLETON
837 StackHandler* handler_;
871 void Reset(ThreadLocalTop* top);
880 inline explicit JavaScriptFrameIterator(
Isolate* isolate);
881 inline JavaScriptFrameIterator(
Isolate* isolate, ThreadLocalTop* top);
883 JavaScriptFrameIterator(
Isolate* isolate, StackFrame::Id
id);
885 inline JavaScriptFrame* frame()
const;
887 bool done()
const {
return iterator_.done(); }
893 void AdvanceToArgumentsFrame();
926 void AdvanceOneFrame();
928 bool IsValidStackAddress(
Address addr)
const {
929 return low_bound_ <= addr && addr <= high_bound_;
933 bool IsValidExitFrame(
Address fp)
const;
934 bool IsValidTop(ThreadLocalTop* top)
const;
939 ExternalCallbackScope* external_callback_scope_;
969 #endif // V8_FRAMES_H_
virtual Type type() const
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 const int kFPOffset
static const int kStateOffset
Code * GcSafeCastToCode(HeapObject *object, Address inner_pointer)
StackFrame::Type top_frame_type() const
static const int kCodeOffset
static const int kFixedFrameSize
static EntryFrame * cast(StackFrame *frame)
int NumRegs(RegList reglist)
virtual bool is_standard() const
void UpdateFp(Address fp)
Address * constant_pool_address() const
static StandardFrame * cast(StackFrame *frame)
TypeImpl< ZoneTypeConfig > Type
Vector< StackFrame * > CreateStackMap(Isolate *isolate, Zone *zone)
Address * constant_pool_address
InnerPointerToCodeCache(Isolate *isolate)
#define ASSERT(condition)
static ConstructFrame * cast(StackFrame *frame)
static const int kContextOffset
const int kPointerSizeLog2
static const int kNextOffset
static InternalFrame * cast(StackFrame *frame)
bool is_stub_failure_trampoline() const
static const int kCallerFPOffset
bool is_optimized() const
int ComputeParametersCount() const
virtual Type type() const
bool is_construct() const
#define STACK_FRAME_TYPE_LIST(V)
#define DECLARE_TYPE(type, ignore)
Handle< Object > receiver()
int JSCallerSavedCode(int n)
virtual Type type() const
HANDLE HANDLE LPSTACKFRAME64 StackFrame
#define DECLARE_SINGLETON(ignore, type)
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 trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long mode(MIPS only)") DEFINE_string(expose_natives_as
static const int kCPSlotSize
STATIC_ASSERT(sizeof(CPURegister)==sizeof(Register))
const bool can_access_heap_objects_
StackFrame * frame() const
StackHandler * handler() const
virtual void Print(StringStream *accumulator, PrintMode mode, int index) const
Address * pc_address() const
bool is_arguments_adaptor() const
uintptr_t(* ReturnAddressLocationResolver)(uintptr_t return_addr_location)
#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName)
static const int kConstantPoolOffset
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 trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra code(assertions) for debugging") DEFINE_bool(code_comments
static const int kCallerSPOffset
FrameSummary(Object *receiver, JSFunction *function, Code *code, int offset, bool is_constructor)
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
static const int kCallerPCOffset
static const int kMarkerOffset
virtual Type type() const
static const int kLastObjectOffset
virtual Type type() const
static const int kExpressionsOffset
virtual Type type() const
static JavaScriptFrame * cast(StackFrame *frame)
static ExitFrame * cast(StackFrame *frame)
Address caller_sp() const
Isolate * isolate() const
static const int kFixedFrameSizeFromFp
void SetUpJSCallerSavedCodeData()
InnerPointerToCodeCacheEntry * GetCacheEntry(Address inner_pointer)
static const int kContextOffset
Address constant_pool() const
virtual Type type() const
StackFrameLocator(Isolate *isolate)
bool is_java_script() const
virtual Type type() const
void Print(const v8::FunctionCallbackInfo< v8::Value > &args)
virtual Type type() const
SafepointEntry safepoint_entry
virtual bool is_standard() const
bool is_entry_construct() const
static const int kSlotCount
StackFrame(const StackFrame &original)
Code * GcSafeFindCodeForInnerPointer(Address inner_pointer)
static EntryConstructFrame * cast(StackFrame *frame)
virtual int GetInlineCount()
static ArgumentsAdaptorFrame * cast(StackFrame *frame)
void set_constant_pool(ConstantPoolArray *constant_pool)
virtual Address GetCallerStackPointer() const
virtual Type type() const