| 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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 const Operator* op = | 507 const Operator* op = |
| 508 javascript()->LoadContext(0, Context::NATIVE_CONTEXT_INDEX, true); | 508 javascript()->LoadContext(0, Context::NATIVE_CONTEXT_INDEX, true); |
| 509 Node* native_context = NewNode(op, environment()->Context()); | 509 Node* native_context = NewNode(op, environment()->Context()); |
| 510 return NewNode(javascript()->LoadContext(0, index, true), native_context); | 510 return NewNode(javascript()->LoadContext(0, index, true), native_context); |
| 511 } | 511 } |
| 512 | 512 |
| 513 | 513 |
| 514 Node* BytecodeGraphBuilder::BuildLoadFeedbackVector() { | 514 Node* BytecodeGraphBuilder::BuildLoadFeedbackVector() { |
| 515 if (!feedback_vector_.is_set()) { | 515 if (!feedback_vector_.is_set()) { |
| 516 Node* closure = GetFunctionClosure(); | 516 Node* closure = GetFunctionClosure(); |
| 517 Node* literals = | 517 Node* shared = BuildLoadImmutableObjectField( |
| 518 BuildLoadImmutableObjectField(closure, JSFunction::kLiteralsOffset); | 518 closure, JSFunction::kSharedFunctionInfoOffset); |
| 519 Node* vector = BuildLoadImmutableObjectField( | 519 Node* vector = BuildLoadImmutableObjectField( |
| 520 literals, LiteralsArray::kFeedbackVectorOffset); | 520 shared, SharedFunctionInfo::kFeedbackVectorOffset); |
| 521 feedback_vector_.set(vector); | 521 feedback_vector_.set(vector); |
| 522 } | 522 } |
| 523 return feedback_vector_.get(); | 523 return feedback_vector_.get(); |
| 524 } | 524 } |
| 525 | 525 |
| 526 | 526 |
| 527 VectorSlotPair BytecodeGraphBuilder::CreateVectorSlotPair(int slot_id) { | 527 VectorSlotPair BytecodeGraphBuilder::CreateVectorSlotPair(int slot_id) { |
| 528 Handle<TypeFeedbackVector> feedback_vector = | 528 Handle<TypeFeedbackVector> feedback_vector = info()->feedback_vector(); |
| 529 handle(info()->closure()->feedback_vector()); | |
| 530 FeedbackVectorSlot slot; | 529 FeedbackVectorSlot slot; |
| 531 if (slot_id >= TypeFeedbackVector::kReservedIndexCount) { | 530 if (slot_id >= TypeFeedbackVector::kReservedIndexCount) { |
| 532 slot = feedback_vector->ToSlot(slot_id); | 531 slot = feedback_vector->ToSlot(slot_id); |
| 533 } | 532 } |
| 534 return VectorSlotPair(feedback_vector, slot); | 533 return VectorSlotPair(feedback_vector, slot); |
| 535 } | 534 } |
| 536 | 535 |
| 537 bool BytecodeGraphBuilder::CreateGraph() { | 536 bool BytecodeGraphBuilder::CreateGraph() { |
| 538 // Set up the basic structure of the graph. Outputs for {Start} are | 537 // Set up the basic structure of the graph. Outputs for {Start} are |
| 539 // the formal parameters (including the receiver) plus context and | 538 // the formal parameters (including the receiver) plus context and |
| (...skipping 1284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1824 // Phi does not exist yet, introduce one. | 1823 // Phi does not exist yet, introduce one. |
| 1825 value = NewPhi(inputs, value, control); | 1824 value = NewPhi(inputs, value, control); |
| 1826 value->ReplaceInput(inputs - 1, other); | 1825 value->ReplaceInput(inputs - 1, other); |
| 1827 } | 1826 } |
| 1828 return value; | 1827 return value; |
| 1829 } | 1828 } |
| 1830 | 1829 |
| 1831 } // namespace compiler | 1830 } // namespace compiler |
| 1832 } // namespace internal | 1831 } // namespace internal |
| 1833 } // namespace v8 | 1832 } // namespace v8 |
| OLD | NEW |