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

Side by Side Diff: src/hydrogen.cc

Issue 1325573004: [runtime] Replace many buggy uses of %_CallFunction with %_Call. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address feedback. Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « src/hydrogen.h ('k') | src/ia32/interface-descriptors-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/hydrogen.h" 5 #include "src/hydrogen.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/allocation-site-scopes.h" 9 #include "src/allocation-site-scopes.h"
10 #include "src/ast-numbering.h" 10 #include "src/ast-numbering.h"
(...skipping 12459 matching lines...) Expand 10 before | Expand all | Expand 10 after
12470 // Fast support for number to string. 12470 // Fast support for number to string.
12471 void HOptimizedGraphBuilder::GenerateNumberToString(CallRuntime* call) { 12471 void HOptimizedGraphBuilder::GenerateNumberToString(CallRuntime* call) {
12472 DCHECK_EQ(1, call->arguments()->length()); 12472 DCHECK_EQ(1, call->arguments()->length());
12473 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); 12473 CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
12474 HValue* number = Pop(); 12474 HValue* number = Pop();
12475 HValue* result = BuildNumberToString(number, Type::Any(zone())); 12475 HValue* result = BuildNumberToString(number, Type::Any(zone()));
12476 return ast_context()->ReturnValue(result); 12476 return ast_context()->ReturnValue(result);
12477 } 12477 }
12478 12478
12479 12479
12480 // Fast support for calls.
12481 void HOptimizedGraphBuilder::GenerateCall(CallRuntime* call) {
12482 DCHECK_LE(2, call->arguments()->length());
12483 CHECK_ALIVE(VisitExpressions(call->arguments()));
12484 CallTrampolineDescriptor descriptor(isolate());
12485 PushArgumentsFromEnvironment(call->arguments()->length() - 1);
12486 HValue* trampoline = Add<HConstant>(isolate()->builtins()->Call());
12487 HValue* target = Pop();
12488 HValue* values[] = {context(), target,
12489 Add<HConstant>(call->arguments()->length() - 2)};
12490 HInstruction* result = New<HCallWithDescriptor>(
12491 trampoline, call->arguments()->length() - 1, descriptor,
12492 Vector<HValue*>(values, arraysize(values)));
12493 return ast_context()->ReturnInstruction(result, call->id());
12494 }
12495
12496
12480 // Fast call for custom callbacks. 12497 // Fast call for custom callbacks.
12481 void HOptimizedGraphBuilder::GenerateCallFunction(CallRuntime* call) { 12498 void HOptimizedGraphBuilder::GenerateCallFunction(CallRuntime* call) {
12482 // 1 ~ The function to call is not itself an argument to the call. 12499 // 1 ~ The function to call is not itself an argument to the call.
12483 int arg_count = call->arguments()->length() - 1; 12500 int arg_count = call->arguments()->length() - 1;
12484 DCHECK(arg_count >= 1); // There's always at least a receiver. 12501 DCHECK(arg_count >= 1); // There's always at least a receiver.
12485 12502
12486 CHECK_ALIVE(VisitExpressions(call->arguments())); 12503 CHECK_ALIVE(VisitExpressions(call->arguments()));
12487 // The function is the last argument 12504 // The function is the last argument
12488 HValue* function = Pop(); 12505 HValue* function = Pop();
12489 // Push the arguments to the stack 12506 // Push the arguments to the stack
(...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after
13444 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13461 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
13445 } 13462 }
13446 13463
13447 #ifdef DEBUG 13464 #ifdef DEBUG
13448 graph_->Verify(false); // No full verify. 13465 graph_->Verify(false); // No full verify.
13449 #endif 13466 #endif
13450 } 13467 }
13451 13468
13452 } // namespace internal 13469 } // namespace internal
13453 } // namespace v8 13470 } // namespace v8
OLDNEW
« no previous file with comments | « src/hydrogen.h ('k') | src/ia32/interface-descriptors-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698