| 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 3050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3061 } | 3061 } |
| 3062 | 3062 |
| 3063 | 3063 |
| 3064 LanguageMode AstGraphBuilder::language_mode() const { | 3064 LanguageMode AstGraphBuilder::language_mode() const { |
| 3065 return info()->language_mode(); | 3065 return info()->language_mode(); |
| 3066 } | 3066 } |
| 3067 | 3067 |
| 3068 | 3068 |
| 3069 VectorSlotPair AstGraphBuilder::CreateVectorSlotPair( | 3069 VectorSlotPair AstGraphBuilder::CreateVectorSlotPair( |
| 3070 FeedbackVectorSlot slot) const { | 3070 FeedbackVectorSlot slot) const { |
| 3071 return VectorSlotPair(handle(info()->shared_info()->feedback_vector()), slot); | 3071 return VectorSlotPair(handle(info()->closure()->feedback_vector()), slot); |
| 3072 } | 3072 } |
| 3073 | 3073 |
| 3074 | 3074 |
| 3075 void AstGraphBuilder::VisitRewritableAssignmentExpression( | 3075 void AstGraphBuilder::VisitRewritableAssignmentExpression( |
| 3076 RewritableAssignmentExpression* node) { | 3076 RewritableAssignmentExpression* node) { |
| 3077 Visit(node->expression()); | 3077 Visit(node->expression()); |
| 3078 } | 3078 } |
| 3079 | 3079 |
| 3080 | 3080 |
| 3081 namespace { | 3081 namespace { |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3699 const Operator* op = | 3699 const Operator* op = |
| 3700 javascript()->LoadContext(0, Context::NATIVE_CONTEXT_INDEX, true); | 3700 javascript()->LoadContext(0, Context::NATIVE_CONTEXT_INDEX, true); |
| 3701 Node* native_context = NewNode(op, current_context()); | 3701 Node* native_context = NewNode(op, current_context()); |
| 3702 return NewNode(javascript()->LoadContext(0, index, true), native_context); | 3702 return NewNode(javascript()->LoadContext(0, index, true), native_context); |
| 3703 } | 3703 } |
| 3704 | 3704 |
| 3705 | 3705 |
| 3706 Node* AstGraphBuilder::BuildLoadFeedbackVector() { | 3706 Node* AstGraphBuilder::BuildLoadFeedbackVector() { |
| 3707 if (!feedback_vector_.is_set()) { | 3707 if (!feedback_vector_.is_set()) { |
| 3708 Node* closure = GetFunctionClosure(); | 3708 Node* closure = GetFunctionClosure(); |
| 3709 Node* shared = BuildLoadImmutableObjectField( | 3709 Node* literals = |
| 3710 closure, JSFunction::kSharedFunctionInfoOffset); | 3710 BuildLoadImmutableObjectField(closure, JSFunction::kLiteralsOffset); |
| 3711 Node* vector = BuildLoadImmutableObjectField( | 3711 Node* vector = BuildLoadImmutableObjectField( |
| 3712 shared, SharedFunctionInfo::kFeedbackVectorOffset); | 3712 literals, LiteralsArray::kFeedbackVectorOffset); |
| 3713 feedback_vector_.set(vector); | 3713 feedback_vector_.set(vector); |
| 3714 } | 3714 } |
| 3715 return feedback_vector_.get(); | 3715 return feedback_vector_.get(); |
| 3716 } | 3716 } |
| 3717 | 3717 |
| 3718 | 3718 |
| 3719 Node* AstGraphBuilder::BuildToBoolean(Node* input, TypeFeedbackId feedback_id) { | 3719 Node* AstGraphBuilder::BuildToBoolean(Node* input, TypeFeedbackId feedback_id) { |
| 3720 if (Node* node = TryFastToBoolean(input)) return node; | 3720 if (Node* node = TryFastToBoolean(input)) return node; |
| 3721 ToBooleanHints hints; | 3721 ToBooleanHints hints; |
| 3722 if (!type_hint_analysis_ || | 3722 if (!type_hint_analysis_ || |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4357 // Phi does not exist yet, introduce one. | 4357 // Phi does not exist yet, introduce one. |
| 4358 value = NewPhi(inputs, value, control); | 4358 value = NewPhi(inputs, value, control); |
| 4359 value->ReplaceInput(inputs - 1, other); | 4359 value->ReplaceInput(inputs - 1, other); |
| 4360 } | 4360 } |
| 4361 return value; | 4361 return value; |
| 4362 } | 4362 } |
| 4363 | 4363 |
| 4364 } // namespace compiler | 4364 } // namespace compiler |
| 4365 } // namespace internal | 4365 } // namespace internal |
| 4366 } // namespace v8 | 4366 } // namespace v8 |
| OLD | NEW |