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 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1099 | 1099 |
1100 void BytecodeGraphBuilder::VisitPopContext() { | 1100 void BytecodeGraphBuilder::VisitPopContext() { |
1101 Node* context = | 1101 Node* context = |
1102 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); | 1102 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); |
1103 environment()->SetContext(context); | 1103 environment()->SetContext(context); |
1104 } | 1104 } |
1105 | 1105 |
1106 void BytecodeGraphBuilder::VisitCreateClosure() { | 1106 void BytecodeGraphBuilder::VisitCreateClosure() { |
1107 Handle<SharedFunctionInfo> shared_info = Handle<SharedFunctionInfo>::cast( | 1107 Handle<SharedFunctionInfo> shared_info = Handle<SharedFunctionInfo>::cast( |
1108 bytecode_iterator().GetConstantForIndexOperand(0)); | 1108 bytecode_iterator().GetConstantForIndexOperand(0)); |
| 1109 int const slot_id = bytecode_iterator().GetIndexOperand(1); |
| 1110 VectorSlotPair pair = CreateVectorSlotPair(slot_id); |
1109 PretenureFlag tenured = | 1111 PretenureFlag tenured = |
1110 interpreter::CreateClosureFlags::PretenuredBit::decode( | 1112 interpreter::CreateClosureFlags::PretenuredBit::decode( |
1111 bytecode_iterator().GetFlagOperand(1)) | 1113 bytecode_iterator().GetFlagOperand(2)) |
1112 ? TENURED | 1114 ? TENURED |
1113 : NOT_TENURED; | 1115 : NOT_TENURED; |
1114 const Operator* op = javascript()->CreateClosure(shared_info, tenured); | 1116 const Operator* op = javascript()->CreateClosure(shared_info, pair, tenured); |
1115 Node* closure = NewNode(op); | 1117 Node* closure = NewNode(op); |
1116 environment()->BindAccumulator(closure); | 1118 environment()->BindAccumulator(closure); |
1117 } | 1119 } |
1118 | 1120 |
1119 void BytecodeGraphBuilder::VisitCreateBlockContext() { | 1121 void BytecodeGraphBuilder::VisitCreateBlockContext() { |
1120 Handle<ScopeInfo> scope_info = Handle<ScopeInfo>::cast( | 1122 Handle<ScopeInfo> scope_info = Handle<ScopeInfo>::cast( |
1121 bytecode_iterator().GetConstantForIndexOperand(0)); | 1123 bytecode_iterator().GetConstantForIndexOperand(0)); |
1122 | 1124 |
1123 const Operator* op = javascript()->CreateBlockContext(scope_info); | 1125 const Operator* op = javascript()->CreateBlockContext(scope_info); |
1124 Node* context = NewNode(op, environment()->LookupAccumulator()); | 1126 Node* context = NewNode(op, environment()->LookupAccumulator()); |
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2236 it->source_position().ScriptOffset(), start_position_.InliningId())); | 2238 it->source_position().ScriptOffset(), start_position_.InliningId())); |
2237 it->Advance(); | 2239 it->Advance(); |
2238 } else { | 2240 } else { |
2239 DCHECK_GT(it->code_offset(), offset); | 2241 DCHECK_GT(it->code_offset(), offset); |
2240 } | 2242 } |
2241 } | 2243 } |
2242 | 2244 |
2243 } // namespace compiler | 2245 } // namespace compiler |
2244 } // namespace internal | 2246 } // namespace internal |
2245 } // namespace v8 | 2247 } // namespace v8 |
OLD | NEW |