| 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/compiler.h" | 7 #include "src/compiler.h" |
| 8 #include "src/compiler/ast-loop-assignment-analyzer.h" | 8 #include "src/compiler/ast-loop-assignment-analyzer.h" |
| 9 #include "src/compiler/control-builders.h" | 9 #include "src/compiler/control-builders.h" |
| 10 #include "src/compiler/js-type-feedback.h" | 10 #include "src/compiler/js-type-feedback.h" |
| (...skipping 2899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2910 if (globals()->empty()) return; | 2910 if (globals()->empty()) return; |
| 2911 int array_index = 0; | 2911 int array_index = 0; |
| 2912 Handle<FixedArray> data = isolate()->factory()->NewFixedArray( | 2912 Handle<FixedArray> data = isolate()->factory()->NewFixedArray( |
| 2913 static_cast<int>(globals()->size()), TENURED); | 2913 static_cast<int>(globals()->size()), TENURED); |
| 2914 for (Handle<Object> obj : *globals()) data->set(array_index++, *obj); | 2914 for (Handle<Object> obj : *globals()) data->set(array_index++, *obj); |
| 2915 int encoded_flags = DeclareGlobalsEvalFlag::encode(info()->is_eval()) | | 2915 int encoded_flags = DeclareGlobalsEvalFlag::encode(info()->is_eval()) | |
| 2916 DeclareGlobalsNativeFlag::encode(info()->is_native()) | | 2916 DeclareGlobalsNativeFlag::encode(info()->is_native()) | |
| 2917 DeclareGlobalsLanguageMode::encode(language_mode()); | 2917 DeclareGlobalsLanguageMode::encode(language_mode()); |
| 2918 Node* flags = jsgraph()->Constant(encoded_flags); | 2918 Node* flags = jsgraph()->Constant(encoded_flags); |
| 2919 Node* pairs = jsgraph()->Constant(data); | 2919 Node* pairs = jsgraph()->Constant(data); |
| 2920 const Operator* op = javascript()->CallRuntime(Runtime::kDeclareGlobals, 3); | 2920 const Operator* op = javascript()->CallRuntime(Runtime::kDeclareGlobals, 2); |
| 2921 Node* call = NewNode(op, current_context(), pairs, flags); | 2921 Node* call = NewNode(op, pairs, flags); |
| 2922 PrepareFrameState(call, BailoutId::Declarations()); | 2922 PrepareFrameState(call, BailoutId::Declarations()); |
| 2923 globals()->clear(); | 2923 globals()->clear(); |
| 2924 } | 2924 } |
| 2925 | 2925 |
| 2926 | 2926 |
| 2927 void AstGraphBuilder::VisitIfNotNull(Statement* stmt) { | 2927 void AstGraphBuilder::VisitIfNotNull(Statement* stmt) { |
| 2928 if (stmt == NULL) return; | 2928 if (stmt == NULL) return; |
| 2929 Visit(stmt); | 2929 Visit(stmt); |
| 2930 } | 2930 } |
| 2931 | 2931 |
| (...skipping 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4314 // Phi does not exist yet, introduce one. | 4314 // Phi does not exist yet, introduce one. |
| 4315 value = NewPhi(inputs, value, control); | 4315 value = NewPhi(inputs, value, control); |
| 4316 value->ReplaceInput(inputs - 1, other); | 4316 value->ReplaceInput(inputs - 1, other); |
| 4317 } | 4317 } |
| 4318 return value; | 4318 return value; |
| 4319 } | 4319 } |
| 4320 | 4320 |
| 4321 } // namespace compiler | 4321 } // namespace compiler |
| 4322 } // namespace internal | 4322 } // namespace internal |
| 4323 } // namespace v8 | 4323 } // namespace v8 |
| OLD | NEW |