Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Unified Diff: src/hydrogen.cc

Issue 296113008: Allow HPushArgument to handle more than one argument. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase, and use int instead of unsigned Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index a4c8d012dabaeb75d23dc06aabb48349053a804b..457bd090b559171320115bcff639288df1b4e0ef 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -1726,7 +1726,7 @@ HValue* HGraphBuilder::BuildNumberToString(HValue* object, Type* type) {
if_found.Else();
{
// Cache miss, fallback to runtime.
- Add<HPushArgument>(object);
+ Add<HPushArguments>(zone(), object);
Push(Add<HCallRuntime>(
isolate()->factory()->empty_string(),
Runtime::FunctionForId(Runtime::kHiddenNumberToStringSkipCache),
@@ -2050,8 +2050,7 @@ HValue* HGraphBuilder::BuildUncheckedStringAdd(
if_sameencodingandsequential.Else();
{
// Fallback to the runtime to add the two strings.
- Add<HPushArgument>(left);
- Add<HPushArgument>(right);
+ Add<HPushArguments>(zone(), left, right);
Push(Add<HCallRuntime>(
isolate()->factory()->empty_string(),
Runtime::FunctionForId(Runtime::kHiddenStringAdd),
@@ -4188,9 +4187,11 @@ void HOptimizedGraphBuilder::PushArgumentsFromEnvironment(int count) {
arguments.Add(Pop(), zone());
}
+ HPushArguments* push_args = New<HPushArguments>(zone());
while (!arguments.is_empty()) {
- Add<HPushArgument>(arguments.RemoveLast());
+ push_args->AddArgument(arguments.RemoveLast());
}
+ AddInstruction(push_args);
}
@@ -5184,10 +5185,11 @@ void HOptimizedGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
flags |= expr->has_function()
? ObjectLiteral::kHasFunction : ObjectLiteral::kNoFlags;
- Add<HPushArgument>(Add<HConstant>(closure_literals));
- Add<HPushArgument>(Add<HConstant>(literal_index));
- Add<HPushArgument>(Add<HConstant>(constant_properties));
- Add<HPushArgument>(Add<HConstant>(flags));
+ Add<HPushArguments>(zone(),
+ Add<HConstant>(closure_literals),
+ Add<HConstant>(literal_index),
+ Add<HConstant>(constant_properties),
+ Add<HConstant>(flags));
// TODO(mvstanton): Add a flag to turn off creation of any
// AllocationMementos for this call: we are in crankshaft and should have
@@ -5342,10 +5344,11 @@ void HOptimizedGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) {
: ArrayLiteral::kNoFlags;
flags |= ArrayLiteral::kDisableMementos;
- Add<HPushArgument>(Add<HConstant>(literals));
- Add<HPushArgument>(Add<HConstant>(literal_index));
- Add<HPushArgument>(Add<HConstant>(constants));
- Add<HPushArgument>(Add<HConstant>(flags));
+ Add<HPushArguments>(zone(),
+ Add<HConstant>(literals),
+ Add<HConstant>(literal_index),
+ Add<HConstant>(constants),
+ Add<HConstant>(flags));
// TODO(mvstanton): Consider a flag to turn off creation of any
// AllocationMementos for this call: we are in crankshaft and should have
@@ -6379,7 +6382,7 @@ void HOptimizedGraphBuilder::VisitThrow(Throw* expr) {
HValue* value = environment()->Pop();
if (!FLAG_hydrogen_track_positions) SetSourcePosition(expr->position());
- Add<HPushArgument>(value);
+ Add<HPushArguments>(zone(), value);
Add<HCallRuntime>(isolate()->factory()->empty_string(),
Runtime::FunctionForId(Runtime::kHiddenThrow), 1);
Add<HSimulate>(expr->id());
@@ -6781,7 +6784,7 @@ void HOptimizedGraphBuilder::EnsureArgumentsArePushedForAccess() {
HInstruction* insert_after = entry;
for (int i = 0; i < arguments_values->length(); i++) {
HValue* argument = arguments_values->at(i);
- HInstruction* push_argument = New<HPushArgument>(argument);
+ HInstruction* push_argument = New<HPushArguments>(zone(), argument);
push_argument->InsertAfter(insert_after);
insert_after = push_argument;
}
@@ -8076,7 +8079,7 @@ bool HOptimizedGraphBuilder::TryInlineApiCall(Handle<JSFunction> function,
ASSERT_EQ(NULL, receiver);
// Receiver is on expression stack.
receiver = Pop();
- Add<HPushArgument>(receiver);
+ Add<HPushArguments>(zone(), receiver);
break;
case kCallApiSetter:
{
@@ -8087,8 +8090,7 @@ bool HOptimizedGraphBuilder::TryInlineApiCall(Handle<JSFunction> function,
// Receiver and value are on expression stack.
HValue* value = Pop();
receiver = Pop();
- Add<HPushArgument>(receiver);
- Add<HPushArgument>(value);
+ Add<HPushArguments>(zone(), receiver, value);
break;
}
}
@@ -8656,7 +8658,7 @@ void HOptimizedGraphBuilder::VisitCallNew(CallNew* expr) {
}
// TODO(mstarzinger): For now we remove the previous HAllocate and all
- // corresponding instructions and instead add HPushArgument for the
+ // corresponding instructions and instead add HPushArguments for the
// arguments in case inlining failed. What we actually should do is for
// inlining to try to build a subgraph without mutating the parent graph.
HInstruction* instr = current_block()->last();
@@ -9135,9 +9137,8 @@ void HOptimizedGraphBuilder::VisitDelete(UnaryOperation* expr) {
HValue* key = Pop();
HValue* obj = Pop();
HValue* function = AddLoadJSBuiltin(Builtins::DELETE);
- Add<HPushArgument>(obj);
- Add<HPushArgument>(key);
- Add<HPushArgument>(Add<HConstant>(function_strict_mode()));
+ Add<HPushArguments>(zone(),
+ obj, key, Add<HConstant>(function_strict_mode()));
// TODO(olivf) InvokeFunction produces a check for the parameter count,
// even though we are certain to pass the correct number of arguments here.
HInstruction* instr = New<HInvokeFunction>(function, 3);
@@ -9622,8 +9623,7 @@ HValue* HGraphBuilder::BuildBinaryOperation(
} else if (!left_type->Is(Type::String())) {
ASSERT(right_type->Is(Type::String()));
HValue* function = AddLoadJSBuiltin(Builtins::STRING_ADD_RIGHT);
- Add<HPushArgument>(left);
- Add<HPushArgument>(right);
+ Add<HPushArguments>(zone(), left, right);
return AddUncasted<HInvokeFunction>(function, 2);
}
@@ -9634,8 +9634,7 @@ HValue* HGraphBuilder::BuildBinaryOperation(
} else if (!right_type->Is(Type::String())) {
ASSERT(left_type->Is(Type::String()));
HValue* function = AddLoadJSBuiltin(Builtins::STRING_ADD_LEFT);
- Add<HPushArgument>(left);
- Add<HPushArgument>(right);
+ Add<HPushArguments>(zone(), left, right);
return AddUncasted<HInvokeFunction>(function, 2);
}
@@ -9697,8 +9696,7 @@ HValue* HGraphBuilder::BuildBinaryOperation(
// operation in optimized code, which is more expensive, than a stub call.
if (graph()->info()->IsStub() && is_non_primitive) {
HValue* function = AddLoadJSBuiltin(BinaryOpIC::TokenToJSBuiltin(op));
- Add<HPushArgument>(left);
- Add<HPushArgument>(right);
+ Add<HPushArguments>(zone(), left, right);
instr = AddUncasted<HInvokeFunction>(function, 2);
} else {
switch (op) {
@@ -10062,8 +10060,7 @@ void HOptimizedGraphBuilder::VisitCompareOperation(CompareOperation* expr) {
UNREACHABLE();
} else if (op == Token::IN) {
HValue* function = AddLoadJSBuiltin(Builtins::IN);
- Add<HPushArgument>(left);
- Add<HPushArgument>(right);
+ Add<HPushArguments>(zone(), left, right);
// TODO(olivf) InvokeFunction produces a check for the parameter count,
// even though we are certain to pass the correct number of arguments here.
HInstruction* result = New<HInvokeFunction>(function, 2);
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698