bool save_fp_regs = CpuFeatures::IsSupported(VFP2);
CEntryStub ces(1, save_fp_regs ? kSaveFPRegs : kDontSaveFPRegs);
__ Call(ces.GetCode(), RelocInfo::CODE_TARGET);
+ int parameter_count_offset =
+ StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset;
+ __ ldr(r1, MemOperand(fp, parameter_count_offset));
masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE);
+ __ mov(r1, Operand(r1, LSL, kPointerSizeLog2));
+ __ add(sp, sp, r1);
__ Ret();
}
// v +-------------------------+ +-------------------------|
// | COMPILED_STUB marker | | STUB_FAILURE marker |
// +-------------------------+ +-------------------------+
- // | | | stub parameter 1 |
+ // | | | caller args.length_ |
// | ... | +-------------------------+
- // | | | ... |
+ // | | | caller args.arguments_ |
// |-------------------------|<-sp +-------------------------+
- // | stub parameter n |
- // parameters in registers +-------------------------+<-sp
- // and spilled to stack r0 = number of parameters
+ // | caller args pointer |
+ // +-------------------------+
+ // | caller stack param 1 |
+ // parameters in registers +-------------------------+
+ // and spilled to stack | .... |
+ // +-------------------------+
+ // | caller stack param n |
+ // +-------------------------+<-sp
+ // r0 = number of parameters
// r1 = failure handler address
// fp = saved frame
// cp = JSFunction context
CodeStubInterfaceDescriptor* descriptor =
isolate_->code_stub_interface_descriptor(major_key);
+ // The output frame must have room for all pushed register parameters
+ // and the standard stack frame slots.
int output_frame_size = StandardFrameConstants::kFixedFrameSize +
kPointerSize * descriptor->register_param_count_;
+ // Include space for an argument object to the callee and optionally
+ // the space to pass the argument object to the stub failure handler.
+ output_frame_size += sizeof(Arguments) + kPointerSize;
+
FrameDescription* output_frame =
new(output_frame_size) FrameDescription(output_frame_size, 0);
ASSERT(frame_index == 0);
reinterpret_cast<intptr_t>(notify_failure->entry()));
Code* trampoline = NULL;
- StubFailureTrampolineStub().FindCodeInCache(&trampoline, isolate_);
+ int extra = descriptor->extra_expression_stack_count_;
+ StubFailureTrampolineStub(extra).FindCodeInCache(&trampoline, isolate_);
ASSERT(trampoline != NULL);
output_frame->SetPc(reinterpret_cast<intptr_t>(
trampoline->instruction_start()));
unsigned input_frame_size = input_->GetFrameSize();
+ intptr_t frame_ptr = input_->GetRegister(fp.code());
+
// JSFunction continuation
intptr_t input_frame_offset = input_frame_size - kPointerSize;
intptr_t output_frame_offset = output_frame_size - kPointerSize;
Smi::FromInt(StackFrame::STUB_FAILURE_TRAMPOLINE));
output_frame->SetFrameSlot(output_frame_offset, value);
+ int caller_arg_count = 0;
+ if (descriptor->stack_parameter_count_ != NULL) {
+ caller_arg_count =
+ input_->GetRegister(descriptor->stack_parameter_count_->code());
+ }
+
+ // Build the Arguments object for the caller's parameters and a pointer to it.
+ output_frame_offset -= kPointerSize;
+ value = frame_ptr + StandardFrameConstants::kCallerSPOffset +
+ (caller_arg_count - 1) * kPointerSize;
+ output_frame->SetFrameSlot(output_frame_offset, value);
+
+ output_frame->SetFrameSlot(output_frame_offset, value);
+ output_frame_offset -= kPointerSize;
+ output_frame->SetFrameSlot(output_frame_offset, caller_arg_count);
+
+ value = frame_ptr - (output_frame_size - output_frame_offset) -
+ StandardFrameConstants::kMarkerOffset;
+ output_frame_offset -= kPointerSize;
+ output_frame->SetFrameSlot(output_frame_offset, value);
+
+ // Copy the register parameters to the failure frame.
for (int i = 0; i < descriptor->register_param_count_; ++i) {
output_frame_offset -= kPointerSize;
DoTranslateCommand(iterator, 0, output_frame_offset);
output_frame->SetDoubleRegister(i, double_value);
}
- value = input_->GetRegister(fp.code());
- output_frame->SetRegister(fp.code(), value);
- output_frame->SetFp(value);
+ output_frame->SetRegister(fp.code(), frame_ptr);
+ output_frame->SetFp(frame_ptr);
ApiFunction function(descriptor->deoptimization_handler_);
ExternalReference xref(&function, ExternalReference::BUILTIN_CALL, isolate_);
intptr_t handler = reinterpret_cast<intptr_t>(xref.address());
- output_frame->SetRegister(r0.code(), descriptor->register_param_count_);
+ int params = descriptor->register_param_count_;
+ if (descriptor->stack_parameter_count_ != NULL) {
+ params++;
+ }
+ output_frame->SetRegister(r0.code(), params);
output_frame->SetRegister(r1.code(), handler);
}
};
-class StandardFrameConstants : public AllStatic {
- public:
- // Fixed part of the frame consists of return address, caller fp,
- // context and function.
- static const int kFixedFrameSize = 4 * kPointerSize;
- static const int kExpressionsOffset = -3 * kPointerSize;
- static const int kMarkerOffset = -2 * kPointerSize;
- static const int kContextOffset = -1 * kPointerSize;
- static const int kCallerFPOffset = 0 * kPointerSize;
- static const int kCallerPCOffset = 1 * kPointerSize;
- static const int kCallerSPOffset = 2 * kPointerSize;
-};
-
-
class JavaScriptFrameConstants : public AllStatic {
public:
// FP-relative.
LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
LParameter* result = new(zone()) LParameter;
- if (info()->IsOptimizing()) {
+ if (instr->kind() == HParameter::STACK_PARAMETER) {
int spill_index = chunk()->GetParameterStackSlot(instr->index());
return DefineAsSpilled(result, spill_index);
} else {
HGraph* graph = this->graph();
Zone* zone = this->zone();
for (int i = 0; i < descriptor->register_param_count_; ++i) {
- HParameter* param = new(zone) HParameter(i);
+ HParameter* param =
+ new(zone) HParameter(i, HParameter::REGISTER_PARAMETER);
AddInstruction(param);
graph->start_environment()->Push(param);
parameters_[i] = param;
}
+void StubFailureTrampolineStub::GenerateAheadOfTime() {
+ int i = 0;
+ for (; i <= StubFailureTrampolineStub::kMaxExtraExpressionStackCount; ++i) {
+ StubFailureTrampolineStub(i).GetCode();
+ }
+}
+
+
FunctionEntryHook ProfileEntryHookStub::entry_hook_ = NULL;
struct CodeStubInterfaceDescriptor {
CodeStubInterfaceDescriptor()
: register_param_count_(-1),
+ stack_parameter_count_(NULL),
+ extra_expression_stack_count_(0),
register_params_(NULL) { }
int register_param_count_;
+ const Register* stack_parameter_count_;
+ int extra_expression_stack_count_;
Register* register_params_;
Address deoptimization_handler_;
};
class StubFailureTrampolineStub : public PlatformCodeStub {
public:
- StubFailureTrampolineStub() {}
+ static const int kMaxExtraExpressionStackCount = 1;
+
+ explicit StubFailureTrampolineStub(int extra_expression_stack_count)
+ : extra_expression_stack_count_(extra_expression_stack_count) {}
+
+ virtual bool IsPregenerated() { return true; }
+
+ static void GenerateAheadOfTime();
private:
Major MajorKey() { return StubFailureTrampoline; }
- int MinorKey() { return 0; }
+ int MinorKey() { return extra_expression_stack_count_; }
void Generate(MacroAssembler* masm);
+ int extra_expression_stack_count_;
+
DISALLOW_COPY_AND_ASSIGN(StubFailureTrampolineStub);
};
// size matches with the stack height we can compute based on the
// environment at the OSR entry. The code for that his built into
// the DoComputeOsrOutputFrame function for now.
- } else {
+ } else if (compiled_code_->kind() != Code::COMPILED_STUB) {
unsigned stack_slots = compiled_code_->stack_slots();
- unsigned outgoing_size = compiled_code_->kind() == Code::COMPILED_STUB
- ? 0 : ComputeOutgoingArgumentSize();
+ unsigned outgoing_size = ComputeOutgoingArgumentSize();
ASSERT(result == fixed_size + (stack_slots * kPointerSize) + outgoing_size);
}
#endif
inline StubFailureTrampolineFrame::StubFailureTrampolineFrame(
- StackFrameIterator* iterator) : InternalFrame(iterator) {
+ StackFrameIterator* iterator) : StandardFrame(iterator) {
}
void StubFailureTrampolineFrame::Iterate(ObjectVisitor* v) const {
- const int offset = StandardFrameConstants::kContextOffset;
Object** base = &Memory::Object_at(sp());
- Object** limit = &Memory::Object_at(fp() + offset) + 1;
+ Object** limit = &Memory::Object_at(fp() +
+ kFirstRegisterParameterFrameOffset);
+ v->VisitPointers(base, limit);
+ base = &Memory::Object_at(fp() + StandardFrameConstants::kMarkerOffset);
+ const int offset = StandardFrameConstants::kContextOffset;
+ limit = &Memory::Object_at(fp() + offset) + 1;
v->VisitPointers(base, limit);
IteratePc(v, pc_address(), LookupCode());
}
+Address StubFailureTrampolineFrame::GetCallerStackPointer() const {
+ return fp() + StandardFrameConstants::kCallerSPOffset;
+}
+
+
+Code* StubFailureTrampolineFrame::unchecked_code() const {
+ int i = 0;
+ for (; i <= StubFailureTrampolineStub::kMaxExtraExpressionStackCount; ++i) {
+ Code* trampoline;
+ StubFailureTrampolineStub(i).FindCodeInCache(&trampoline, isolate());
+ ASSERT(trampoline != NULL);
+ Address current_pc = pc();
+ Address code_start = trampoline->instruction_start();
+ Address code_end = code_start + trampoline->instruction_size();
+ if (code_start <= current_pc && current_pc < code_end) {
+ return trampoline;
+ }
+ }
+ UNREACHABLE();
+ return NULL;
+}
+
+
// -------------------------------------------------------------------------
V(ARGUMENTS_ADAPTOR, ArgumentsAdaptorFrame)
+class StandardFrameConstants : public AllStatic {
+ public:
+ // Fixed part of the frame consists of return address, caller fp,
+ // context and function.
+ // StandardFrame::IterateExpressions assumes that kContextOffset is the last
+ // object pointer.
+ static const int kFixedFrameSize = 4 * kPointerSize;
+ static const int kExpressionsOffset = -3 * kPointerSize;
+ static const int kMarkerOffset = -2 * kPointerSize;
+ static const int kContextOffset = -1 * kPointerSize;
+ static const int kCallerFPOffset = 0 * kPointerSize;
+ static const int kCallerPCOffset = +1 * kPointerSize;
+ static const int kCallerSPOffset = +2 * kPointerSize;
+};
+
+
// Abstract base class for all stack frames.
class StackFrame BASE_EMBEDDED {
public:
};
-class StubFailureTrampolineFrame: public InternalFrame {
+class StubFailureTrampolineFrame: public StandardFrame {
public:
+ // sizeof(Arguments) - sizeof(Arguments*) is 3 * kPointerSize), but the
+ // presubmit script complains about using sizeof() on a type.
+ static const int kFirstRegisterParameterFrameOffset =
+ StandardFrameConstants::kMarkerOffset - 3 * kPointerSize;
+
+ static const int kCallerStackParameterCountFrameOffset =
+ StandardFrameConstants::kMarkerOffset - 2 * kPointerSize;
+
virtual Type type() const { return STUB_FAILURE_TRAMPOLINE; }
+ // Get the code associated with this frame.
+ // This method could be called during marking phase of GC.
+ virtual Code* unchecked_code() const;
+
virtual void Iterate(ObjectVisitor* v) const;
protected:
inline explicit StubFailureTrampolineFrame(
StackFrameIterator* iterator);
+ virtual Address GetCallerStackPointer() const;
+
private:
friend class StackFrameIterator;
};
class HParameter: public HTemplateInstruction<0> {
public:
- explicit HParameter(unsigned index) : index_(index) {
+ enum ParameterKind {
+ STACK_PARAMETER,
+ REGISTER_PARAMETER
+ };
+
+ explicit HParameter(unsigned index,
+ ParameterKind kind = STACK_PARAMETER)
+ : index_(index),
+ kind_(kind) {
set_representation(Representation::Tagged());
}
unsigned index() const { return index_; }
+ ParameterKind kind() const { return kind_; }
virtual void PrintDataTo(StringStream* stream);
private:
unsigned index_;
+ ParameterKind kind_;
};
static Register registers[] = { edx, ecx };
descriptor->register_param_count_ = 2;
descriptor->register_params_ = registers;
+ descriptor->stack_parameter_count_ = NULL;
descriptor->deoptimization_handler_ =
FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure);
}
bool save_fp_regs = CpuFeatures::IsSupported(SSE2);
CEntryStub ces(1, save_fp_regs ? kSaveFPRegs : kDontSaveFPRegs);
__ call(ces.GetCode(), RelocInfo::CODE_TARGET);
+ int parameter_count_offset =
+ StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset;
+ __ mov(ebx, MemOperand(ebp, parameter_count_offset));
masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE);
- __ ret(0); // Return to IC Miss stub, continuation still on stack.
+ __ pop(ecx);
+ __ lea(esp, MemOperand(esp, ebx, times_pointer_size,
+ extra_expression_stack_count_ * kPointerSize));
+ __ jmp(ecx); // Return to IC Miss stub, continuation still on stack.
}
// v +-------------------------+ +-------------------------|
// | COMPILED_STUB marker | | STUB_FAILURE marker |
// +-------------------------+ +-------------------------+
- // | | | stub parameter 1 |
+ // | | | caller args.length_ |
// | ... | +-------------------------+
- // | | | ... |
+ // | | | caller args.arguments_ |
// |-------------------------|<-esp +-------------------------+
- // | stub parameter n |
- // parameters in registers +-------------------------+<-esp
- // and spilled to stack eax = number of parameters
+ // | caller args pointer |
+ // +-------------------------+
+ // | caller stack param 1 |
+ // parameters in registers +-------------------------+
+ // and spilled to stack | .... |
+ // +-------------------------+
+ // | caller stack param n |
+ // +-------------------------+<-esp
+ // eax = number of parameters
// ebx = failure handler address
// ebp = saved frame
// esi = JSFunction context
CodeStubInterfaceDescriptor* descriptor =
isolate_->code_stub_interface_descriptor(major_key);
+ // The output frame must have room for all pushed register parameters
+ // and the standard stack frame slots.
int output_frame_size = StandardFrameConstants::kFixedFrameSize +
kPointerSize * descriptor->register_param_count_;
+ // Include space for an argument object to the callee and optionally
+ // the space to pass the argument object to the stub failure handler.
+ output_frame_size += sizeof(Arguments) + kPointerSize;
+
FrameDescription* output_frame =
new(output_frame_size) FrameDescription(output_frame_size, 0);
ASSERT(frame_index == 0);
reinterpret_cast<intptr_t>(notify_failure->entry()));
Code* trampoline = NULL;
- StubFailureTrampolineStub().FindCodeInCache(&trampoline, isolate_);
+ int extra = descriptor->extra_expression_stack_count_;
+ StubFailureTrampolineStub(extra).FindCodeInCache(&trampoline, isolate_);
ASSERT(trampoline != NULL);
output_frame->SetPc(reinterpret_cast<intptr_t>(
trampoline->instruction_start()));
unsigned input_frame_size = input_->GetFrameSize();
+ intptr_t frame_ptr = input_->GetRegister(ebp.code());
+
// JSFunction continuation
intptr_t input_frame_offset = input_frame_size - kPointerSize;
intptr_t output_frame_offset = output_frame_size - kPointerSize;
Smi::FromInt(StackFrame::STUB_FAILURE_TRAMPOLINE));
output_frame->SetFrameSlot(output_frame_offset, value);
+ int caller_arg_count = 0;
+ if (descriptor->stack_parameter_count_ != NULL) {
+ caller_arg_count =
+ input_->GetRegister(descriptor->stack_parameter_count_->code());
+ }
+
+ // Build the Arguments object for the caller's parameters and a pointer to it.
+ output_frame_offset -= kPointerSize;
+ value = frame_ptr + StandardFrameConstants::kCallerSPOffset +
+ (caller_arg_count - 1) * kPointerSize;
+ output_frame->SetFrameSlot(output_frame_offset, value);
+
+ output_frame->SetFrameSlot(output_frame_offset, value);
+ output_frame_offset -= kPointerSize;
+ output_frame->SetFrameSlot(output_frame_offset, caller_arg_count);
+
+ value = frame_ptr - (output_frame_size - output_frame_offset) -
+ StandardFrameConstants::kMarkerOffset;
+ output_frame_offset -= kPointerSize;
+ output_frame->SetFrameSlot(output_frame_offset, value);
+
+ // Copy the register parameters to the failure frame.
for (int i = 0; i < descriptor->register_param_count_; ++i) {
output_frame_offset -= kPointerSize;
DoTranslateCommand(iterator, 0, output_frame_offset);
}
- value = input_->GetRegister(ebp.code());
- output_frame->SetRegister(ebp.code(), value);
- output_frame->SetFp(value);
+ output_frame->SetRegister(ebp.code(), frame_ptr);
+ output_frame->SetFp(frame_ptr);
for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) {
double double_value = input_->GetDoubleRegister(i);
intptr_t handler =
reinterpret_cast<intptr_t>(descriptor->deoptimization_handler_);
- output_frame->SetRegister(eax.code(), descriptor->register_param_count_);
+ int params = descriptor->register_param_count_;
+ if (descriptor->stack_parameter_count_ != NULL) {
+ params++;
+ }
+ output_frame->SetRegister(eax.code(), params);
output_frame->SetRegister(ebx.code(), handler);
}
};
-class StandardFrameConstants : public AllStatic {
- public:
- // Fixed part of the frame consists of return address, caller fp,
- // context and function.
- // StandardFrame::IterateExpressions assumes that kContextOffset is the last
- // object pointer.
- static const int kFixedFrameSize = 4 * kPointerSize;
- static const int kExpressionsOffset = -3 * kPointerSize;
- static const int kMarkerOffset = -2 * kPointerSize;
- static const int kContextOffset = -1 * kPointerSize;
- static const int kCallerFPOffset = 0 * kPointerSize;
- static const int kCallerPCOffset = +1 * kPointerSize;
- static const int kCallerSPOffset = +2 * kPointerSize;
-};
-
-
class JavaScriptFrameConstants : public AllStatic {
public:
// FP-relative.
LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
LParameter* result = new(zone()) LParameter;
- if (info()->IsOptimizing()) {
+ if (instr->kind() == HParameter::STACK_PARAMETER) {
int spill_index = chunk()->GetParameterStackSlot(instr->index());
return DefineAsSpilled(result, spill_index);
} else {
// Ensure that the stub failure trampoline has been generated.
HandleScope scope(this);
CodeStub::GenerateFPStubs();
- StubFailureTrampolineStub().GetCode();
+ StubFailureTrampolineStub::GenerateAheadOfTime();
}
if (FLAG_parallel_recompilation) optimizing_compiler_thread_.Start();
RUNTIME_ASSERT(args[index]->Is##Type()); \
Handle<Type> name = args.at<Type>(index);
+#define CONVERT_ARG_STUB_CALLER_ARGS(name) \
+ Arguments* name = reinterpret_cast<Arguments*>(args[0]);
+
// Cast the given object to a boolean and store it in a variable with
// the given name. If the object is not a boolean call IllegalOperation
// and return.
static Register registers[] = { rdx, rax };
descriptor->register_param_count_ = 2;
descriptor->register_params_ = registers;
+ descriptor->stack_parameter_count_ = NULL;
descriptor->deoptimization_handler_ =
FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure);
}
ASSERT(!Serializer::enabled());
CEntryStub ces(1, kSaveFPRegs);
__ Call(ces.GetCode(), RelocInfo::CODE_TARGET);
+ int parameter_count_offset =
+ StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset;
+ __ movq(rbx, MemOperand(rbp, parameter_count_offset));
masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE);
- __ ret(0); // Return to IC Miss stub, continuation still on stack.
+ __ pop(rcx);
+ __ lea(rsp, MemOperand(rsp, rbx, times_pointer_size,
+ extra_expression_stack_count_ * kPointerSize));
+ __ jmp(rcx); // Return to IC Miss stub, continuation still on stack.
}
// v +-------------------------+ +-------------------------|
// | COMPILED_STUB marker | | STUB_FAILURE marker |
// +-------------------------+ +-------------------------+
- // | | | stub parameter 1 |
+ // | | | caller args.length_ |
// | ... | +-------------------------+
- // | | | ... |
+ // | | | caller args.arguments_ |
// |-------------------------|<-rsp +-------------------------+
- // | stub parameter n |
- // parameters in registers +-------------------------+<-rsp
- // and spilled to stack rax = number of parameters
+ // | caller args pointer |
+ // +-------------------------+
+ // | caller stack param 1 |
+ // parameters in registers +-------------------------+
+ // and spilled to stack | .... |
+ // +-------------------------+
+ // | caller stack param n |
+ // +-------------------------+<-rsp
+ // rax = number of parameters
// rbx = failure handler address
// rbp = saved frame
// rsi = JSFunction context
CodeStubInterfaceDescriptor* descriptor =
isolate_->code_stub_interface_descriptor(major_key);
+ // The output frame must have room for all pushed register parameters
+ // and the standard stack frame slots.
int output_frame_size = StandardFrameConstants::kFixedFrameSize +
kPointerSize * descriptor->register_param_count_;
+ // Include space for an argument object to the callee and optionally
+ // the space to pass the argument object to the stub failure handler.
+ output_frame_size += sizeof(Arguments) + kPointerSize;
+
FrameDescription* output_frame =
new(output_frame_size) FrameDescription(output_frame_size, 0);
ASSERT(frame_index == 0);
reinterpret_cast<intptr_t>(notify_failure->entry()));
Code* trampoline = NULL;
- StubFailureTrampolineStub().FindCodeInCache(&trampoline, isolate_);
+ int extra = descriptor->extra_expression_stack_count_;
+ StubFailureTrampolineStub(extra).FindCodeInCache(&trampoline, isolate_);
ASSERT(trampoline != NULL);
output_frame->SetPc(reinterpret_cast<intptr_t>(
trampoline->instruction_start()));
unsigned input_frame_size = input_->GetFrameSize();
+ intptr_t frame_ptr = input_->GetRegister(rbp.code());
+
// JSFunction continuation
unsigned input_frame_offset = input_frame_size - kPointerSize;
unsigned output_frame_offset = output_frame_size - kPointerSize;
Smi::FromInt(StackFrame::STUB_FAILURE_TRAMPOLINE));
output_frame->SetFrameSlot(output_frame_offset, value);
+ int caller_arg_count = 0;
+ if (descriptor->stack_parameter_count_ != NULL) {
+ caller_arg_count =
+ input_->GetRegister(descriptor->stack_parameter_count_->code());
+ }
+
+ // Build the Arguments object for the caller's parameters and a pointer to it.
+ output_frame_offset -= kPointerSize;
+ value = frame_ptr + StandardFrameConstants::kCallerSPOffset +
+ (caller_arg_count - 1) * kPointerSize;
+ output_frame->SetFrameSlot(output_frame_offset, value);
+
+ output_frame->SetFrameSlot(output_frame_offset, value);
+ output_frame_offset -= kPointerSize;
+ output_frame->SetFrameSlot(output_frame_offset, caller_arg_count);
+
+ value = frame_ptr - (output_frame_size - output_frame_offset) -
+ StandardFrameConstants::kMarkerOffset;
+ output_frame_offset -= kPointerSize;
+ output_frame->SetFrameSlot(output_frame_offset, value);
+
+ // Copy the register parameters to the failure frame.
for (int i = 0; i < descriptor->register_param_count_; ++i) {
output_frame_offset -= kPointerSize;
DoTranslateCommand(iterator, 0, output_frame_offset);
}
- value = input_->GetRegister(rbp.code());
- output_frame->SetRegister(rbp.code(), value);
- output_frame->SetFp(value);
+ output_frame->SetRegister(rbp.code(), frame_ptr);
+ output_frame->SetFp(frame_ptr);
for (int i = 0; i < XMMRegister::NumAllocatableRegisters(); ++i) {
double double_value = input_->GetDoubleRegister(i);
intptr_t handler =
reinterpret_cast<intptr_t>(descriptor->deoptimization_handler_);
- output_frame->SetRegister(rax.code(), descriptor->register_param_count_);
+ int params = descriptor->register_param_count_;
+ if (descriptor->stack_parameter_count_ != NULL) {
+ params++;
+ }
+ output_frame->SetRegister(rax.code(), params);
output_frame->SetRegister(rbx.code(), handler);
}
};
-class StandardFrameConstants : public AllStatic {
- public:
- // Fixed part of the frame consists of return address, caller fp,
- // context and function.
- static const int kFixedFrameSize = 4 * kPointerSize;
- static const int kExpressionsOffset = -3 * kPointerSize;
- static const int kMarkerOffset = -2 * kPointerSize;
- static const int kContextOffset = -1 * kPointerSize;
- static const int kCallerFPOffset = 0 * kPointerSize;
- static const int kCallerPCOffset = +1 * kPointerSize;
- static const int kCallerSPOffset = +2 * kPointerSize;
-};
-
-
class JavaScriptFrameConstants : public AllStatic {
public:
// FP-relative.
LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
LParameter* result = new(zone()) LParameter;
- if (info()->IsOptimizing()) {
+ if (instr->kind() == HParameter::STACK_PARAMETER) {
int spill_index = chunk()->GetParameterStackSlot(instr->index());
return DefineAsSpilled(result, spill_index);
} else {