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 2877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2888 // Handled by VisitCall | 2888 // Handled by VisitCall |
2889 UNREACHABLE(); | 2889 UNREACHABLE(); |
2890 } | 2890 } |
2891 | 2891 |
2892 | 2892 |
2893 void AstGraphBuilder::VisitCaseClause(CaseClause* expr) { | 2893 void AstGraphBuilder::VisitCaseClause(CaseClause* expr) { |
2894 // Handled entirely in VisitSwitch. | 2894 // Handled entirely in VisitSwitch. |
2895 UNREACHABLE(); | 2895 UNREACHABLE(); |
2896 } | 2896 } |
2897 | 2897 |
2898 | 2898 void AstGraphBuilder::VisitDeclarations(Declaration::List* declarations) { |
2899 void AstGraphBuilder::VisitDeclarations(ZoneList<Declaration*>* declarations) { | |
2900 DCHECK(globals()->empty()); | 2899 DCHECK(globals()->empty()); |
2901 AstVisitor<AstGraphBuilder>::VisitDeclarations(declarations); | 2900 AstVisitor<AstGraphBuilder>::VisitDeclarations(declarations); |
2902 if (globals()->empty()) return; | 2901 if (globals()->empty()) return; |
2903 int array_index = 0; | 2902 int array_index = 0; |
2904 Handle<TypeFeedbackVector> feedback_vector( | 2903 Handle<TypeFeedbackVector> feedback_vector( |
2905 info()->closure()->feedback_vector()); | 2904 info()->closure()->feedback_vector()); |
2906 Handle<FixedArray> data = isolate()->factory()->NewFixedArray( | 2905 Handle<FixedArray> data = isolate()->factory()->NewFixedArray( |
2907 static_cast<int>(globals()->size()), TENURED); | 2906 static_cast<int>(globals()->size()), TENURED); |
2908 for (Handle<Object> obj : *globals()) data->set(array_index++, *obj); | 2907 for (Handle<Object> obj : *globals()) data->set(array_index++, *obj); |
2909 int encoded_flags = info()->GetDeclareGlobalsFlags(); | 2908 int encoded_flags = info()->GetDeclareGlobalsFlags(); |
(...skipping 1446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4356 // Phi does not exist yet, introduce one. | 4355 // Phi does not exist yet, introduce one. |
4357 value = NewPhi(inputs, value, control); | 4356 value = NewPhi(inputs, value, control); |
4358 value->ReplaceInput(inputs - 1, other); | 4357 value->ReplaceInput(inputs - 1, other); |
4359 } | 4358 } |
4360 return value; | 4359 return value; |
4361 } | 4360 } |
4362 | 4361 |
4363 } // namespace compiler | 4362 } // namespace compiler |
4364 } // namespace internal | 4363 } // namespace internal |
4365 } // namespace v8 | 4364 } // namespace v8 |
OLD | NEW |