OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/compiler/bytecode-graph-builder.h" | 5 #include "src/compiler/bytecode-graph-builder.h" |
6 | 6 |
7 #include "src/ast/ast.h" | 7 #include "src/ast/ast.h" |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/compilation-info.h" | 9 #include "src/compilation-info.h" |
10 #include "src/compiler/compiler-source-position-table.h" | 10 #include "src/compiler/compiler-source-position-table.h" |
(...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1110 | 1110 |
1111 void BytecodeGraphBuilder::VisitPopContext() { | 1111 void BytecodeGraphBuilder::VisitPopContext() { |
1112 Node* context = | 1112 Node* context = |
1113 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); | 1113 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); |
1114 environment()->SetContext(context); | 1114 environment()->SetContext(context); |
1115 } | 1115 } |
1116 | 1116 |
1117 void BytecodeGraphBuilder::VisitCreateClosure() { | 1117 void BytecodeGraphBuilder::VisitCreateClosure() { |
1118 Handle<SharedFunctionInfo> shared_info = Handle<SharedFunctionInfo>::cast( | 1118 Handle<SharedFunctionInfo> shared_info = Handle<SharedFunctionInfo>::cast( |
1119 bytecode_iterator().GetConstantForIndexOperand(0)); | 1119 bytecode_iterator().GetConstantForIndexOperand(0)); |
| 1120 int const slot_id = bytecode_iterator().GetIndexOperand(1); |
| 1121 VectorSlotPair pair = CreateVectorSlotPair(slot_id); |
1120 PretenureFlag tenured = | 1122 PretenureFlag tenured = |
1121 interpreter::CreateClosureFlags::PretenuredBit::decode( | 1123 interpreter::CreateClosureFlags::PretenuredBit::decode( |
1122 bytecode_iterator().GetFlagOperand(1)) | 1124 bytecode_iterator().GetFlagOperand(2)) |
1123 ? TENURED | 1125 ? TENURED |
1124 : NOT_TENURED; | 1126 : NOT_TENURED; |
1125 const Operator* op = javascript()->CreateClosure(shared_info, tenured); | 1127 const Operator* op = javascript()->CreateClosure(shared_info, pair, tenured); |
1126 Node* closure = NewNode(op); | 1128 Node* closure = NewNode(op); |
1127 environment()->BindAccumulator(closure); | 1129 environment()->BindAccumulator(closure); |
1128 } | 1130 } |
1129 | 1131 |
1130 void BytecodeGraphBuilder::VisitCreateBlockContext() { | 1132 void BytecodeGraphBuilder::VisitCreateBlockContext() { |
1131 Handle<ScopeInfo> scope_info = Handle<ScopeInfo>::cast( | 1133 Handle<ScopeInfo> scope_info = Handle<ScopeInfo>::cast( |
1132 bytecode_iterator().GetConstantForIndexOperand(0)); | 1134 bytecode_iterator().GetConstantForIndexOperand(0)); |
1133 | 1135 |
1134 const Operator* op = javascript()->CreateBlockContext(scope_info); | 1136 const Operator* op = javascript()->CreateBlockContext(scope_info); |
1135 Node* context = NewNode(op, environment()->LookupAccumulator()); | 1137 Node* context = NewNode(op, environment()->LookupAccumulator()); |
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2289 it->source_position().ScriptOffset(), start_position_.InliningId())); | 2291 it->source_position().ScriptOffset(), start_position_.InliningId())); |
2290 it->Advance(); | 2292 it->Advance(); |
2291 } else { | 2293 } else { |
2292 DCHECK_GT(it->code_offset(), offset); | 2294 DCHECK_GT(it->code_offset(), offset); |
2293 } | 2295 } |
2294 } | 2296 } |
2295 | 2297 |
2296 } // namespace compiler | 2298 } // namespace compiler |
2297 } // namespace internal | 2299 } // namespace internal |
2298 } // namespace v8 | 2300 } // namespace v8 |
OLD | NEW |