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 3023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3034 } | 3034 } |
3035 | 3035 |
3036 | 3036 |
3037 LanguageMode AstGraphBuilder::language_mode() const { | 3037 LanguageMode AstGraphBuilder::language_mode() const { |
3038 return info()->language_mode(); | 3038 return info()->language_mode(); |
3039 } | 3039 } |
3040 | 3040 |
3041 | 3041 |
3042 VectorSlotPair AstGraphBuilder::CreateVectorSlotPair( | 3042 VectorSlotPair AstGraphBuilder::CreateVectorSlotPair( |
3043 FeedbackVectorSlot slot) const { | 3043 FeedbackVectorSlot slot) const { |
3044 return VectorSlotPair(handle(info()->closure()->feedback_vector()), slot); | 3044 return VectorSlotPair(handle(info()->shared_info()->feedback_vector()), slot); |
3045 } | 3045 } |
3046 | 3046 |
3047 | 3047 |
3048 void AstGraphBuilder::VisitRewritableAssignmentExpression( | 3048 void AstGraphBuilder::VisitRewritableAssignmentExpression( |
3049 RewritableAssignmentExpression* node) { | 3049 RewritableAssignmentExpression* node) { |
3050 Visit(node->expression()); | 3050 Visit(node->expression()); |
3051 } | 3051 } |
3052 | 3052 |
3053 | 3053 |
3054 namespace { | 3054 namespace { |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3670 const Operator* op = | 3670 const Operator* op = |
3671 javascript()->LoadContext(0, Context::NATIVE_CONTEXT_INDEX, true); | 3671 javascript()->LoadContext(0, Context::NATIVE_CONTEXT_INDEX, true); |
3672 Node* native_context = NewNode(op, current_context()); | 3672 Node* native_context = NewNode(op, current_context()); |
3673 return NewNode(javascript()->LoadContext(0, index, true), native_context); | 3673 return NewNode(javascript()->LoadContext(0, index, true), native_context); |
3674 } | 3674 } |
3675 | 3675 |
3676 | 3676 |
3677 Node* AstGraphBuilder::BuildLoadFeedbackVector() { | 3677 Node* AstGraphBuilder::BuildLoadFeedbackVector() { |
3678 if (!feedback_vector_.is_set()) { | 3678 if (!feedback_vector_.is_set()) { |
3679 Node* closure = GetFunctionClosure(); | 3679 Node* closure = GetFunctionClosure(); |
3680 Node* literals = | 3680 Node* shared = BuildLoadImmutableObjectField( |
3681 BuildLoadImmutableObjectField(closure, JSFunction::kLiteralsOffset); | 3681 closure, JSFunction::kSharedFunctionInfoOffset); |
3682 Node* vector = BuildLoadImmutableObjectField( | 3682 Node* vector = BuildLoadImmutableObjectField( |
3683 literals, LiteralsArray::kFeedbackVectorOffset); | 3683 shared, SharedFunctionInfo::kFeedbackVectorOffset); |
3684 feedback_vector_.set(vector); | 3684 feedback_vector_.set(vector); |
3685 } | 3685 } |
3686 return feedback_vector_.get(); | 3686 return feedback_vector_.get(); |
3687 } | 3687 } |
3688 | 3688 |
3689 | 3689 |
3690 Node* AstGraphBuilder::BuildToBoolean(Node* input, TypeFeedbackId feedback_id) { | 3690 Node* AstGraphBuilder::BuildToBoolean(Node* input, TypeFeedbackId feedback_id) { |
3691 if (Node* node = TryFastToBoolean(input)) return node; | 3691 if (Node* node = TryFastToBoolean(input)) return node; |
3692 ToBooleanHints hints; | 3692 ToBooleanHints hints; |
3693 if (!type_hint_analysis_ || | 3693 if (!type_hint_analysis_ || |
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4337 // Phi does not exist yet, introduce one. | 4337 // Phi does not exist yet, introduce one. |
4338 value = NewPhi(inputs, value, control); | 4338 value = NewPhi(inputs, value, control); |
4339 value->ReplaceInput(inputs - 1, other); | 4339 value->ReplaceInput(inputs - 1, other); |
4340 } | 4340 } |
4341 return value; | 4341 return value; |
4342 } | 4342 } |
4343 | 4343 |
4344 } // namespace compiler | 4344 } // namespace compiler |
4345 } // namespace internal | 4345 } // namespace internal |
4346 } // namespace v8 | 4346 } // namespace v8 |
OLD | NEW |