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

Unified Diff: src/full-codegen/x64/full-codegen-x64.cc

Issue 1811563002: [fullcodegen] Avoid arguments juggling when calling a JS runtime function. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@call-js-runtime
Patch Set: Created 4 years, 9 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/full-codegen/s390/full-codegen-s390.cc ('k') | src/full-codegen/x87/full-codegen-x87.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/x64/full-codegen-x64.cc
diff --git a/src/full-codegen/x64/full-codegen-x64.cc b/src/full-codegen/x64/full-codegen-x64.cc
index f942f697f7253f331beb68124ff9716ad032725e..d38121760acd4b9e538a56dadc90e0f7f5c9118c 100644
--- a/src/full-codegen/x64/full-codegen-x64.cc
+++ b/src/full-codegen/x64/full-codegen-x64.cc
@@ -3230,11 +3230,13 @@ void FullCodeGenerator::EmitCreateIterResultObject(CallRuntime* expr) {
void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) {
- // Push the builtins object as receiver.
+ // Push function.
+ __ LoadNativeContextSlot(expr->context_index(), rax);
+ PushOperand(rax);
+
+ // Push undefined as receiver.
OperandStackDepthIncrement(1);
__ PushRoot(Heap::kUndefinedValueRootIndex);
-
- __ LoadNativeContextSlot(expr->context_index(), rax);
}
@@ -3257,13 +3259,8 @@ void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
if (expr->is_jsruntime()) {
Comment cmnt(masm_, "[ CallRuntime");
-
EmitLoadJSRuntimeFunction(expr);
- // Push the target function under the receiver.
- PushOperand(Operand(rsp, 0));
- __ movp(Operand(rsp, kPointerSize), rax);
-
// Push the arguments ("left-to-right").
for (int i = 0; i < arg_count; i++) {
VisitForStackValue(args->at(i));
« no previous file with comments | « src/full-codegen/s390/full-codegen-s390.cc ('k') | src/full-codegen/x87/full-codegen-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698