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

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

Issue 1481753003: [compiler] Decouple ToObject from CreateWithContext. (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/compiler/js-typed-lowering.cc ('k') | src/runtime/runtime-scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/full-codegen.cc
diff --git a/src/full-codegen/full-codegen.cc b/src/full-codegen/full-codegen.cc
index c4d96454c48e824e142c74e0ab90816bbb838053..03f1b5137895cc44dc09cf1dea0afb3addbe4447 100644
--- a/src/full-codegen/full-codegen.cc
+++ b/src/full-codegen/full-codegen.cc
@@ -952,7 +952,12 @@ void FullCodeGenerator::VisitWithStatement(WithStatement* stmt) {
Comment cmnt(masm_, "[ WithStatement");
SetStatementPosition(stmt);
- VisitForStackValue(stmt->expression());
+ VisitForAccumulatorValue(stmt->expression());
+ Callable callable = CodeFactory::ToObject(isolate());
+ __ Move(callable.descriptor().GetRegisterParameter(0), result_register());
+ __ Call(callable.code(), RelocInfo::CODE_TARGET);
+ PrepareForBailoutForId(stmt->ToObjectId(), NO_REGISTERS);
+ __ Push(result_register());
PushFunctionArgumentForContextAllocation();
__ CallRuntime(Runtime::kPushWithContext, 2);
StoreToFrameField(StandardFrameConstants::kContextOffset, context_register());
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | src/runtime/runtime-scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698