OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/full-codegen/full-codegen.h" | 5 #include "src/full-codegen/full-codegen.h" |
6 | 6 |
7 #include "src/ast/ast-numbering.h" | 7 #include "src/ast/ast-numbering.h" |
8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/ast/prettyprinter.h" | 9 #include "src/ast/prettyprinter.h" |
10 #include "src/ast/scopes.h" | 10 #include "src/ast/scopes.h" |
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1060 EmitUnwindAndReturn(); | 1060 EmitUnwindAndReturn(); |
1061 } | 1061 } |
1062 | 1062 |
1063 | 1063 |
1064 void FullCodeGenerator::VisitWithStatement(WithStatement* stmt) { | 1064 void FullCodeGenerator::VisitWithStatement(WithStatement* stmt) { |
1065 Comment cmnt(masm_, "[ WithStatement"); | 1065 Comment cmnt(masm_, "[ WithStatement"); |
1066 SetStatementPosition(stmt); | 1066 SetStatementPosition(stmt); |
1067 | 1067 |
1068 VisitForAccumulatorValue(stmt->expression()); | 1068 VisitForAccumulatorValue(stmt->expression()); |
1069 Callable callable = CodeFactory::ToObject(isolate()); | 1069 Callable callable = CodeFactory::ToObject(isolate()); |
1070 __ Push(context_register()); | |
1070 __ Move(callable.descriptor().GetRegisterParameter(0), result_register()); | 1071 __ Move(callable.descriptor().GetRegisterParameter(0), result_register()); |
1071 __ Call(callable.code(), RelocInfo::CODE_TARGET); | 1072 __ Call(callable.code(), RelocInfo::CODE_TARGET); |
1073 __ Pop(context_register()); | |
Michael Starzinger
2016/08/09 10:24:29
Please use FullCodeGenerator::RestoreContext after
Franzi
2016/08/09 11:21:38
Done.
| |
1072 PrepareForBailoutForId(stmt->ToObjectId(), BailoutState::TOS_REGISTER); | 1074 PrepareForBailoutForId(stmt->ToObjectId(), BailoutState::TOS_REGISTER); |
1073 PushOperand(result_register()); | 1075 PushOperand(result_register()); |
1074 PushFunctionArgumentForContextAllocation(); | 1076 PushFunctionArgumentForContextAllocation(); |
1075 CallRuntimeWithOperands(Runtime::kPushWithContext); | 1077 CallRuntimeWithOperands(Runtime::kPushWithContext); |
1076 StoreToFrameField(StandardFrameConstants::kContextOffset, context_register()); | 1078 StoreToFrameField(StandardFrameConstants::kContextOffset, context_register()); |
1077 PrepareForBailoutForId(stmt->EntryId(), BailoutState::NO_REGISTERS); | 1079 PrepareForBailoutForId(stmt->EntryId(), BailoutState::NO_REGISTERS); |
1078 | 1080 |
1079 Scope* saved_scope = scope(); | 1081 Scope* saved_scope = scope(); |
1080 scope_ = stmt->scope(); | 1082 scope_ = stmt->scope(); |
1081 { WithOrCatch body(this); | 1083 { WithOrCatch body(this); |
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1936 return var->scope()->is_nonlinear() || | 1938 return var->scope()->is_nonlinear() || |
1937 var->initializer_position() >= proxy->position(); | 1939 var->initializer_position() >= proxy->position(); |
1938 } | 1940 } |
1939 | 1941 |
1940 | 1942 |
1941 #undef __ | 1943 #undef __ |
1942 | 1944 |
1943 | 1945 |
1944 } // namespace internal | 1946 } // namespace internal |
1945 } // namespace v8 | 1947 } // namespace v8 |
OLD | NEW |