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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/hydrogen.h ('k') | src/ia32/interface-descriptors-ia32.cc » ('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 99b4ddd1e884c4bef8ed45725289219bac43682c..40d4c83e88a6a0419082336228d3375bad3f78c3 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -12477,6 +12477,23 @@ void HOptimizedGraphBuilder::GenerateNumberToString(CallRuntime* call) {
}
+// Fast support for calls.
+void HOptimizedGraphBuilder::GenerateCall(CallRuntime* call) {
+ DCHECK_LE(2, call->arguments()->length());
+ CHECK_ALIVE(VisitExpressions(call->arguments()));
+ CallTrampolineDescriptor descriptor(isolate());
+ PushArgumentsFromEnvironment(call->arguments()->length() - 1);
+ HValue* trampoline = Add<HConstant>(isolate()->builtins()->Call());
+ HValue* target = Pop();
+ HValue* values[] = {context(), target,
+ Add<HConstant>(call->arguments()->length() - 2)};
+ HInstruction* result = New<HCallWithDescriptor>(
+ trampoline, call->arguments()->length() - 1, descriptor,
+ Vector<HValue*>(values, arraysize(values)));
+ return ast_context()->ReturnInstruction(result, call->id());
+}
+
+
// Fast call for custom callbacks.
void HOptimizedGraphBuilder::GenerateCallFunction(CallRuntime* call) {
// 1 ~ The function to call is not itself an argument to the call.
« 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