OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/crankshaft/typing.h" | 5 #include "src/crankshaft/typing.h" |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/frames.h" | 8 #include "src/frames.h" |
9 #include "src/frames-inl.h" | 9 #include "src/frames-inl.h" |
10 #include "src/ostreams.h" | 10 #include "src/ostreams.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 #ifdef OBJECT_PRINT | 77 #ifdef OBJECT_PRINT |
78 if (FLAG_trace_osr && FLAG_print_scopes) { | 78 if (FLAG_trace_osr && FLAG_print_scopes) { |
79 PrintObserved(scope_->receiver(), frame->receiver(), | 79 PrintObserved(scope_->receiver(), frame->receiver(), |
80 store_.LookupBounds(parameter_index(-1)).lower); | 80 store_.LookupBounds(parameter_index(-1)).lower); |
81 | 81 |
82 for (int i = 0; i < params; i++) { | 82 for (int i = 0; i < params; i++) { |
83 PrintObserved(scope_->parameter(i), frame->GetParameter(i), | 83 PrintObserved(scope_->parameter(i), frame->GetParameter(i), |
84 store_.LookupBounds(parameter_index(i)).lower); | 84 store_.LookupBounds(parameter_index(i)).lower); |
85 } | 85 } |
86 | 86 |
87 ZoneList<Variable*> local_vars(locals, zone()); | 87 ZoneList<Variable*>* local_vars = scope_->locals(); |
88 ZoneList<Variable*> context_vars(scope_->ContextLocalCount(), zone()); | 88 int local_index = 0; |
89 ZoneList<Variable*> global_vars(scope_->ContextGlobalCount(), zone()); | 89 for (int i = 0; i < local_vars->length(); i++) { |
90 scope_->CollectVariables(&local_vars, &context_vars, &global_vars); | 90 Variable* var = local_vars->at(i); |
91 for (int i = 0; i < locals; i++) { | 91 if (var->IsStackLocal()) { |
92 PrintObserved(local_vars.at(i), | 92 PrintObserved( |
93 frame->GetExpression(i), | 93 var, frame->GetExpression(local_index), |
94 store_.LookupBounds(stack_local_index(i)).lower); | 94 store_.LookupBounds(stack_local_index(local_index)).lower); |
| 95 local_index++; |
| 96 } |
95 } | 97 } |
96 } | 98 } |
97 #endif // OBJECT_PRINT | 99 #endif // OBJECT_PRINT |
98 } | 100 } |
99 | 101 |
100 | 102 |
101 #define RECURSE(call) \ | 103 #define RECURSE(call) \ |
102 do { \ | 104 do { \ |
103 DCHECK(!HasStackOverflow()); \ | 105 DCHECK(!HasStackOverflow()); \ |
104 call; \ | 106 call; \ |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
779 } | 781 } |
780 | 782 |
781 | 783 |
782 void AstTyper::VisitFunctionDeclaration(FunctionDeclaration* declaration) { | 784 void AstTyper::VisitFunctionDeclaration(FunctionDeclaration* declaration) { |
783 RECURSE(Visit(declaration->fun())); | 785 RECURSE(Visit(declaration->fun())); |
784 } | 786 } |
785 | 787 |
786 | 788 |
787 } // namespace internal | 789 } // namespace internal |
788 } // namespace v8 | 790 } // namespace v8 |
OLD | NEW |