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

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

Issue 1436493002: [builtins] Introduce specialized Call/CallFunction builtins. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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/mips64/full-codegen-mips64.cc ('k') | src/globals.h » ('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 5c834e6d5fa8da1d71b0ed0d96e0e377f6b16794..4aa86d6bb26a46c894dbd9e27a0947a92930c4eb 100644
--- a/src/full-codegen/x64/full-codegen-x64.cc
+++ b/src/full-codegen/x64/full-codegen-x64.cc
@@ -2065,7 +2065,9 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
SetCallPosition(expr, 1);
__ Set(rax, 1);
- __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
+ __ Call(
+ isolate()->builtins()->Call(ConvertReceiverMode::kNotNullOrUndefined),
+ RelocInfo::CODE_TARGET);
__ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
__ Drop(1); // The function is still on the stack; drop it.
@@ -2697,14 +2699,16 @@ void FullCodeGenerator::EmitCallWithLoadIC(Call* expr) {
Expression* callee = expr->expression();
// Get the target function.
+ ConvertReceiverMode convert_mode;
if (callee->IsVariableProxy()) {
{ StackValueContext context(this);
EmitVariableLoad(callee->AsVariableProxy());
PrepareForBailout(callee, NO_REGISTERS);
}
- // Push undefined as receiver. This is patched in the method prologue if it
+ // Push undefined as receiver. This is patched in the Call builtin if it
// is a sloppy mode method.
__ Push(isolate()->factory()->undefined_value());
+ convert_mode = ConvertReceiverMode::kNullOrUndefined;
} else {
// Load the function from the receiver.
DCHECK(callee->IsProperty());
@@ -2715,9 +2719,10 @@ void FullCodeGenerator::EmitCallWithLoadIC(Call* expr) {
// Push the target function under the receiver.
__ Push(Operand(rsp, 0));
__ movp(Operand(rsp, kPointerSize), rax);
+ convert_mode = ConvertReceiverMode::kNotNullOrUndefined;
}
- EmitCall(expr);
+ EmitCall(expr, convert_mode);
}
@@ -2778,7 +2783,7 @@ void FullCodeGenerator::EmitKeyedCallWithLoadIC(Call* expr,
__ Push(Operand(rsp, 0));
__ movp(Operand(rsp, kPointerSize), rax);
- EmitCall(expr);
+ EmitCall(expr, ConvertReceiverMode::kNotNullOrUndefined);
}
@@ -2818,7 +2823,7 @@ void FullCodeGenerator::EmitKeyedSuperCallWithLoadIC(Call* expr) {
}
-void FullCodeGenerator::EmitCall(Call* expr) {
+void FullCodeGenerator::EmitCall(Call* expr, ConvertReceiverMode mode) {
// Load the arguments.
ZoneList<Expression*>* args = expr->arguments();
int arg_count = args->length();
@@ -2828,7 +2833,7 @@ void FullCodeGenerator::EmitCall(Call* expr) {
PrepareForBailoutForId(expr->CallId(), NO_REGISTERS);
SetCallPosition(expr, arg_count);
- Handle<Code> ic = CodeFactory::CallIC(isolate(), arg_count).code();
+ Handle<Code> ic = CodeFactory::CallIC(isolate(), arg_count, mode).code();
__ Move(rdx, SmiFromSlot(expr->CallFeedbackICSlot()));
__ movp(rdi, Operand(rsp, (arg_count + 1) * kPointerSize));
// Don't assign a type feedback id to the IC, since type feedback is provided
@@ -4168,7 +4173,8 @@ void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) {
SetCallPosition(expr, arg_count);
__ movp(rdi, Operand(rsp, (arg_count + 1) * kPointerSize));
__ Set(rax, arg_count);
- __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
+ __ Call(isolate()->builtins()->Call(ConvertReceiverMode::kNullOrUndefined),
+ RelocInfo::CODE_TARGET);
}
« no previous file with comments | « src/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698