| 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 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 __ Move(callable.descriptor().GetRegisterParameter(0), result_register()); | 1070 __ Move(callable.descriptor().GetRegisterParameter(0), result_register()); |
| 1071 __ Call(callable.code(), RelocInfo::CODE_TARGET); | 1071 __ Call(callable.code(), RelocInfo::CODE_TARGET); |
| 1072 RestoreContext(); |
| 1072 PrepareForBailoutForId(stmt->ToObjectId(), BailoutState::TOS_REGISTER); | 1073 PrepareForBailoutForId(stmt->ToObjectId(), BailoutState::TOS_REGISTER); |
| 1073 PushOperand(result_register()); | 1074 PushOperand(result_register()); |
| 1074 PushFunctionArgumentForContextAllocation(); | 1075 PushFunctionArgumentForContextAllocation(); |
| 1075 CallRuntimeWithOperands(Runtime::kPushWithContext); | 1076 CallRuntimeWithOperands(Runtime::kPushWithContext); |
| 1076 StoreToFrameField(StandardFrameConstants::kContextOffset, context_register()); | 1077 StoreToFrameField(StandardFrameConstants::kContextOffset, context_register()); |
| 1077 PrepareForBailoutForId(stmt->EntryId(), BailoutState::NO_REGISTERS); | 1078 PrepareForBailoutForId(stmt->EntryId(), BailoutState::NO_REGISTERS); |
| 1078 | 1079 |
| 1079 Scope* saved_scope = scope(); | 1080 Scope* saved_scope = scope(); |
| 1080 scope_ = stmt->scope(); | 1081 scope_ = stmt->scope(); |
| 1081 { WithOrCatch body(this); | 1082 { WithOrCatch body(this); |
| (...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1936 return var->scope()->is_nonlinear() || | 1937 return var->scope()->is_nonlinear() || |
| 1937 var->initializer_position() >= proxy->position(); | 1938 var->initializer_position() >= proxy->position(); |
| 1938 } | 1939 } |
| 1939 | 1940 |
| 1940 | 1941 |
| 1941 #undef __ | 1942 #undef __ |
| 1942 | 1943 |
| 1943 | 1944 |
| 1944 } // namespace internal | 1945 } // namespace internal |
| 1945 } // namespace v8 | 1946 } // namespace v8 |
| OLD | NEW |