 Chromium Code Reviews
 Chromium Code Reviews Issue 1458603012:
  [Interpreter] Add CreateClosure to BytecodeGraphBuilder.  (Closed) 
  Base URL: https://chromium.googlesource.com/v8/v8.git@master
    
  
    Issue 1458603012:
  [Interpreter] Add CreateClosure to BytecodeGraphBuilder.  (Closed) 
  Base URL: https://chromium.googlesource.com/v8/v8.git@master| Index: src/compiler/bytecode-graph-builder.cc | 
| diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc | 
| index 5bb208ce94f7e5d8a2550d24cb9d0a1f4268c29b..7c8995619b5daa6345a0da3cfd0abe830554f381 100644 | 
| --- a/src/compiler/bytecode-graph-builder.cc | 
| +++ b/src/compiler/bytecode-graph-builder.cc | 
| @@ -5,6 +5,7 @@ | 
| #include "src/compiler/bytecode-graph-builder.h" | 
| #include "src/compiler/linkage.h" | 
| +#include "src/compiler/node-matchers.h" | 
| 
mythria
2015/11/24 13:07:28
This may not be needed now.
 
Michael Starzinger
2015/11/24 13:51:24
+1
 | 
| #include "src/compiler/operator-properties.h" | 
| #include "src/interpreter/bytecode-array-iterator.h" | 
| @@ -643,7 +644,20 @@ void BytecodeGraphBuilder::VisitPopContext( | 
| void BytecodeGraphBuilder::VisitCreateClosure( | 
| const interpreter::BytecodeArrayIterator& iterator) { | 
| - UNIMPLEMENTED(); | 
| + Handle<SharedFunctionInfo> shared_info = | 
| + Handle<SharedFunctionInfo>::cast(iterator.GetConstantForIndexOperand(0)); | 
| + PretenureFlag tenured = | 
| + iterator.GetImmediateOperand(1) ? TENURED : NOT_TENURED; | 
| + const Operator* op = javascript()->CreateClosure(shared_info, tenured); | 
| + Node* closure = NewNode(op); | 
| + AddEmptyFrameStateInputs(closure); | 
| + environment()->BindAccumulator(closure); | 
| +} | 
| + | 
| + | 
| +void BytecodeGraphBuilder::VisitCreateClosureWide( | 
| + const interpreter::BytecodeArrayIterator& iterator) { | 
| + VisitCreateClosure(iterator); | 
| } |