| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/bytecode-graph-builder.h" | 5 #include "src/compiler/bytecode-graph-builder.h" |
| 6 | 6 |
| 7 #include "src/ast/ast.h" | 7 #include "src/ast/ast.h" |
| 8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
| 9 #include "src/compiler/access-builder.h" | 9 #include "src/compiler/access-builder.h" |
| 10 #include "src/compiler/compiler-source-position-table.h" | 10 #include "src/compiler/compiler-source-position-table.h" |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 // Create OSR values for each environment value. | 311 // Create OSR values for each environment value. |
| 312 SetContext(graph()->NewNode( | 312 SetContext(graph()->NewNode( |
| 313 common()->OsrValue(Linkage::kOsrContextSpillSlotIndex), entry)); | 313 common()->OsrValue(Linkage::kOsrContextSpillSlotIndex), entry)); |
| 314 int size = static_cast<int>(values()->size()); | 314 int size = static_cast<int>(values()->size()); |
| 315 for (int i = 0; i < size; i++) { | 315 for (int i = 0; i < size; i++) { |
| 316 int idx = i; // Indexing scheme follows {StandardFrame}, adapt accordingly. | 316 int idx = i; // Indexing scheme follows {StandardFrame}, adapt accordingly. |
| 317 if (i >= register_base()) idx += InterpreterFrameConstants::kExtraSlotCount; | 317 if (i >= register_base()) idx += InterpreterFrameConstants::kExtraSlotCount; |
| 318 if (i >= accumulator_base()) idx = Linkage::kOsrAccumulatorRegisterIndex; | 318 if (i >= accumulator_base()) idx = Linkage::kOsrAccumulatorRegisterIndex; |
| 319 values()->at(i) = graph()->NewNode(common()->OsrValue(idx), entry); | 319 values()->at(i) = graph()->NewNode(common()->OsrValue(idx), entry); |
| 320 } | 320 } |
| 321 | |
| 322 BailoutId loop_id(builder_->bytecode_iterator().current_offset()); | |
| 323 Node* frame_state = | |
| 324 Checkpoint(loop_id, OutputFrameStateCombine::Ignore(), false, nullptr); | |
| 325 Node* checkpoint = | |
| 326 graph()->NewNode(common()->Checkpoint(), frame_state, entry, entry); | |
| 327 UpdateEffectDependency(checkpoint); | |
| 328 | |
| 329 // Create the OSR guard nodes. | |
| 330 const Operator* guard_op = common()->OsrGuard(OsrGuardType::kUninitialized); | |
| 331 Node* effect = checkpoint; | |
| 332 for (int i = 0; i < size; i++) { | |
| 333 values()->at(i) = effect = | |
| 334 graph()->NewNode(guard_op, values()->at(i), effect, entry); | |
| 335 } | |
| 336 Node* context = effect = graph()->NewNode(guard_op, Context(), effect, entry); | |
| 337 SetContext(context); | |
| 338 UpdateEffectDependency(effect); | |
| 339 } | 321 } |
| 340 | 322 |
| 341 bool BytecodeGraphBuilder::Environment::StateValuesRequireUpdate( | 323 bool BytecodeGraphBuilder::Environment::StateValuesRequireUpdate( |
| 342 Node** state_values, Node** values, int count) { | 324 Node** state_values, Node** values, int count) { |
| 343 if (*state_values == nullptr) { | 325 if (*state_values == nullptr) { |
| 344 return true; | 326 return true; |
| 345 } | 327 } |
| 346 Node::Inputs inputs = (*state_values)->inputs(); | 328 Node::Inputs inputs = (*state_values)->inputs(); |
| 347 if (inputs.count() != count) return true; | 329 if (inputs.count() != count) return true; |
| 348 for (int i = 0; i < count; i++) { | 330 for (int i = 0; i < count; i++) { |
| (...skipping 2476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2825 it->source_position().ScriptOffset(), start_position_.InliningId())); | 2807 it->source_position().ScriptOffset(), start_position_.InliningId())); |
| 2826 it->Advance(); | 2808 it->Advance(); |
| 2827 } else { | 2809 } else { |
| 2828 DCHECK_GT(it->code_offset(), offset); | 2810 DCHECK_GT(it->code_offset(), offset); |
| 2829 } | 2811 } |
| 2830 } | 2812 } |
| 2831 | 2813 |
| 2832 } // namespace compiler | 2814 } // namespace compiler |
| 2833 } // namespace internal | 2815 } // namespace internal |
| 2834 } // namespace v8 | 2816 } // namespace v8 |
| OLD | NEW |