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/compile-time-value.h" | 7 #include "src/ast/compile-time-value.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.h" | 10 #include "src/compiler.h" |
(...skipping 2409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2420 | 2420 |
2421 return local_context; | 2421 return local_context; |
2422 } | 2422 } |
2423 | 2423 |
2424 | 2424 |
2425 Node* AstGraphBuilder::BuildLocalFunctionContext(Scope* scope) { | 2425 Node* AstGraphBuilder::BuildLocalFunctionContext(Scope* scope) { |
2426 DCHECK(scope->is_function_scope() || scope->is_eval_scope()); | 2426 DCHECK(scope->is_function_scope() || scope->is_eval_scope()); |
2427 | 2427 |
2428 // Allocate a new local context. | 2428 // Allocate a new local context. |
2429 int slot_count = scope->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 2429 int slot_count = scope->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
2430 const Operator* op = javascript()->CreateFunctionContext(slot_count); | 2430 const Operator* op = |
| 2431 javascript()->CreateFunctionContext(slot_count, scope->scope_type()); |
2431 Node* local_context = NewNode(op, GetFunctionClosure()); | 2432 Node* local_context = NewNode(op, GetFunctionClosure()); |
2432 | 2433 |
2433 return local_context; | 2434 return local_context; |
2434 } | 2435 } |
2435 | 2436 |
2436 | 2437 |
2437 Node* AstGraphBuilder::BuildLocalScriptContext(Scope* scope) { | 2438 Node* AstGraphBuilder::BuildLocalScriptContext(Scope* scope) { |
2438 DCHECK(scope->is_script_scope()); | 2439 DCHECK(scope->is_script_scope()); |
2439 | 2440 |
2440 // Allocate a new local context. | 2441 // Allocate a new local context. |
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3297 float invocation_frequency, LoopAssignmentAnalysis* loop_assignment, | 3298 float invocation_frequency, LoopAssignmentAnalysis* loop_assignment, |
3298 SourcePositionTable* source_positions, int inlining_id) | 3299 SourcePositionTable* source_positions, int inlining_id) |
3299 : AstGraphBuilder(local_zone, info, jsgraph, invocation_frequency, | 3300 : AstGraphBuilder(local_zone, info, jsgraph, invocation_frequency, |
3300 loop_assignment), | 3301 loop_assignment), |
3301 source_positions_(source_positions), | 3302 source_positions_(source_positions), |
3302 start_position_(info->shared_info()->start_position(), inlining_id) {} | 3303 start_position_(info->shared_info()->start_position(), inlining_id) {} |
3303 | 3304 |
3304 } // namespace compiler | 3305 } // namespace compiler |
3305 } // namespace internal | 3306 } // namespace internal |
3306 } // namespace v8 | 3307 } // namespace v8 |
OLD | NEW |