Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index a87d623790e0007198cd6bf08ca20a1662606154..8eb798e3727d1f13298d0c8cd52081d5a84a4f7e 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -3431,8 +3431,11 @@ HGraph::HGraph(CompilationInfo* info) |
if (info->IsStub()) { |
HydrogenCodeStub* stub = info->code_stub(); |
CodeStubInterfaceDescriptor* descriptor = stub->GetInterfaceDescriptor(); |
+ // The descriptor environment length includes a context register, which |
+ // we handle separately, so subtract one. |
+ ASSERT(descriptor->GetEnvironmentLength() > 0); |
start_environment_ = |
- new(zone_) HEnvironment(zone_, descriptor->environment_length()); |
+ new(zone_) HEnvironment(zone_, descriptor->GetEnvironmentLength() - 1); |
} else { |
TraceInlinedFunction(info->shared_info(), HSourcePosition::Unknown()); |
start_environment_ = |
@@ -7343,7 +7346,7 @@ HInstruction* HOptimizedGraphBuilder::NewArgumentAdaptorCall( |
HValue* arity = Add<HConstant>(argument_count - 1); |
- HValue* op_vals[] = { fun, context, arity, expected_param_count }; |
+ HValue* op_vals[] = { context, fun, arity, expected_param_count }; |
Handle<Code> adaptor = |
isolate()->builtins()->ArgumentsAdaptorTrampoline(); |
@@ -7351,7 +7354,7 @@ HInstruction* HOptimizedGraphBuilder::NewArgumentAdaptorCall( |
return New<HCallWithDescriptor>( |
adaptor_value, argument_count, descriptor, |
- Vector<HValue*>(op_vals, descriptor->environment_length())); |
+ Vector<HValue*>(op_vals, descriptor->GetEnvironmentLength())); |
} |
@@ -8581,11 +8584,11 @@ bool HOptimizedGraphBuilder::TryInlineApiCall(Handle<JSFunction> function, |
HValue* api_function_address = Add<HConstant>(ExternalReference(ref)); |
HValue* op_vals[] = { |
+ context(), |
Add<HConstant>(function), |
call_data, |
holder, |
- api_function_address, |
- context() |
+ api_function_address |
}; |
CallInterfaceDescriptor* descriptor = |
@@ -8596,11 +8599,11 @@ bool HOptimizedGraphBuilder::TryInlineApiCall(Handle<JSFunction> function, |
HConstant* code_value = Add<HConstant>(code); |
ASSERT((sizeof(op_vals) / kPointerSize) == |
- descriptor->environment_length()); |
+ descriptor->GetEnvironmentLength()); |
HInstruction* call = New<HCallWithDescriptor>( |
code_value, argc + 1, descriptor, |
- Vector<HValue*>(op_vals, descriptor->environment_length())); |
+ Vector<HValue*>(op_vals, descriptor->GetEnvironmentLength())); |
if (drop_extra) Drop(1); // Drop function. |
ast_context()->ReturnInstruction(call, ast_id); |