| 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 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1217   environment()->BindAccumulator(context); | 1217   environment()->BindAccumulator(context); | 
| 1218 } | 1218 } | 
| 1219 | 1219 | 
| 1220 void BytecodeGraphBuilder::VisitCreateFunctionContext() { | 1220 void BytecodeGraphBuilder::VisitCreateFunctionContext() { | 
| 1221   uint32_t slots = bytecode_iterator().GetUnsignedImmediateOperand(0); | 1221   uint32_t slots = bytecode_iterator().GetUnsignedImmediateOperand(0); | 
| 1222   const Operator* op = javascript()->CreateFunctionContext(slots); | 1222   const Operator* op = javascript()->CreateFunctionContext(slots); | 
| 1223   Node* context = NewNode(op, GetFunctionClosure()); | 1223   Node* context = NewNode(op, GetFunctionClosure()); | 
| 1224   environment()->BindAccumulator(context); | 1224   environment()->BindAccumulator(context); | 
| 1225 } | 1225 } | 
| 1226 | 1226 | 
|  | 1227 void BytecodeGraphBuilder::VisitCreateEvalContext() { | 
|  | 1228   uint32_t slots = bytecode_iterator().GetUnsignedImmediateOperand(0); | 
|  | 1229   // TODO(littledan): Make an eval context, not a function context | 
|  | 1230   const Operator* op = javascript()->CreateFunctionContext(slots); | 
|  | 1231   Node* context = NewNode(op, GetFunctionClosure()); | 
|  | 1232   environment()->BindAccumulator(context); | 
|  | 1233 } | 
|  | 1234 | 
| 1227 void BytecodeGraphBuilder::VisitCreateCatchContext() { | 1235 void BytecodeGraphBuilder::VisitCreateCatchContext() { | 
| 1228   interpreter::Register reg = bytecode_iterator().GetRegisterOperand(0); | 1236   interpreter::Register reg = bytecode_iterator().GetRegisterOperand(0); | 
| 1229   Node* exception = environment()->LookupRegister(reg); | 1237   Node* exception = environment()->LookupRegister(reg); | 
| 1230   Handle<String> name = | 1238   Handle<String> name = | 
| 1231       Handle<String>::cast(bytecode_iterator().GetConstantForIndexOperand(1)); | 1239       Handle<String>::cast(bytecode_iterator().GetConstantForIndexOperand(1)); | 
| 1232   Handle<ScopeInfo> scope_info = Handle<ScopeInfo>::cast( | 1240   Handle<ScopeInfo> scope_info = Handle<ScopeInfo>::cast( | 
| 1233       bytecode_iterator().GetConstantForIndexOperand(2)); | 1241       bytecode_iterator().GetConstantForIndexOperand(2)); | 
| 1234   Node* closure = environment()->LookupAccumulator(); | 1242   Node* closure = environment()->LookupAccumulator(); | 
| 1235 | 1243 | 
| 1236   const Operator* op = javascript()->CreateCatchContext(name, scope_info); | 1244   const Operator* op = javascript()->CreateCatchContext(name, scope_info); | 
| (...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2278     source_positions_->set_current_position(it->source_position()); | 2286     source_positions_->set_current_position(it->source_position()); | 
| 2279     it->Advance(); | 2287     it->Advance(); | 
| 2280   } else { | 2288   } else { | 
| 2281     DCHECK_GT(it->code_offset(), offset); | 2289     DCHECK_GT(it->code_offset(), offset); | 
| 2282   } | 2290   } | 
| 2283 } | 2291 } | 
| 2284 | 2292 | 
| 2285 }  // namespace compiler | 2293 }  // namespace compiler | 
| 2286 }  // namespace internal | 2294 }  // namespace internal | 
| 2287 }  // namespace v8 | 2295 }  // namespace v8 | 
| OLD | NEW | 
|---|