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

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

Issue 13176002: factor out "ReloadContextFromFrame" (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 7 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/ia32/macro-assembler-ia32.cc ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/full-codegen-x64.cc
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc
index 322479dec60715085633e4642ff18b3c31d5ae29..83390047bbd0121cdc96e328054faa87f412cfed 100644
--- a/src/x64/full-codegen-x64.cc
+++ b/src/x64/full-codegen-x64.cc
@@ -2219,8 +2219,7 @@ void FullCodeGenerator::EmitCallWithIC(Call* expr,
isolate()->stub_cache()->ComputeCallInitialize(arg_count, mode);
CallIC(ic, mode, expr->CallFeedbackId());
RecordJSReturnSite(expr);
- // Restore context register.
- __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
+ __ ReloadContextFromFrame();
context()->Plug(rax);
}
@@ -2252,8 +2251,7 @@ void FullCodeGenerator::EmitKeyedCallWithIC(Call* expr,
__ movq(rcx, Operand(rsp, (arg_count + 1) * kPointerSize)); // Key.
CallIC(ic, RelocInfo::CODE_TARGET, expr->CallFeedbackId());
RecordJSReturnSite(expr);
- // Restore context register.
- __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
+ __ ReloadContextFromFrame();
context()->DropAndPlug(1, rax); // Drop the key still on the stack.
}
@@ -2283,8 +2281,7 @@ void FullCodeGenerator::EmitCallWithStub(Call* expr, CallFunctionFlags flags) {
__ movq(rdi, Operand(rsp, (arg_count + 1) * kPointerSize));
__ CallStub(&stub, expr->CallFeedbackId());
RecordJSReturnSite(expr);
- // Restore context register.
- __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
+ __ ReloadContextFromFrame();
// Discard the function left on TOS.
context()->DropAndPlug(1, rax);
}
@@ -2355,8 +2352,7 @@ void FullCodeGenerator::VisitCall(Call* expr) {
__ movq(rdi, Operand(rsp, (arg_count + 1) * kPointerSize));
__ CallStub(&stub);
RecordJSReturnSite(expr);
- // Restore context register.
- __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
+ __ ReloadContextFromFrame();
context()->DropAndPlug(1, rax);
} else if (proxy != NULL && proxy->var()->IsUnallocated()) {
// Call to a global variable. Push global object as receiver for the
@@ -3054,7 +3050,7 @@ void FullCodeGenerator::EmitDateField(CallRuntime* expr) {
__ movq(rsi, index, RelocInfo::NONE64);
#endif
__ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2);
- __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
+ __ ReloadContextFromFrame();
__ jmp(&done);
}
@@ -3368,7 +3364,7 @@ void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) {
ParameterCount count(arg_count);
__ InvokeFunction(rdi, count, CALL_FUNCTION,
NullCallWrapper(), CALL_AS_METHOD);
- __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
+ __ ReloadContextFromFrame();
__ jmp(&done);
__ bind(&runtime);
@@ -3806,7 +3802,7 @@ void FullCodeGenerator::EmitFastAsciiArrayJoin(CallRuntime* expr) {
__ bind(&return_result);
// Drop temp values from the stack, and restore context register.
__ addq(rsp, Immediate(3 * kPointerSize));
- __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
+ __ ReloadContextFromFrame();
context()->Plug(rax);
}
@@ -3841,8 +3837,7 @@ void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
Handle<Code> ic =
isolate()->stub_cache()->ComputeCallInitialize(arg_count, mode);
CallIC(ic, mode, expr->CallRuntimeFeedbackId());
- // Restore context register.
- __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
+ __ ReloadContextFromFrame();
} else {
__ CallRuntime(expr->function(), arg_count);
}
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698