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 3162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3173 Node* local_context = NewNode(op, GetFunctionClosure()); | 3173 Node* local_context = NewNode(op, GetFunctionClosure()); |
3174 | 3174 |
3175 return local_context; | 3175 return local_context; |
3176 } | 3176 } |
3177 | 3177 |
3178 | 3178 |
3179 Node* AstGraphBuilder::BuildLocalScriptContext(Scope* scope) { | 3179 Node* AstGraphBuilder::BuildLocalScriptContext(Scope* scope) { |
3180 DCHECK(scope->is_script_scope()); | 3180 DCHECK(scope->is_script_scope()); |
3181 | 3181 |
3182 // Allocate a new local context. | 3182 // Allocate a new local context. |
3183 Handle<ScopeInfo> scope_info = scope->GetScopeInfo(isolate()); | 3183 Handle<ScopeInfo> scope_info = scope->scope_info(); |
3184 const Operator* op = javascript()->CreateScriptContext(scope_info); | 3184 const Operator* op = javascript()->CreateScriptContext(scope_info); |
3185 Node* local_context = NewNode(op, GetFunctionClosure()); | 3185 Node* local_context = NewNode(op, GetFunctionClosure()); |
3186 PrepareFrameState(local_context, BailoutId::ScriptContext(), | 3186 PrepareFrameState(local_context, BailoutId::ScriptContext(), |
3187 OutputFrameStateCombine::Push()); | 3187 OutputFrameStateCombine::Push()); |
3188 | 3188 |
3189 return local_context; | 3189 return local_context; |
3190 } | 3190 } |
3191 | 3191 |
3192 | 3192 |
3193 Node* AstGraphBuilder::BuildLocalBlockContext(Scope* scope) { | 3193 Node* AstGraphBuilder::BuildLocalBlockContext(Scope* scope) { |
3194 DCHECK(scope->is_block_scope()); | 3194 DCHECK(scope->is_block_scope()); |
3195 | 3195 |
3196 // Allocate a new local context. | 3196 // Allocate a new local context. |
3197 Handle<ScopeInfo> scope_info = scope->GetScopeInfo(isolate()); | 3197 Handle<ScopeInfo> scope_info = scope->scope_info(); |
3198 const Operator* op = javascript()->CreateBlockContext(scope_info); | 3198 const Operator* op = javascript()->CreateBlockContext(scope_info); |
3199 Node* local_context = NewNode(op, GetFunctionClosureForContext()); | 3199 Node* local_context = NewNode(op, GetFunctionClosureForContext()); |
3200 | 3200 |
3201 return local_context; | 3201 return local_context; |
3202 } | 3202 } |
3203 | 3203 |
3204 | 3204 |
3205 Node* AstGraphBuilder::BuildArgumentsObject(Variable* arguments) { | 3205 Node* AstGraphBuilder::BuildArgumentsObject(Variable* arguments) { |
3206 if (arguments == nullptr) return nullptr; | 3206 if (arguments == nullptr) return nullptr; |
3207 | 3207 |
(...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4333 // Phi does not exist yet, introduce one. | 4333 // Phi does not exist yet, introduce one. |
4334 value = NewPhi(inputs, value, control); | 4334 value = NewPhi(inputs, value, control); |
4335 value->ReplaceInput(inputs - 1, other); | 4335 value->ReplaceInput(inputs - 1, other); |
4336 } | 4336 } |
4337 return value; | 4337 return value; |
4338 } | 4338 } |
4339 | 4339 |
4340 } // namespace compiler | 4340 } // namespace compiler |
4341 } // namespace internal | 4341 } // namespace internal |
4342 } // namespace v8 | 4342 } // namespace v8 |
OLD | NEW |