Commit ca680a68 authored by ishell's avatar ishell Committed by Commit bot

[crankshaft] Exclude context parameter from HCallWithDescriptor arguments.

Thus the parameter indices defined in respective CallInterfaceDescriptor can
be used for querying parameters.

BUG=

Review-Url: https://codereview.chromium.org/2389133007
Cr-Commit-Position: refs/heads/master@{#40222}
parent 4c3a1725
...@@ -1031,7 +1031,7 @@ HValue* CodeStubGraphBuilderBase::BuildToString(HValue* input, bool convert) { ...@@ -1031,7 +1031,7 @@ HValue* CodeStubGraphBuilderBase::BuildToString(HValue* input, bool convert) {
} }
if_inputisprimitive.End(); if_inputisprimitive.End();
// Convert the primitive to a string value. // Convert the primitive to a string value.
HValue* values[] = {context(), Pop()}; HValue* values[] = {Pop()};
Callable toString = CodeFactory::ToString(isolate()); Callable toString = CodeFactory::ToString(isolate());
Push(AddUncasted<HCallWithDescriptor>(Add<HConstant>(toString.code()), 0, Push(AddUncasted<HCallWithDescriptor>(Add<HConstant>(toString.code()), 0,
toString.descriptor(), toString.descriptor(),
......
...@@ -2158,8 +2158,8 @@ class HCallWithDescriptor final : public HInstruction { ...@@ -2158,8 +2158,8 @@ class HCallWithDescriptor final : public HInstruction {
const Vector<HValue*>& operands, const Vector<HValue*>& operands,
TailCallMode syntactic_tail_call_mode = TailCallMode::kDisallow, TailCallMode syntactic_tail_call_mode = TailCallMode::kDisallow,
TailCallMode tail_call_mode = TailCallMode::kDisallow) { TailCallMode tail_call_mode = TailCallMode::kDisallow) {
HCallWithDescriptor* res = new (zone) HCallWithDescriptor* res = new (zone) HCallWithDescriptor(
HCallWithDescriptor(target, argument_count, descriptor, operands, context, target, argument_count, descriptor, operands,
syntactic_tail_call_mode, tail_call_mode, zone); syntactic_tail_call_mode, tail_call_mode, zone);
return res; return res;
} }
...@@ -2200,21 +2200,24 @@ class HCallWithDescriptor final : public HInstruction { ...@@ -2200,21 +2200,24 @@ class HCallWithDescriptor final : public HInstruction {
CallInterfaceDescriptor descriptor() const { return descriptor_; } CallInterfaceDescriptor descriptor() const { return descriptor_; }
HValue* target() { HValue* target() { return OperandAt(0); }
return OperandAt(0); HValue* context() { return OperandAt(1); }
HValue* parameter(int index) {
DCHECK_LT(index, GetParameterCount());
return OperandAt(index + 2);
} }
std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT
private: private:
// The argument count includes the receiver. // The argument count includes the receiver.
HCallWithDescriptor(HValue* target, int argument_count, HCallWithDescriptor(HValue* context, HValue* target, int argument_count,
CallInterfaceDescriptor descriptor, CallInterfaceDescriptor descriptor,
const Vector<HValue*>& operands, const Vector<HValue*>& operands,
TailCallMode syntactic_tail_call_mode, TailCallMode syntactic_tail_call_mode,
TailCallMode tail_call_mode, Zone* zone) TailCallMode tail_call_mode, Zone* zone)
: descriptor_(descriptor), : descriptor_(descriptor),
values_(GetParameterCount() + 1, zone), // +1 here is for target. values_(GetParameterCount() + 2, zone), // +2 for context and target.
argument_count_(argument_count), argument_count_(argument_count),
bit_field_( bit_field_(
TailCallModeField::encode(tail_call_mode) | TailCallModeField::encode(tail_call_mode) |
...@@ -2223,6 +2226,7 @@ class HCallWithDescriptor final : public HInstruction { ...@@ -2223,6 +2226,7 @@ class HCallWithDescriptor final : public HInstruction {
// We can only tail call without any stack arguments. // We can only tail call without any stack arguments.
DCHECK(tail_call_mode != TailCallMode::kAllow || argument_count == 0); DCHECK(tail_call_mode != TailCallMode::kAllow || argument_count == 0);
AddOperand(target, zone); AddOperand(target, zone);
AddOperand(context, zone);
for (int i = 0; i < operands.length(); i++) { for (int i = 0; i < operands.length(); i++) {
AddOperand(operands[i], zone); AddOperand(operands[i], zone);
} }
...@@ -2235,9 +2239,7 @@ class HCallWithDescriptor final : public HInstruction { ...@@ -2235,9 +2239,7 @@ class HCallWithDescriptor final : public HInstruction {
SetOperandAt(values_.length() - 1, v); SetOperandAt(values_.length() - 1, v);
} }
int GetParameterCount() const { int GetParameterCount() const { return descriptor_.GetParameterCount(); }
return descriptor_.GetParameterCount() + 1; // +1 here is for context.
}
void InternalSetOperandAt(int index, HValue* value) final { void InternalSetOperandAt(int index, HValue* value) final {
values_[index] = value; values_[index] = value;
......
...@@ -2237,7 +2237,7 @@ HValue* HGraphBuilder::BuildToNumber(HValue* input) { ...@@ -2237,7 +2237,7 @@ HValue* HGraphBuilder::BuildToNumber(HValue* input) {
} }
Callable callable = CodeFactory::ToNumber(isolate()); Callable callable = CodeFactory::ToNumber(isolate());
HValue* stub = Add<HConstant>(callable.code()); HValue* stub = Add<HConstant>(callable.code());
HValue* values[] = {context(), input}; HValue* values[] = {input};
HCallWithDescriptor* instr = Add<HCallWithDescriptor>( HCallWithDescriptor* instr = Add<HCallWithDescriptor>(
stub, 0, callable.descriptor(), ArrayVector(values)); stub, 0, callable.descriptor(), ArrayVector(values));
instr->set_type(HType::TaggedNumber()); instr->set_type(HType::TaggedNumber());
...@@ -5262,7 +5262,7 @@ void HOptimizedGraphBuilder::BuildForInBody(ForInStatement* stmt, ...@@ -5262,7 +5262,7 @@ void HOptimizedGraphBuilder::BuildForInBody(ForInStatement* stmt,
set_current_block(if_slow); set_current_block(if_slow);
{ {
Callable callable = CodeFactory::ForInFilter(isolate()); Callable callable = CodeFactory::ForInFilter(isolate());
HValue* values[] = {context(), key, enumerable}; HValue* values[] = {key, enumerable};
HConstant* stub_value = Add<HConstant>(callable.code()); HConstant* stub_value = Add<HConstant>(callable.code());
Push(Add<HCallWithDescriptor>(stub_value, 0, callable.descriptor(), Push(Add<HCallWithDescriptor>(stub_value, 0, callable.descriptor(),
ArrayVector(values))); ArrayVector(values)));
...@@ -5370,7 +5370,7 @@ void HOptimizedGraphBuilder::VisitFunctionLiteral(FunctionLiteral* expr) { ...@@ -5370,7 +5370,7 @@ void HOptimizedGraphBuilder::VisitFunctionLiteral(FunctionLiteral* expr) {
if (!expr->pretenure()) { if (!expr->pretenure()) {
FastNewClosureStub stub(isolate()); FastNewClosureStub stub(isolate());
FastNewClosureDescriptor descriptor(isolate()); FastNewClosureDescriptor descriptor(isolate());
HValue* values[] = {context(), shared_info_value}; HValue* values[] = {shared_info_value};
HConstant* stub_value = Add<HConstant>(stub.GetCode()); HConstant* stub_value = Add<HConstant>(stub.GetCode());
instr = New<HCallWithDescriptor>(stub_value, 0, descriptor, instr = New<HCallWithDescriptor>(stub_value, 0, descriptor,
ArrayVector(values)); ArrayVector(values));
...@@ -5596,7 +5596,7 @@ void HOptimizedGraphBuilder::VisitVariableProxy(VariableProxy* expr) { ...@@ -5596,7 +5596,7 @@ void HOptimizedGraphBuilder::VisitVariableProxy(VariableProxy* expr) {
Callable callable = CodeFactory::LoadGlobalICInOptimizedCode( Callable callable = CodeFactory::LoadGlobalICInOptimizedCode(
isolate(), ast_context()->typeof_mode()); isolate(), ast_context()->typeof_mode());
HValue* stub = Add<HConstant>(callable.code()); HValue* stub = Add<HConstant>(callable.code());
HValue* values[] = {context(), slot_value, vector_value}; HValue* values[] = {slot_value, vector_value};
HCallWithDescriptor* instr = New<HCallWithDescriptor>( HCallWithDescriptor* instr = New<HCallWithDescriptor>(
stub, 0, callable.descriptor(), ArrayVector(values)); stub, 0, callable.descriptor(), ArrayVector(values));
return ast_context()->ReturnInstruction(instr, expr->id()); return ast_context()->ReturnInstruction(instr, expr->id());
...@@ -5654,9 +5654,9 @@ void HOptimizedGraphBuilder::VisitRegExpLiteral(RegExpLiteral* expr) { ...@@ -5654,9 +5654,9 @@ void HOptimizedGraphBuilder::VisitRegExpLiteral(RegExpLiteral* expr) {
DCHECK(current_block() != NULL); DCHECK(current_block() != NULL);
DCHECK(current_block()->HasPredecessor()); DCHECK(current_block()->HasPredecessor());
Callable callable = CodeFactory::FastCloneRegExp(isolate()); Callable callable = CodeFactory::FastCloneRegExp(isolate());
HValue* values[] = { HValue* values[] = {AddThisFunction(), Add<HConstant>(expr->literal_index()),
context(), AddThisFunction(), Add<HConstant>(expr->literal_index()), Add<HConstant>(expr->pattern()),
Add<HConstant>(expr->pattern()), Add<HConstant>(expr->flags())}; Add<HConstant>(expr->flags())};
HConstant* stub_value = Add<HConstant>(callable.code()); HConstant* stub_value = Add<HConstant>(callable.code());
HInstruction* instr = New<HCallWithDescriptor>( HInstruction* instr = New<HCallWithDescriptor>(
stub_value, 0, callable.descriptor(), ArrayVector(values)); stub_value, 0, callable.descriptor(), ArrayVector(values));
...@@ -6794,8 +6794,7 @@ void HOptimizedGraphBuilder::HandleGlobalVariableAssignment( ...@@ -6794,8 +6794,7 @@ void HOptimizedGraphBuilder::HandleGlobalVariableAssignment(
Callable callable = CodeFactory::StoreICInOptimizedCode( Callable callable = CodeFactory::StoreICInOptimizedCode(
isolate(), function_language_mode()); isolate(), function_language_mode());
HValue* stub = Add<HConstant>(callable.code()); HValue* stub = Add<HConstant>(callable.code());
HValue* values[] = {context(), global_object, name, HValue* values[] = {global_object, name, value, slot_value, vector_value};
value, slot_value, vector_value};
HCallWithDescriptor* instr = Add<HCallWithDescriptor>( HCallWithDescriptor* instr = Add<HCallWithDescriptor>(
stub, 0, callable.descriptor(), ArrayVector(values)); stub, 0, callable.descriptor(), ArrayVector(values));
USE(instr); USE(instr);
...@@ -7103,7 +7102,7 @@ HInstruction* HOptimizedGraphBuilder::BuildNamedGeneric( ...@@ -7103,7 +7102,7 @@ HInstruction* HOptimizedGraphBuilder::BuildNamedGeneric(
HValue* slot_value = Add<HConstant>(vector->GetIndex(slot)); HValue* slot_value = Add<HConstant>(vector->GetIndex(slot));
if (access_type == LOAD) { if (access_type == LOAD) {
HValue* values[] = {context(), object, key, slot_value, vector_value}; HValue* values[] = {object, key, slot_value, vector_value};
if (!expr->AsProperty()->key()->IsPropertyName()) { if (!expr->AsProperty()->key()->IsPropertyName()) {
// It's possible that a keyed load of a constant string was converted // It's possible that a keyed load of a constant string was converted
// to a named load. Here, at the last minute, we need to make sure to // to a named load. Here, at the last minute, we need to make sure to
...@@ -7121,9 +7120,7 @@ HInstruction* HOptimizedGraphBuilder::BuildNamedGeneric( ...@@ -7121,9 +7120,7 @@ HInstruction* HOptimizedGraphBuilder::BuildNamedGeneric(
return result; return result;
} else { } else {
HValue* values[] = {context(), object, key, HValue* values[] = {object, key, value, slot_value, vector_value};
value, slot_value, vector_value};
if (vector->GetKind(slot) == FeedbackVectorSlotKind::KEYED_STORE_IC) { if (vector->GetKind(slot) == FeedbackVectorSlotKind::KEYED_STORE_IC) {
// It's possible that a keyed store of a constant string was converted // It's possible that a keyed store of a constant string was converted
// to a named store. Here, at the last minute, we need to make sure to // to a named store. Here, at the last minute, we need to make sure to
...@@ -7158,8 +7155,7 @@ HInstruction* HOptimizedGraphBuilder::BuildKeyedGeneric( ...@@ -7158,8 +7155,7 @@ HInstruction* HOptimizedGraphBuilder::BuildKeyedGeneric(
} else { } else {
HValue* vector_value = Add<HConstant>(vector); HValue* vector_value = Add<HConstant>(vector);
HValue* slot_value = Add<HConstant>(vector->GetIndex(slot)); HValue* slot_value = Add<HConstant>(vector->GetIndex(slot));
HValue* values[] = {context(), object, key, HValue* values[] = {object, key, value, slot_value, vector_value};
value, slot_value, vector_value};
Callable callable = CodeFactory::KeyedStoreICInOptimizedCode( Callable callable = CodeFactory::KeyedStoreICInOptimizedCode(
isolate(), function_language_mode()); isolate(), function_language_mode());
...@@ -7858,7 +7854,7 @@ HInstruction* HOptimizedGraphBuilder::NewCallFunction( ...@@ -7858,7 +7854,7 @@ HInstruction* HOptimizedGraphBuilder::NewCallFunction(
} }
HValue* arity = Add<HConstant>(argument_count - 1); HValue* arity = Add<HConstant>(argument_count - 1);
HValue* op_vals[] = {context(), function, arity}; HValue* op_vals[] = {function, arity};
Callable callable = Callable callable =
CodeFactory::Call(isolate(), convert_mode, tail_call_mode); CodeFactory::Call(isolate(), convert_mode, tail_call_mode);
...@@ -7884,8 +7880,7 @@ HInstruction* HOptimizedGraphBuilder::NewCallFunctionViaIC( ...@@ -7884,8 +7880,7 @@ HInstruction* HOptimizedGraphBuilder::NewCallFunctionViaIC(
HValue* index_val = Add<HConstant>(vector->GetIndex(slot)); HValue* index_val = Add<HConstant>(vector->GetIndex(slot));
HValue* vector_val = Add<HConstant>(vector); HValue* vector_val = Add<HConstant>(vector);
HValue* op_vals[] = {context(), function, arity_val, index_val, vector_val}; HValue* op_vals[] = {function, arity_val, index_val, vector_val};
Callable callable = CodeFactory::CallICInOptimizedCode( Callable callable = CodeFactory::CallICInOptimizedCode(
isolate(), convert_mode, tail_call_mode); isolate(), convert_mode, tail_call_mode);
HConstant* stub = Add<HConstant>(callable.code()); HConstant* stub = Add<HConstant>(callable.code());
...@@ -9234,7 +9229,7 @@ bool HOptimizedGraphBuilder::TryInlineApiCall( ...@@ -9234,7 +9229,7 @@ bool HOptimizedGraphBuilder::TryInlineApiCall(
isolate()); isolate());
HValue* api_function_address = Add<HConstant>(ExternalReference(ref)); HValue* api_function_address = Add<HConstant>(ExternalReference(ref));
HValue* op_vals[] = {context(), Add<HConstant>(function), call_data, holder, HValue* op_vals[] = {Add<HConstant>(function), call_data, holder,
api_function_address}; api_function_address};
HInstruction* call = nullptr; HInstruction* call = nullptr;
...@@ -9973,7 +9968,7 @@ void HOptimizedGraphBuilder::VisitCallNew(CallNew* expr) { ...@@ -9973,7 +9968,7 @@ void HOptimizedGraphBuilder::VisitCallNew(CallNew* expr) {
} }
HValue* arity = Add<HConstant>(argument_count - 1); HValue* arity = Add<HConstant>(argument_count - 1);
HValue* op_vals[] = {context(), function, function, arity}; HValue* op_vals[] = {function, function, arity};
Callable callable = CodeFactory::Construct(isolate()); Callable callable = CodeFactory::Construct(isolate());
HConstant* stub = Add<HConstant>(callable.code()); HConstant* stub = Add<HConstant>(callable.code());
PushArgumentsFromEnvironment(argument_count); PushArgumentsFromEnvironment(argument_count);
...@@ -11039,7 +11034,7 @@ HValue* HGraphBuilder::BuildBinaryOperation( ...@@ -11039,7 +11034,7 @@ HValue* HGraphBuilder::BuildBinaryOperation(
// inline several instructions (including the two pushes) for every tagged // inline several instructions (including the two pushes) for every tagged
// operation in optimized code, which is more expensive, than a stub call. // operation in optimized code, which is more expensive, than a stub call.
if (graph()->info()->IsStub() && is_non_primitive) { if (graph()->info()->IsStub() && is_non_primitive) {
HValue* values[] = {context(), left, right}; HValue* values[] = {left, right};
#define GET_STUB(Name) \ #define GET_STUB(Name) \
do { \ do { \
Callable callable = CodeFactory::Name(isolate()); \ Callable callable = CodeFactory::Name(isolate()); \
...@@ -11439,7 +11434,7 @@ void HOptimizedGraphBuilder::VisitCompareOperation(CompareOperation* expr) { ...@@ -11439,7 +11434,7 @@ void HOptimizedGraphBuilder::VisitCompareOperation(CompareOperation* expr) {
Callable callable = CodeFactory::InstanceOf(isolate()); Callable callable = CodeFactory::InstanceOf(isolate());
HValue* stub = Add<HConstant>(callable.code()); HValue* stub = Add<HConstant>(callable.code());
HValue* values[] = {context(), left, right}; HValue* values[] = {left, right};
HCallWithDescriptor* result = New<HCallWithDescriptor>( HCallWithDescriptor* result = New<HCallWithDescriptor>(
stub, 0, callable.descriptor(), ArrayVector(values)); stub, 0, callable.descriptor(), ArrayVector(values));
result->set_type(HType::Boolean()); result->set_type(HType::Boolean());
...@@ -11448,7 +11443,7 @@ void HOptimizedGraphBuilder::VisitCompareOperation(CompareOperation* expr) { ...@@ -11448,7 +11443,7 @@ void HOptimizedGraphBuilder::VisitCompareOperation(CompareOperation* expr) {
} else if (op == Token::IN) { } else if (op == Token::IN) {
Callable callable = CodeFactory::HasProperty(isolate()); Callable callable = CodeFactory::HasProperty(isolate());
HValue* stub = Add<HConstant>(callable.code()); HValue* stub = Add<HConstant>(callable.code());
HValue* values[] = {context(), left, right}; HValue* values[] = {left, right};
HInstruction* result = HInstruction* result =
New<HCallWithDescriptor>(stub, 0, callable.descriptor(), New<HCallWithDescriptor>(stub, 0, callable.descriptor(),
Vector<HValue*>(values, arraysize(values))); Vector<HValue*>(values, arraysize(values)));
...@@ -12189,7 +12184,7 @@ void HOptimizedGraphBuilder::GenerateToInteger(CallRuntime* call) { ...@@ -12189,7 +12184,7 @@ void HOptimizedGraphBuilder::GenerateToInteger(CallRuntime* call) {
} else { } else {
Callable callable = CodeFactory::ToInteger(isolate()); Callable callable = CodeFactory::ToInteger(isolate());
HValue* stub = Add<HConstant>(callable.code()); HValue* stub = Add<HConstant>(callable.code());
HValue* values[] = {context(), input}; HValue* values[] = {input};
HInstruction* result = New<HCallWithDescriptor>( HInstruction* result = New<HCallWithDescriptor>(
stub, 0, callable.descriptor(), ArrayVector(values)); stub, 0, callable.descriptor(), ArrayVector(values));
return ast_context()->ReturnInstruction(result, call->id()); return ast_context()->ReturnInstruction(result, call->id());
...@@ -12215,7 +12210,7 @@ void HOptimizedGraphBuilder::GenerateToString(CallRuntime* call) { ...@@ -12215,7 +12210,7 @@ void HOptimizedGraphBuilder::GenerateToString(CallRuntime* call) {
} else { } else {
Callable callable = CodeFactory::ToString(isolate()); Callable callable = CodeFactory::ToString(isolate());
HValue* stub = Add<HConstant>(callable.code()); HValue* stub = Add<HConstant>(callable.code());
HValue* values[] = {context(), input}; HValue* values[] = {input};
HInstruction* result = New<HCallWithDescriptor>( HInstruction* result = New<HCallWithDescriptor>(
stub, 0, callable.descriptor(), ArrayVector(values)); stub, 0, callable.descriptor(), ArrayVector(values));
return ast_context()->ReturnInstruction(result, call->id()); return ast_context()->ReturnInstruction(result, call->id());
...@@ -12229,7 +12224,7 @@ void HOptimizedGraphBuilder::GenerateToLength(CallRuntime* call) { ...@@ -12229,7 +12224,7 @@ void HOptimizedGraphBuilder::GenerateToLength(CallRuntime* call) {
Callable callable = CodeFactory::ToLength(isolate()); Callable callable = CodeFactory::ToLength(isolate());
HValue* input = Pop(); HValue* input = Pop();
HValue* stub = Add<HConstant>(callable.code()); HValue* stub = Add<HConstant>(callable.code());
HValue* values[] = {context(), input}; HValue* values[] = {input};
HInstruction* result = New<HCallWithDescriptor>( HInstruction* result = New<HCallWithDescriptor>(
stub, 0, callable.descriptor(), ArrayVector(values)); stub, 0, callable.descriptor(), ArrayVector(values));
return ast_context()->ReturnInstruction(result, call->id()); return ast_context()->ReturnInstruction(result, call->id());
...@@ -12321,7 +12316,7 @@ void HOptimizedGraphBuilder::GenerateSubString(CallRuntime* call) { ...@@ -12321,7 +12316,7 @@ void HOptimizedGraphBuilder::GenerateSubString(CallRuntime* call) {
HValue* to = Pop(); HValue* to = Pop();
HValue* from = Pop(); HValue* from = Pop();
HValue* string = Pop(); HValue* string = Pop();
HValue* values[] = {context(), string, from, to}; HValue* values[] = {string, from, to};
HInstruction* result = New<HCallWithDescriptor>( HInstruction* result = New<HCallWithDescriptor>(
stub, 0, callable.descriptor(), ArrayVector(values)); stub, 0, callable.descriptor(), ArrayVector(values));
result->set_type(HType::String()); result->set_type(HType::String());
...@@ -12334,7 +12329,7 @@ void HOptimizedGraphBuilder::GenerateNewObject(CallRuntime* call) { ...@@ -12334,7 +12329,7 @@ void HOptimizedGraphBuilder::GenerateNewObject(CallRuntime* call) {
CHECK_ALIVE(VisitExpressions(call->arguments())); CHECK_ALIVE(VisitExpressions(call->arguments()));
FastNewObjectStub stub(isolate()); FastNewObjectStub stub(isolate());
FastNewObjectDescriptor descriptor(isolate()); FastNewObjectDescriptor descriptor(isolate());
HValue* values[] = {context(), Pop(), Pop()}; HValue* values[] = {Pop(), Pop()};
HConstant* stub_value = Add<HConstant>(stub.GetCode()); HConstant* stub_value = Add<HConstant>(stub.GetCode());
HInstruction* result = HInstruction* result =
New<HCallWithDescriptor>(stub_value, 0, descriptor, ArrayVector(values)); New<HCallWithDescriptor>(stub_value, 0, descriptor, ArrayVector(values));
...@@ -12351,8 +12346,7 @@ void HOptimizedGraphBuilder::GenerateRegExpExec(CallRuntime* call) { ...@@ -12351,8 +12346,7 @@ void HOptimizedGraphBuilder::GenerateRegExpExec(CallRuntime* call) {
HValue* subject = Pop(); HValue* subject = Pop();
HValue* regexp_object = Pop(); HValue* regexp_object = Pop();
HValue* stub = Add<HConstant>(callable.code()); HValue* stub = Add<HConstant>(callable.code());
HValue* values[] = {context(), regexp_object, subject, index, HValue* values[] = {regexp_object, subject, index, last_match_info};
last_match_info};
HInstruction* result = New<HCallWithDescriptor>( HInstruction* result = New<HCallWithDescriptor>(
stub, 0, callable.descriptor(), ArrayVector(values)); stub, 0, callable.descriptor(), ArrayVector(values));
return ast_context()->ReturnInstruction(result, call->id()); return ast_context()->ReturnInstruction(result, call->id());
...@@ -12411,8 +12405,7 @@ void HOptimizedGraphBuilder::GenerateCall(CallRuntime* call) { ...@@ -12411,8 +12405,7 @@ void HOptimizedGraphBuilder::GenerateCall(CallRuntime* call) {
PushArgumentsFromEnvironment(call->arguments()->length() - 1); PushArgumentsFromEnvironment(call->arguments()->length() - 1);
HValue* trampoline = Add<HConstant>(isolate()->builtins()->Call()); HValue* trampoline = Add<HConstant>(isolate()->builtins()->Call());
HValue* target = Pop(); HValue* target = Pop();
HValue* values[] = {context(), target, HValue* values[] = {target, Add<HConstant>(call->arguments()->length() - 2)};
Add<HConstant>(call->arguments()->length() - 2)};
HInstruction* result = HInstruction* result =
New<HCallWithDescriptor>(trampoline, call->arguments()->length() - 1, New<HCallWithDescriptor>(trampoline, call->arguments()->length() - 1,
descriptor, ArrayVector(values)); descriptor, ArrayVector(values));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment