| Index: src/x87/macro-assembler-x87.cc
|
| diff --git a/src/x87/macro-assembler-x87.cc b/src/x87/macro-assembler-x87.cc
|
| index d350343b93b78f54bc8d50338f7c33f0391ec8a9..0434119c4e496d50de471c0e431e7e7df47a1e28 100644
|
| --- a/src/x87/macro-assembler-x87.cc
|
| +++ b/src/x87/macro-assembler-x87.cc
|
| @@ -954,12 +954,10 @@ void MacroAssembler::AssertNotSmi(Register object) {
|
| }
|
| }
|
|
|
| -
|
| -void MacroAssembler::StubPrologue() {
|
| +void MacroAssembler::StubPrologue(StackFrame::Type type) {
|
| push(ebp); // Caller's frame pointer.
|
| mov(ebp, esp);
|
| - push(esi); // Callee's context.
|
| - push(Immediate(Smi::FromInt(StackFrame::STUB)));
|
| + push(Immediate(Smi::FromInt(type)));
|
| }
|
|
|
|
|
| @@ -997,9 +995,10 @@ void MacroAssembler::EnterFrame(StackFrame::Type type,
|
| void MacroAssembler::EnterFrame(StackFrame::Type type) {
|
| push(ebp);
|
| mov(ebp, esp);
|
| - push(esi);
|
| push(Immediate(Smi::FromInt(type)));
|
| - push(Immediate(CodeObject()));
|
| + if (type == StackFrame::INTERNAL) {
|
| + push(Immediate(CodeObject()));
|
| + }
|
| if (emit_debug_code()) {
|
| cmp(Operand(esp, 0), Immediate(isolate()->factory()->undefined_value()));
|
| Check(not_equal, kCodeObjectNotProperlyPatched);
|
| @@ -1009,7 +1008,7 @@ void MacroAssembler::EnterFrame(StackFrame::Type type) {
|
|
|
| void MacroAssembler::LeaveFrame(StackFrame::Type type) {
|
| if (emit_debug_code()) {
|
| - cmp(Operand(ebp, StandardFrameConstants::kMarkerOffset),
|
| + cmp(Operand(ebp, CommonFrameConstants::kContextOrFrameTypeOffset),
|
| Immediate(Smi::FromInt(type)));
|
| Check(equal, kStackFrameTypesMustMatch);
|
| }
|
| @@ -1019,15 +1018,17 @@ void MacroAssembler::LeaveFrame(StackFrame::Type type) {
|
|
|
| void MacroAssembler::EnterExitFramePrologue() {
|
| // Set up the frame structure on the stack.
|
| - DCHECK(ExitFrameConstants::kCallerSPDisplacement == +2 * kPointerSize);
|
| - DCHECK(ExitFrameConstants::kCallerPCOffset == +1 * kPointerSize);
|
| - DCHECK(ExitFrameConstants::kCallerFPOffset == 0 * kPointerSize);
|
| + DCHECK_EQ(+2 * kPointerSize, ExitFrameConstants::kCallerSPDisplacement);
|
| + DCHECK_EQ(+1 * kPointerSize, ExitFrameConstants::kCallerPCOffset);
|
| + DCHECK_EQ(0 * kPointerSize, ExitFrameConstants::kCallerFPOffset);
|
| push(ebp);
|
| mov(ebp, esp);
|
|
|
| // Reserve room for entry stack pointer and push the code object.
|
| - DCHECK(ExitFrameConstants::kSPOffset == -1 * kPointerSize);
|
| + push(Immediate(Smi::FromInt(StackFrame::EXIT)));
|
| + DCHECK_EQ(-2 * kPointerSize, ExitFrameConstants::kSPOffset);
|
| push(Immediate(0)); // Saved entry sp, patched before call.
|
| + DCHECK_EQ(-3 * kPointerSize, ExitFrameConstants::kCodeOffset);
|
| push(Immediate(CodeObject())); // Accessed from ExitFrame::code_slot.
|
|
|
| // Save the frame pointer and the context in top.
|
| @@ -1046,7 +1047,7 @@ void MacroAssembler::EnterExitFrameEpilogue(int argc, bool save_doubles) {
|
| // Store FPU state to m108byte.
|
| int space = 108 + argc * kPointerSize;
|
| sub(esp, Immediate(space));
|
| - const int offset = -2 * kPointerSize; // entry fp + code object.
|
| + const int offset = -ExitFrameConstants::kFixedFrameSizeFromFp;
|
| fnsave(MemOperand(ebp, offset - 108));
|
| } else {
|
| sub(esp, Immediate(argc * kPointerSize));
|
| @@ -1086,7 +1087,7 @@ void MacroAssembler::EnterApiExitFrame(int argc) {
|
| void MacroAssembler::LeaveExitFrame(bool save_doubles, bool pop_arguments) {
|
| // Optionally restore FPU state.
|
| if (save_doubles) {
|
| - const int offset = -2 * kPointerSize;
|
| + const int offset = -ExitFrameConstants::kFixedFrameSizeFromFp;
|
| frstor(MemOperand(ebp, offset - 108));
|
| }
|
|
|
| @@ -1166,8 +1167,18 @@ void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg,
|
| DCHECK(!holder_reg.is(scratch2));
|
| DCHECK(!scratch1.is(scratch2));
|
|
|
| - // Load current lexical context from the stack frame.
|
| - mov(scratch1, Operand(ebp, StandardFrameConstants::kContextOffset));
|
| + // Load current lexical context from the active StandardFrame, which
|
| + // may require crawling past STUB frames.
|
| + Label load_context;
|
| + Label has_context;
|
| + mov(scratch2, ebp);
|
| + bind(&load_context);
|
| + mov(scratch1,
|
| + MemOperand(scratch2, CommonFrameConstants::kContextOrFrameTypeOffset));
|
| + JumpIfNotSmi(scratch1, &has_context);
|
| + mov(scratch2, MemOperand(scratch2, CommonFrameConstants::kCallerFPOffset));
|
| + jmp(&load_context);
|
| + bind(&has_context);
|
|
|
| // When generating debug code, make sure the lexical context is set.
|
| if (emit_debug_code()) {
|
|
|