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); | |
1122 PretenureFlag tenured = | 1120 PretenureFlag tenured = |
1123 interpreter::CreateClosureFlags::PretenuredBit::decode( | 1121 interpreter::CreateClosureFlags::PretenuredBit::decode( |
1124 bytecode_iterator().GetFlagOperand(2)) | 1122 bytecode_iterator().GetFlagOperand(1)) |
1125 ? TENURED | 1123 ? TENURED |
1126 : NOT_TENURED; | 1124 : NOT_TENURED; |
1127 const Operator* op = javascript()->CreateClosure(shared_info, pair, tenured); | 1125 const Operator* op = javascript()->CreateClosure(shared_info, tenured); |
1128 Node* closure = NewNode(op); | 1126 Node* closure = NewNode(op); |
1129 environment()->BindAccumulator(closure); | 1127 environment()->BindAccumulator(closure); |
1130 } | 1128 } |
1131 | 1129 |
1132 void BytecodeGraphBuilder::VisitCreateBlockContext() { | 1130 void BytecodeGraphBuilder::VisitCreateBlockContext() { |
1133 Handle<ScopeInfo> scope_info = Handle<ScopeInfo>::cast( | 1131 Handle<ScopeInfo> scope_info = Handle<ScopeInfo>::cast( |
1134 bytecode_iterator().GetConstantForIndexOperand(0)); | 1132 bytecode_iterator().GetConstantForIndexOperand(0)); |
1135 | 1133 |
1136 const Operator* op = javascript()->CreateBlockContext(scope_info); | 1134 const Operator* op = javascript()->CreateBlockContext(scope_info); |
1137 Node* context = NewNode(op, environment()->LookupAccumulator()); | 1135 Node* context = NewNode(op, environment()->LookupAccumulator()); |
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2291 it->source_position().ScriptOffset(), start_position_.InliningId())); | 2289 it->source_position().ScriptOffset(), start_position_.InliningId())); |
2292 it->Advance(); | 2290 it->Advance(); |
2293 } else { | 2291 } else { |
2294 DCHECK_GT(it->code_offset(), offset); | 2292 DCHECK_GT(it->code_offset(), offset); |
2295 } | 2293 } |
2296 } | 2294 } |
2297 | 2295 |
2298 } // namespace compiler | 2296 } // namespace compiler |
2299 } // namespace internal | 2297 } // namespace internal |
2300 } // namespace v8 | 2298 } // namespace v8 |
OLD | NEW |