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

Unified Diff: src/x64/builtins-x64.cc

Issue 1489323002: [builtins] Remove some (now) unused code from C++ builtin adaptor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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
Index: src/x64/builtins-x64.cc
diff --git a/src/x64/builtins-x64.cc b/src/x64/builtins-x64.cc
index 36ec61cdde36aecdd2bb7744594eff9cf39c8753..cd680ba5233630bbf394c867f0ddd3fe736ce3c0 100644
--- a/src/x64/builtins-x64.cc
+++ b/src/x64/builtins-x64.cc
@@ -32,13 +32,6 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm,
// -----------------------------------
__ AssertFunction(rdi);
- // Make sure we operate in the context of the called function (for example
- // ConstructStubs implemented in C++ will be run in the context of the caller
- // instead of the callee, due to the way that [[Construct]] is defined for
- // ordinary functions).
- // TODO(bmeurer): Can we make this more robust?
- __ movp(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
-
// Insert extra arguments.
int num_extra_args = 0;
if (extra_args == NEEDS_CALLED_FUNCTION) {
@@ -51,20 +44,8 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm,
}
// JumpToExternalReference expects rax to contain the number of arguments
- // including the receiver and the extra arguments. But rax is only valid
- // if the called function is marked as DontAdaptArguments, otherwise we
- // need to load the argument count from the SharedFunctionInfo.
- Label argc, done_argc;
- __ movp(rdx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset));
- __ LoadSharedFunctionInfoSpecialField(
- rbx, rdx, SharedFunctionInfo::kFormalParameterCountOffset);
- __ cmpp(rbx, Immediate(SharedFunctionInfo::kDontAdaptArgumentsSentinel));
- __ j(equal, &argc, Label::kNear);
- __ leap(rax, Operand(rbx, num_extra_args + 1));
- __ jmp(&done_argc, Label::kNear);
- __ bind(&argc);
+ // including the receiver and the extra arguments.
__ addp(rax, Immediate(num_extra_args + 1));
- __ bind(&done_argc);
__ JumpToExternalReference(ExternalReference(id, masm->isolate()), 1);
}

Powered by Google App Engine
This is Rietveld 408576698