}
-inline void StackHandler::SetFp(Address slot, Address fp) {
- Memory::Address_at(slot) = fp;
-}
-
-
} } // namespace v8::internal
#endif // V8_ARM_FRAMES_ARM_H_
void MacroAssembler::PushTryHandler(StackHandler::Kind kind,
int handler_index) {
// Adjust this code if not the case.
- STATIC_ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize);
+ STATIC_ASSERT(StackHandlerConstants::kSize == 3 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kContextOffset == 2 * kPointerSize);
- STATIC_ASSERT(StackHandlerConstants::kFPOffset == 3 * kPointerSize);
// For the JSEntry handler, we must preserve r0-r4, r5-r6 are available.
// We will build up the handler from the bottom by pushing on the stack.
StackHandler::KindField::encode(kind);
mov(r6, Operand(state));
- // Push the frame pointer, context, and state.
+ // Push the context and state.
if (kind == StackHandler::JS_ENTRY) {
mov(cp, Operand(Smi::FromInt(0))); // Indicates no context.
- mov(ip, Operand::Zero()); // NULL frame pointer.
- stm(db_w, sp, r6.bit() | cp.bit() | ip.bit());
+ stm(db_w, sp, r6.bit() | cp.bit());
} else {
- stm(db_w, sp, r6.bit() | cp.bit() | fp.bit());
+ stm(db_w, sp, r6.bit() | cp.bit());
}
// Link the current handler as the next handler.
}
-inline void StackHandler::SetFp(Address slot, Address fp) {
- Memory::Address_at(slot) = fp;
-}
-
-
} } // namespace v8::internal
#endif // V8_ARM64_FRAMES_ARM64_H_
int handler_index) {
DCHECK(jssp.Is(StackPointer()));
// Adjust this code if the asserts don't hold.
- STATIC_ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize);
+ STATIC_ASSERT(StackHandlerConstants::kSize == 3 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kContextOffset == 2 * kPointerSize);
- STATIC_ASSERT(StackHandlerConstants::kFPOffset == 3 * kPointerSize);
// For the JSEntry handler, we must preserve the live registers x0-x4.
// (See JSEntryStub::GenerateBody().)
// Set up the state for pushing.
Mov(x11, state);
- // Push the frame pointer, context, and state.
+ // Push the context and state.
if (kind == StackHandler::JS_ENTRY) {
DCHECK(Smi::FromInt(0) == 0);
- Push(xzr, xzr, x11);
+ Push(xzr, x11);
} else {
- Push(fp, cp, x11);
+ Push(cp, x11);
}
// Link the current handler as the next handler.
}
-inline Address StackHandler::frame_pointer() const {
- const int offset = StackHandlerConstants::kFPOffset;
- return Memory::Address_at(address() + offset);
-}
-
-
inline Object** StackHandler::context_address() const {
const int offset = StackHandlerConstants::kContextOffset;
return reinterpret_cast<Object**>(address() + offset);
FixedArray* array,
int offset,
int previous_handler_offset) const {
- STATIC_ASSERT(StackHandlerConstants::kSlotCount >= 4);
+ STATIC_ASSERT(StackHandlerConstants::kSlotCount >= 3);
DCHECK_LE(0, offset);
DCHECK_GE(array->length(), offset + StackHandlerConstants::kSlotCount);
// Unwinding a stack handler into an array chains it in the opposite
// direction, re-using the "next" slot as a "previous" link, so that stack
- // handlers can be later re-wound in the correct order. Decode the "state"
- // slot into "index" and "kind" and store them separately, using the fp slot.
- array->set(offset, Smi::FromInt(previous_handler_offset)); // next
- array->set(offset + 1, Smi::FromInt(static_cast<int>(index()))); // state
- array->set(offset + 2, *context_address()); // context
- array->set(offset + 3, Smi::FromInt(static_cast<int>(kind()))); // fp
+ // handlers can be later re-wound in the correct order.
+ int s = Memory::int_at(address() + StackHandlerConstants::kStateIntOffset);
+ array->set(offset, Smi::FromInt(previous_handler_offset)); // next
+ array->set(offset + 1, Smi::FromInt(static_cast<int>(s))); // state
+ array->set(offset + 2, *context_address()); // context
*isolate->handler_address() = next()->address();
}
FixedArray* array,
int offset,
Address fp) {
- STATIC_ASSERT(StackHandlerConstants::kSlotCount >= 4);
+ STATIC_ASSERT(StackHandlerConstants::kSlotCount >= 3);
DCHECK_LE(0, offset);
DCHECK_GE(array->length(), offset + StackHandlerConstants::kSlotCount);
Smi* prev_handler_offset = Smi::cast(array->get(offset));
- Smi* smi_index = Smi::cast(array->get(offset + 1));
+ Smi* smi_state = Smi::cast(array->get(offset + 1));
Object* context = array->get(offset + 2);
- Smi* smi_kind = Smi::cast(array->get(offset + 3));
-
- unsigned state = KindField::encode(static_cast<Kind>(smi_kind->value())) |
- IndexField::encode(static_cast<unsigned>(smi_index->value()));
Memory::Address_at(address() + StackHandlerConstants::kNextOffset) =
*isolate->handler_address();
- Memory::uintptr_at(address() + StackHandlerConstants::kStateOffset) = state;
+ Memory::int_at(address() + StackHandlerConstants::kStateIntOffset) =
+ smi_state->value();
Memory::Object_at(address() + StackHandlerConstants::kContextOffset) =
context;
- SetFp(address() + StackHandlerConstants::kFPOffset, fp);
*isolate->handler_address() = address();
static const int kStateIntOffset = kStateOffset + kIntSize;
#endif
static const int kContextOffset = 2 * kPointerSize;
- static const int kFPOffset = 3 * kPointerSize;
- static const int kSize = kFPOffset + kFPOnStackSize;
+ static const int kSize = kContextOffset + kPointerSize;
static const int kSlotCount = kSize >> kPointerSizeLog2;
};
inline Context* context() const;
inline Kind kind() const;
inline unsigned index() const;
- inline Address frame_pointer() const;
// Testers.
inline bool is_js_entry() const;
private:
inline Object** context_address() const;
- inline void SetFp(Address slot, Address fp);
DISALLOW_IMPLICIT_CONSTRUCTORS(StackHandler);
};
}
-inline void StackHandler::SetFp(Address slot, Address fp) {
- Memory::Address_at(slot) = fp;
-}
-
-
} } // namespace v8::internal
#endif // V8_IA32_FRAMES_IA32_H_
void MacroAssembler::PushTryHandler(StackHandler::Kind kind,
int handler_index) {
// Adjust this code if not the case.
- STATIC_ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize);
+ STATIC_ASSERT(StackHandlerConstants::kSize == 3 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0);
STATIC_ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kContextOffset == 2 * kPointerSize);
- STATIC_ASSERT(StackHandlerConstants::kFPOffset == 3 * kPointerSize);
// We will build up the handler from the bottom by pushing on the stack.
- // First push the frame pointer and context.
+ // First push the context.
if (kind == StackHandler::JS_ENTRY) {
- // The frame pointer does not point to a JS frame so we save NULL for
- // ebp. We expect the code throwing an exception to check ebp before
- // dereferencing it to restore the context.
- push(Immediate(0)); // NULL frame pointer.
push(Immediate(Smi::FromInt(0))); // No context.
} else {
- push(ebp);
push(esi);
}
// Push the state.
context = handler->context();
offset = Smi::cast(code->handler_table()->get(handler->index()))->value();
handler_sp = handler->address() + StackHandlerConstants::kSize;
- handler_fp = handler->frame_pointer();
+ handler_fp = frame->fp();
break;
}
}
-inline void StackHandler::SetFp(Address slot, Address fp) {
- Memory::Address_at(slot) = fp;
-}
-
-
} } // namespace v8::internal
#endif
}
-inline void StackHandler::SetFp(Address slot, Address fp) {
- Memory::Address_at(slot) = fp;
-}
-
-
} } // namespace v8::internal
#endif
}
-inline void StackHandler::SetFp(Address slot, Address fp) {
- Memory::Address_at(slot) = fp;
-}
}
} // namespace v8::internal
}
-inline void StackHandler::SetFp(Address slot, Address fp) {
- if (kFPOnStackSize == 2 * kPointerSize) {
- // Zero out the high-32 bit of FP for x32 port.
- Memory::Address_at(slot + kPointerSize) = 0;
- }
- Memory::Address_at(slot) = fp;
-}
-
-
} } // namespace v8::internal
#endif // V8_X64_FRAMES_X64_H_
void MacroAssembler::PushTryHandler(StackHandler::Kind kind,
int handler_index) {
// Adjust this code if not the case.
- STATIC_ASSERT(StackHandlerConstants::kSize == 3 * kPointerSize +
- kFPOnStackSize);
+ STATIC_ASSERT(StackHandlerConstants::kSize == 3 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0);
STATIC_ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kContextOffset == 2 * kPointerSize);
- STATIC_ASSERT(StackHandlerConstants::kFPOffset == 3 * kPointerSize);
// We will build up the handler from the bottom by pushing on the stack.
- // First push the frame pointer and context.
+ // First push the context.
if (kind == StackHandler::JS_ENTRY) {
- // The frame pointer does not point to a JS frame so we save NULL for
- // rbp. We expect the code throwing an exception to check rbp before
- // dereferencing it to restore the context.
- pushq(Immediate(0)); // NULL frame pointer.
Push(Smi::FromInt(0)); // No context.
} else {
- pushq(rbp);
Push(rsi);
}
}
-inline void StackHandler::SetFp(Address slot, Address fp) {
- Memory::Address_at(slot) = fp;
-}
-
-
} } // namespace v8::internal
#endif // V8_X87_FRAMES_X87_H_