5 #ifndef V8_FRAMES_INL_H_
6 #define V8_FRAMES_INL_H_
12 #if V8_TARGET_ARCH_IA32
14 #elif V8_TARGET_ARCH_X64
16 #elif V8_TARGET_ARCH_ARM64
18 #elif V8_TARGET_ARCH_ARM
20 #elif V8_TARGET_ARCH_MIPS
22 #elif V8_TARGET_ARCH_MIPS64
24 #elif V8_TARGET_ARCH_X87
27 #error Unsupported target architecture.
34 inline Address StackHandler::address()
const {
35 return reinterpret_cast<Address>(
const_cast<StackHandler*
>(
this));
39 inline StackHandler* StackHandler::next()
const {
45 inline bool StackHandler::includes(
Address address)
const {
46 Address start = this->address();
48 return start <= address && address <= end;
52 inline void StackHandler::Iterate(ObjectVisitor* v, Code* holder)
const {
53 v->VisitPointer(context_address());
54 v->VisitPointer(code_address());
58 inline StackHandler* StackHandler::FromAddress(
Address address) {
59 return reinterpret_cast<StackHandler*
>(address);
63 inline bool StackHandler::is_js_entry()
const {
64 return kind() == JS_ENTRY;
68 inline bool StackHandler::is_catch()
const {
69 return kind() == CATCH;
73 inline bool StackHandler::is_finally()
const {
74 return kind() == FINALLY;
78 inline StackHandler::Kind StackHandler::kind()
const {
84 inline unsigned StackHandler::index()
const {
90 inline Object** StackHandler::context_address()
const {
92 return reinterpret_cast<Object**
>(address() + offset);
96 inline Object** StackHandler::code_address()
const {
98 return reinterpret_cast<Object**
>(address() + offset);
103 : iterator_(iterator), isolate_(iterator_->isolate()) {
107 inline StackHandler* StackFrame::top_handler()
const {
108 return iterator_->handler();
112 inline Code* StackFrame::LookupCode()
const {
113 return GetContainingCode(isolate(),
pc());
117 inline Code* StackFrame::GetContainingCode(Isolate* isolate,
Address pc) {
118 return isolate->inner_pointer_to_code_cache()->GetCacheEntry(
pc)->code;
122 inline Address* StackFrame::ResolveReturnAddressLocation(
Address* pc_address) {
123 if (return_address_location_resolver_ ==
NULL) {
126 return reinterpret_cast<Address*
>(
127 return_address_location_resolver_(
128 reinterpret_cast<uintptr_t>(pc_address)));
211 DCHECK(-1 <= index && index < param_count);
212 int parameter_offset = (param_count - index - 1) *
kPointerSize;
213 return caller_sp() + parameter_offset;
245 DCHECK(stack_size_in_bytes >= 0);
300 inline JavaScriptFrameIterator::JavaScriptFrameIterator(
302 : iterator_(isolate) {
303 if (!done()) Advance();
307 inline JavaScriptFrameIterator::JavaScriptFrameIterator(
308 Isolate* isolate, ThreadLocalTop* top)
309 : iterator_(isolate, top) {
310 if (!done()) Advance();
314 inline JavaScriptFrame* JavaScriptFrameIterator::frame()
const {
320 DCHECK(frame->is_java_script() || frame->is_arguments_adaptor());
321 return static_cast<JavaScriptFrame*
>(frame);
327 DCHECK(frame_->is_java_script() || frame_->is_exit());
Isolate represents an isolated instance of the V8 engine.
A single JavaScript stack frame.
ArgumentsAdaptorFrame(StackFrameIteratorBase *iterator)
ConstructFrame(StackFrameIteratorBase *iterator)
EntryConstructFrame(StackFrameIteratorBase *iterator)
ExitFrame(StackFrameIteratorBase *iterator)
InternalFrame(StackFrameIteratorBase *iterator)
static const int kLocal0Offset
Object * receiver() const
void set_receiver(Object *value)
Object * function_slot_object() const
bool has_adapted_arguments() const
Address GetParameterSlot(int index) const
JavaScriptFrame(StackFrameIteratorBase *iterator)
Address GetOperandSlot(int index) const
int ComputeOperandsCount() const
Object * GetParameter(int index) const
Object * GetOperand(int index) const
JSFunction * function() const
virtual Type type() const
int ComputeParametersCount() const
static Object *& Object_at(Address addr)
static Address & Address_at(Address addr)
static unsigned & unsigned_at(Address addr)
OptimizedFrame(StackFrameIteratorBase *iterator)
StackFrame * frame() const
static Smi * FromInt(int value)
static const int kCodeOffset
static const int kContextOffset
static const int kNextOffset
static const int kStateOffset
static const int kContextOffset
static const int kConstantPoolOffset
static const int kCallerPCOffset
static const int kMarkerOffset
static const int kCallerFPOffset
Address GetExpressionAddress(int n) const
StandardFrame(StackFrameIteratorBase *iterator)
static Address ComputeConstantPoolAddress(Address fp)
static bool IsArgumentsAdaptorFrame(Address fp)
Address caller_pc() const
Address caller_fp() const
Object * GetExpression(int index) const
static Address ComputePCAddress(Address fp)
void SetExpression(int index, Object *value)
static bool IsConstructFrame(Address fp)
StubFailureTrampolineFrame(StackFrameIteratorBase *iterator)
StubFrame(StackFrameIteratorBase *iterator)
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS 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 enable alignment of csp to bytes on platforms which prefer the register to always be NULL
#define DCHECK_LE(v1, v2)
#define DCHECK(condition)
#define DCHECK_LT(v1, v2)
#define DCHECK_EQ(v1, v2)
HANDLE HANDLE LPSTACKFRAME64 StackFrame
bool IsAddressAligned(Address addr, intptr_t alignment, int offset=0)
kSerializedDataOffset Object
const int kPointerSizeLog2
bool IsAligned(T value, U alignment)
Debugger support for the V8 JavaScript engine.