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 3154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3165 Node* local_context = NewNode(op, GetFunctionClosure()); | 3165 Node* local_context = NewNode(op, GetFunctionClosure()); |
3166 | 3166 |
3167 return local_context; | 3167 return local_context; |
3168 } | 3168 } |
3169 | 3169 |
3170 | 3170 |
3171 Node* AstGraphBuilder::BuildLocalScriptContext(Scope* scope) { | 3171 Node* AstGraphBuilder::BuildLocalScriptContext(Scope* scope) { |
3172 DCHECK(scope->is_script_scope()); | 3172 DCHECK(scope->is_script_scope()); |
3173 | 3173 |
3174 // Allocate a new local context. | 3174 // Allocate a new local context. |
3175 Handle<ScopeInfo> scope_info = scope->GetScopeInfo(isolate()); | 3175 Handle<ScopeInfo> scope_info = scope->scope_info(); |
3176 const Operator* op = javascript()->CreateScriptContext(scope_info); | 3176 const Operator* op = javascript()->CreateScriptContext(scope_info); |
3177 Node* local_context = NewNode(op, GetFunctionClosure()); | 3177 Node* local_context = NewNode(op, GetFunctionClosure()); |
3178 PrepareFrameState(local_context, BailoutId::ScriptContext(), | 3178 PrepareFrameState(local_context, BailoutId::ScriptContext(), |
3179 OutputFrameStateCombine::Push()); | 3179 OutputFrameStateCombine::Push()); |
3180 | 3180 |
3181 return local_context; | 3181 return local_context; |
3182 } | 3182 } |
3183 | 3183 |
3184 | 3184 |
3185 Node* AstGraphBuilder::BuildLocalBlockContext(Scope* scope) { | 3185 Node* AstGraphBuilder::BuildLocalBlockContext(Scope* scope) { |
3186 DCHECK(scope->is_block_scope()); | 3186 DCHECK(scope->is_block_scope()); |
3187 | 3187 |
3188 // Allocate a new local context. | 3188 // Allocate a new local context. |
3189 Handle<ScopeInfo> scope_info = scope->GetScopeInfo(isolate()); | 3189 Handle<ScopeInfo> scope_info = scope->scope_info(); |
3190 const Operator* op = javascript()->CreateBlockContext(scope_info); | 3190 const Operator* op = javascript()->CreateBlockContext(scope_info); |
3191 Node* local_context = NewNode(op, GetFunctionClosureForContext()); | 3191 Node* local_context = NewNode(op, GetFunctionClosureForContext()); |
3192 | 3192 |
3193 return local_context; | 3193 return local_context; |
3194 } | 3194 } |
3195 | 3195 |
3196 | 3196 |
3197 Node* AstGraphBuilder::BuildArgumentsObject(Variable* arguments) { | 3197 Node* AstGraphBuilder::BuildArgumentsObject(Variable* arguments) { |
3198 if (arguments == nullptr) return nullptr; | 3198 if (arguments == nullptr) return nullptr; |
3199 | 3199 |
(...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4325 // Phi does not exist yet, introduce one. | 4325 // Phi does not exist yet, introduce one. |
4326 value = NewPhi(inputs, value, control); | 4326 value = NewPhi(inputs, value, control); |
4327 value->ReplaceInput(inputs - 1, other); | 4327 value->ReplaceInput(inputs - 1, other); |
4328 } | 4328 } |
4329 return value; | 4329 return value; |
4330 } | 4330 } |
4331 | 4331 |
4332 } // namespace compiler | 4332 } // namespace compiler |
4333 } // namespace internal | 4333 } // namespace internal |
4334 } // namespace v8 | 4334 } // namespace v8 |
OLD | NEW |