Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(810)

Side by Side Diff: src/compiler/ast-graph-builder.cc

Issue 2435023002: Use a different map to distinguish eval contexts (Closed)
Patch Set: Changes from review Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/code-stubs.cc ('k') | src/compiler/bytecode-graph-builder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/code-stubs.cc ('k') | src/compiler/bytecode-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698