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/compiler/bytecode-branch-analysis.h" | 7 #include "src/compiler/bytecode-branch-analysis.h" |
8 #include "src/compiler/linkage.h" | 8 #include "src/compiler/linkage.h" |
9 #include "src/compiler/operator-properties.h" | 9 #include "src/compiler/operator-properties.h" |
10 #include "src/interpreter/bytecodes.h" | 10 #include "src/interpreter/bytecodes.h" |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 const Operator* op = | 449 const Operator* op = |
450 javascript()->LoadContext(0, Context::NATIVE_CONTEXT_INDEX, true); | 450 javascript()->LoadContext(0, Context::NATIVE_CONTEXT_INDEX, true); |
451 Node* native_context = NewNode(op, environment()->Context()); | 451 Node* native_context = NewNode(op, environment()->Context()); |
452 return NewNode(javascript()->LoadContext(0, index, true), native_context); | 452 return NewNode(javascript()->LoadContext(0, index, true), native_context); |
453 } | 453 } |
454 | 454 |
455 | 455 |
456 Node* BytecodeGraphBuilder::BuildLoadFeedbackVector() { | 456 Node* BytecodeGraphBuilder::BuildLoadFeedbackVector() { |
457 if (!feedback_vector_.is_set()) { | 457 if (!feedback_vector_.is_set()) { |
458 Node* closure = GetFunctionClosure(); | 458 Node* closure = GetFunctionClosure(); |
459 Node* literals = | 459 Node* shared = BuildLoadImmutableObjectField( |
460 BuildLoadImmutableObjectField(closure, JSFunction::kLiteralsOffset); | 460 closure, JSFunction::kSharedFunctionInfoOffset); |
461 Node* vector = BuildLoadImmutableObjectField( | 461 Node* vector = BuildLoadImmutableObjectField( |
462 literals, LiteralsArray::kFeedbackVectorOffset); | 462 shared, SharedFunctionInfo::kFeedbackVectorOffset); |
463 feedback_vector_.set(vector); | 463 feedback_vector_.set(vector); |
464 } | 464 } |
465 return feedback_vector_.get(); | 465 return feedback_vector_.get(); |
466 } | 466 } |
467 | 467 |
468 | 468 |
469 VectorSlotPair BytecodeGraphBuilder::CreateVectorSlotPair(int slot_id) { | 469 VectorSlotPair BytecodeGraphBuilder::CreateVectorSlotPair(int slot_id) { |
470 Handle<TypeFeedbackVector> feedback_vector = | 470 Handle<TypeFeedbackVector> feedback_vector = info()->feedback_vector(); |
471 handle(info()->closure()->feedback_vector()); | |
472 FeedbackVectorSlot slot; | 471 FeedbackVectorSlot slot; |
473 if (slot_id >= TypeFeedbackVector::kReservedIndexCount) { | 472 if (slot_id >= TypeFeedbackVector::kReservedIndexCount) { |
474 slot = feedback_vector->ToSlot(slot_id); | 473 slot = feedback_vector->ToSlot(slot_id); |
475 } | 474 } |
476 return VectorSlotPair(feedback_vector, slot); | 475 return VectorSlotPair(feedback_vector, slot); |
477 } | 476 } |
478 | 477 |
479 | 478 |
480 bool BytecodeGraphBuilder::CreateGraph(bool stack_check) { | 479 bool BytecodeGraphBuilder::CreateGraph(bool stack_check) { |
481 // Set up the basic structure of the graph. Outputs for {Start} are | 480 // Set up the basic structure of the graph. Outputs for {Start} are |
(...skipping 1621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2103 | 2102 |
2104 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { | 2103 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { |
2105 if (environment()->IsMarkedAsUnreachable()) return; | 2104 if (environment()->IsMarkedAsUnreachable()) return; |
2106 environment()->MarkAsUnreachable(); | 2105 environment()->MarkAsUnreachable(); |
2107 exit_controls_.push_back(exit); | 2106 exit_controls_.push_back(exit); |
2108 } | 2107 } |
2109 | 2108 |
2110 } // namespace compiler | 2109 } // namespace compiler |
2111 } // namespace internal | 2110 } // namespace internal |
2112 } // namespace v8 | 2111 } // namespace v8 |
OLD | NEW |