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/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
9 #include "src/compiler/ast-loop-assignment-analyzer.h" | 9 #include "src/compiler/ast-loop-assignment-analyzer.h" |
10 #include "src/compiler/control-builders.h" | 10 #include "src/compiler/control-builders.h" |
(...skipping 3036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3047 } | 3047 } |
3048 | 3048 |
3049 | 3049 |
3050 LanguageMode AstGraphBuilder::language_mode() const { | 3050 LanguageMode AstGraphBuilder::language_mode() const { |
3051 return info()->language_mode(); | 3051 return info()->language_mode(); |
3052 } | 3052 } |
3053 | 3053 |
3054 | 3054 |
3055 VectorSlotPair AstGraphBuilder::CreateVectorSlotPair( | 3055 VectorSlotPair AstGraphBuilder::CreateVectorSlotPair( |
3056 FeedbackVectorSlot slot) const { | 3056 FeedbackVectorSlot slot) const { |
3057 return VectorSlotPair(handle(info()->shared_info()->feedback_vector()), slot); | 3057 return VectorSlotPair(handle(info()->closure()->feedback_vector()), slot); |
3058 } | 3058 } |
3059 | 3059 |
3060 | 3060 |
3061 void AstGraphBuilder::VisitRewritableAssignmentExpression( | 3061 void AstGraphBuilder::VisitRewritableAssignmentExpression( |
3062 RewritableAssignmentExpression* node) { | 3062 RewritableAssignmentExpression* node) { |
3063 Visit(node->expression()); | 3063 Visit(node->expression()); |
3064 } | 3064 } |
3065 | 3065 |
3066 | 3066 |
3067 namespace { | 3067 namespace { |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3683 const Operator* op = | 3683 const Operator* op = |
3684 javascript()->LoadContext(0, Context::NATIVE_CONTEXT_INDEX, true); | 3684 javascript()->LoadContext(0, Context::NATIVE_CONTEXT_INDEX, true); |
3685 Node* native_context = NewNode(op, current_context()); | 3685 Node* native_context = NewNode(op, current_context()); |
3686 return NewNode(javascript()->LoadContext(0, index, true), native_context); | 3686 return NewNode(javascript()->LoadContext(0, index, true), native_context); |
3687 } | 3687 } |
3688 | 3688 |
3689 | 3689 |
3690 Node* AstGraphBuilder::BuildLoadFeedbackVector() { | 3690 Node* AstGraphBuilder::BuildLoadFeedbackVector() { |
3691 if (!feedback_vector_.is_set()) { | 3691 if (!feedback_vector_.is_set()) { |
3692 Node* closure = GetFunctionClosure(); | 3692 Node* closure = GetFunctionClosure(); |
3693 Node* shared = BuildLoadImmutableObjectField( | 3693 Node* literals = |
3694 closure, JSFunction::kSharedFunctionInfoOffset); | 3694 BuildLoadImmutableObjectField(closure, JSFunction::kLiteralsOffset); |
3695 Node* vector = BuildLoadImmutableObjectField( | 3695 Node* vector = BuildLoadImmutableObjectField( |
3696 shared, SharedFunctionInfo::kFeedbackVectorOffset); | 3696 literals, LiteralsArray::kFeedbackVectorOffset); |
3697 feedback_vector_.set(vector); | 3697 feedback_vector_.set(vector); |
3698 } | 3698 } |
3699 return feedback_vector_.get(); | 3699 return feedback_vector_.get(); |
3700 } | 3700 } |
3701 | 3701 |
3702 | 3702 |
3703 Node* AstGraphBuilder::BuildToBoolean(Node* input, TypeFeedbackId feedback_id) { | 3703 Node* AstGraphBuilder::BuildToBoolean(Node* input, TypeFeedbackId feedback_id) { |
3704 if (Node* node = TryFastToBoolean(input)) return node; | 3704 if (Node* node = TryFastToBoolean(input)) return node; |
3705 ToBooleanHints hints; | 3705 ToBooleanHints hints; |
3706 if (!type_hint_analysis_ || | 3706 if (!type_hint_analysis_ || |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4340 // Phi does not exist yet, introduce one. | 4340 // Phi does not exist yet, introduce one. |
4341 value = NewPhi(inputs, value, control); | 4341 value = NewPhi(inputs, value, control); |
4342 value->ReplaceInput(inputs - 1, other); | 4342 value->ReplaceInput(inputs - 1, other); |
4343 } | 4343 } |
4344 return value; | 4344 return value; |
4345 } | 4345 } |
4346 | 4346 |
4347 } // namespace compiler | 4347 } // namespace compiler |
4348 } // namespace internal | 4348 } // namespace internal |
4349 } // namespace v8 | 4349 } // namespace v8 |
OLD | NEW |