| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/ast-graph-builder.h" | 5 #include "src/compiler/ast-graph-builder.h" |
| 6 | 6 |
| 7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
| 9 #include "src/compiler/ast-loop-assignment-analyzer.h" | 9 #include "src/compiler/ast-loop-assignment-analyzer.h" |
| 10 #include "src/compiler/control-builders.h" | 10 #include "src/compiler/control-builders.h" |
| (...skipping 3151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3162 Node* local_context = NewNode(op, GetFunctionClosure()); | 3162 Node* local_context = NewNode(op, GetFunctionClosure()); |
| 3163 | 3163 |
| 3164 return local_context; | 3164 return local_context; |
| 3165 } | 3165 } |
| 3166 | 3166 |
| 3167 | 3167 |
| 3168 Node* AstGraphBuilder::BuildLocalScriptContext(Scope* scope) { | 3168 Node* AstGraphBuilder::BuildLocalScriptContext(Scope* scope) { |
| 3169 DCHECK(scope->is_script_scope()); | 3169 DCHECK(scope->is_script_scope()); |
| 3170 | 3170 |
| 3171 // Allocate a new local context. | 3171 // Allocate a new local context. |
| 3172 Handle<ScopeInfo> scope_info = scope->GetScopeInfo(isolate()); | 3172 Handle<ScopeInfo> scope_info = scope->scope_info(); |
| 3173 const Operator* op = javascript()->CreateScriptContext(scope_info); | 3173 const Operator* op = javascript()->CreateScriptContext(scope_info); |
| 3174 Node* local_context = NewNode(op, GetFunctionClosure()); | 3174 Node* local_context = NewNode(op, GetFunctionClosure()); |
| 3175 PrepareFrameState(local_context, BailoutId::ScriptContext(), | 3175 PrepareFrameState(local_context, BailoutId::ScriptContext(), |
| 3176 OutputFrameStateCombine::Push()); | 3176 OutputFrameStateCombine::Push()); |
| 3177 | 3177 |
| 3178 return local_context; | 3178 return local_context; |
| 3179 } | 3179 } |
| 3180 | 3180 |
| 3181 | 3181 |
| 3182 Node* AstGraphBuilder::BuildLocalBlockContext(Scope* scope) { | 3182 Node* AstGraphBuilder::BuildLocalBlockContext(Scope* scope) { |
| 3183 DCHECK(scope->is_block_scope()); | 3183 DCHECK(scope->is_block_scope()); |
| 3184 | 3184 |
| 3185 // Allocate a new local context. | 3185 // Allocate a new local context. |
| 3186 Handle<ScopeInfo> scope_info = scope->GetScopeInfo(isolate()); | 3186 Handle<ScopeInfo> scope_info = scope->scope_info(); |
| 3187 const Operator* op = javascript()->CreateBlockContext(scope_info); | 3187 const Operator* op = javascript()->CreateBlockContext(scope_info); |
| 3188 Node* local_context = NewNode(op, GetFunctionClosureForContext()); | 3188 Node* local_context = NewNode(op, GetFunctionClosureForContext()); |
| 3189 | 3189 |
| 3190 return local_context; | 3190 return local_context; |
| 3191 } | 3191 } |
| 3192 | 3192 |
| 3193 | 3193 |
| 3194 Node* AstGraphBuilder::BuildArgumentsObject(Variable* arguments) { | 3194 Node* AstGraphBuilder::BuildArgumentsObject(Variable* arguments) { |
| 3195 if (arguments == nullptr) return nullptr; | 3195 if (arguments == nullptr) return nullptr; |
| 3196 | 3196 |
| (...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4322 // Phi does not exist yet, introduce one. | 4322 // Phi does not exist yet, introduce one. |
| 4323 value = NewPhi(inputs, value, control); | 4323 value = NewPhi(inputs, value, control); |
| 4324 value->ReplaceInput(inputs - 1, other); | 4324 value->ReplaceInput(inputs - 1, other); |
| 4325 } | 4325 } |
| 4326 return value; | 4326 return value; |
| 4327 } | 4327 } |
| 4328 | 4328 |
| 4329 } // namespace compiler | 4329 } // namespace compiler |
| 4330 } // namespace internal | 4330 } // namespace internal |
| 4331 } // namespace v8 | 4331 } // namespace v8 |
| OLD | NEW |