| 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/bytecode-branch-analysis.h" | 10 #include "src/compiler/bytecode-branch-analysis.h" |
| (...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1139 environment()->BindAccumulator(context); | 1139 environment()->BindAccumulator(context); |
| 1140 } | 1140 } |
| 1141 | 1141 |
| 1142 void BytecodeGraphBuilder::VisitCreateFunctionContext() { | 1142 void BytecodeGraphBuilder::VisitCreateFunctionContext() { |
| 1143 uint32_t slots = bytecode_iterator().GetUnsignedImmediateOperand(0); | 1143 uint32_t slots = bytecode_iterator().GetUnsignedImmediateOperand(0); |
| 1144 const Operator* op = javascript()->CreateFunctionContext(slots); | 1144 const Operator* op = javascript()->CreateFunctionContext(slots); |
| 1145 Node* context = NewNode(op, GetFunctionClosure()); | 1145 Node* context = NewNode(op, GetFunctionClosure()); |
| 1146 environment()->BindAccumulator(context); | 1146 environment()->BindAccumulator(context); |
| 1147 } | 1147 } |
| 1148 | 1148 |
| 1149 void BytecodeGraphBuilder::VisitCreateEvalContext() { |
| 1150 uint32_t slots = bytecode_iterator().GetUnsignedImmediateOperand(0); |
| 1151 // TODO(littledan): Make an eval context, not a function context |
| 1152 const Operator* op = javascript()->CreateFunctionContext(slots); |
| 1153 Node* context = NewNode(op, GetFunctionClosure()); |
| 1154 environment()->BindAccumulator(context); |
| 1155 } |
| 1156 |
| 1149 void BytecodeGraphBuilder::VisitCreateCatchContext() { | 1157 void BytecodeGraphBuilder::VisitCreateCatchContext() { |
| 1150 interpreter::Register reg = bytecode_iterator().GetRegisterOperand(0); | 1158 interpreter::Register reg = bytecode_iterator().GetRegisterOperand(0); |
| 1151 Node* exception = environment()->LookupRegister(reg); | 1159 Node* exception = environment()->LookupRegister(reg); |
| 1152 Handle<String> name = | 1160 Handle<String> name = |
| 1153 Handle<String>::cast(bytecode_iterator().GetConstantForIndexOperand(1)); | 1161 Handle<String>::cast(bytecode_iterator().GetConstantForIndexOperand(1)); |
| 1154 Handle<ScopeInfo> scope_info = Handle<ScopeInfo>::cast( | 1162 Handle<ScopeInfo> scope_info = Handle<ScopeInfo>::cast( |
| 1155 bytecode_iterator().GetConstantForIndexOperand(2)); | 1163 bytecode_iterator().GetConstantForIndexOperand(2)); |
| 1156 Node* closure = environment()->LookupAccumulator(); | 1164 Node* closure = environment()->LookupAccumulator(); |
| 1157 | 1165 |
| 1158 const Operator* op = javascript()->CreateCatchContext(name, scope_info); | 1166 const Operator* op = javascript()->CreateCatchContext(name, scope_info); |
| (...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2206 source_positions_->set_current_position(it->source_position()); | 2214 source_positions_->set_current_position(it->source_position()); |
| 2207 it->Advance(); | 2215 it->Advance(); |
| 2208 } else { | 2216 } else { |
| 2209 DCHECK_GT(it->code_offset(), offset); | 2217 DCHECK_GT(it->code_offset(), offset); |
| 2210 } | 2218 } |
| 2211 } | 2219 } |
| 2212 | 2220 |
| 2213 } // namespace compiler | 2221 } // namespace compiler |
| 2214 } // namespace internal | 2222 } // namespace internal |
| 2215 } // namespace v8 | 2223 } // namespace v8 |
| OLD | NEW |