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/scopeinfo.h" | 10 #include "src/ast/scopeinfo.h" |
(...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1086 | 1086 |
1087 | 1087 |
1088 void FullCodeGenerator::VisitWithStatement(WithStatement* stmt) { | 1088 void FullCodeGenerator::VisitWithStatement(WithStatement* stmt) { |
1089 Comment cmnt(masm_, "[ WithStatement"); | 1089 Comment cmnt(masm_, "[ WithStatement"); |
1090 SetStatementPosition(stmt); | 1090 SetStatementPosition(stmt); |
1091 | 1091 |
1092 VisitForAccumulatorValue(stmt->expression()); | 1092 VisitForAccumulatorValue(stmt->expression()); |
1093 Callable callable = CodeFactory::ToObject(isolate()); | 1093 Callable callable = CodeFactory::ToObject(isolate()); |
1094 __ Move(callable.descriptor().GetRegisterParameter(0), result_register()); | 1094 __ Move(callable.descriptor().GetRegisterParameter(0), result_register()); |
1095 __ Call(callable.code(), RelocInfo::CODE_TARGET); | 1095 __ Call(callable.code(), RelocInfo::CODE_TARGET); |
1096 PrepareForBailoutForId(stmt->ToObjectId(), BailoutState::NO_REGISTERS); | 1096 PrepareForBailoutForId(stmt->ToObjectId(), BailoutState::TOS_REGISTER); |
1097 PushOperand(result_register()); | 1097 PushOperand(result_register()); |
1098 PushFunctionArgumentForContextAllocation(); | 1098 PushFunctionArgumentForContextAllocation(); |
1099 CallRuntimeWithOperands(Runtime::kPushWithContext); | 1099 CallRuntimeWithOperands(Runtime::kPushWithContext); |
1100 StoreToFrameField(StandardFrameConstants::kContextOffset, context_register()); | 1100 StoreToFrameField(StandardFrameConstants::kContextOffset, context_register()); |
1101 PrepareForBailoutForId(stmt->EntryId(), BailoutState::NO_REGISTERS); | 1101 PrepareForBailoutForId(stmt->EntryId(), BailoutState::NO_REGISTERS); |
1102 | 1102 |
1103 Scope* saved_scope = scope(); | 1103 Scope* saved_scope = scope(); |
1104 scope_ = stmt->scope(); | 1104 scope_ = stmt->scope(); |
1105 { WithOrCatch body(this); | 1105 { WithOrCatch body(this); |
1106 Visit(stmt->statement()); | 1106 Visit(stmt->statement()); |
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1961 return var->scope()->is_nonlinear() || | 1961 return var->scope()->is_nonlinear() || |
1962 var->initializer_position() >= proxy->position(); | 1962 var->initializer_position() >= proxy->position(); |
1963 } | 1963 } |
1964 | 1964 |
1965 | 1965 |
1966 #undef __ | 1966 #undef __ |
1967 | 1967 |
1968 | 1968 |
1969 } // namespace internal | 1969 } // namespace internal |
1970 } // namespace v8 | 1970 } // namespace v8 |
OLD | NEW |