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/compiler.h" | 7 #include "src/compiler.h" |
8 #include "src/compiler/ast-loop-assignment-analyzer.h" | 8 #include "src/compiler/ast-loop-assignment-analyzer.h" |
9 #include "src/compiler/control-builders.h" | 9 #include "src/compiler/control-builders.h" |
10 #include "src/compiler/js-type-feedback.h" | 10 #include "src/compiler/js-type-feedback.h" |
(...skipping 3083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3094 PrepareFrameState(store, bailout_id, combine); | 3094 PrepareFrameState(store, bailout_id, combine); |
3095 return store; | 3095 return store; |
3096 } | 3096 } |
3097 } | 3097 } |
3098 UNREACHABLE(); | 3098 UNREACHABLE(); |
3099 return NULL; | 3099 return NULL; |
3100 } | 3100 } |
3101 | 3101 |
3102 | 3102 |
3103 static inline Node* Record(JSTypeFeedbackTable* js_type_feedback, Node* node, | 3103 static inline Node* Record(JSTypeFeedbackTable* js_type_feedback, Node* node, |
3104 TypeFeedbackId id) { | 3104 TypeFeedbackId id, FeedbackVectorICSlot slot) { |
3105 if (js_type_feedback) js_type_feedback->Record(node, id); | 3105 if (js_type_feedback) { |
| 3106 js_type_feedback->Record(node, id); |
| 3107 js_type_feedback->Record(node, slot); |
| 3108 } |
3106 return node; | 3109 return node; |
3107 } | 3110 } |
3108 | 3111 |
3109 | 3112 |
3110 Node* AstGraphBuilder::BuildKeyedLoad(Node* object, Node* key, | 3113 Node* AstGraphBuilder::BuildKeyedLoad(Node* object, Node* key, |
3111 const VectorSlotPair& feedback, | 3114 const VectorSlotPair& feedback, |
3112 TypeFeedbackId id) { | 3115 TypeFeedbackId id) { |
3113 const Operator* op = javascript()->LoadProperty(feedback); | 3116 const Operator* op = javascript()->LoadProperty(feedback); |
3114 return Record(js_type_feedback_, NewNode(op, object, key), id); | 3117 return Record(js_type_feedback_, NewNode(op, object, key), id, |
| 3118 feedback.slot()); |
3115 } | 3119 } |
3116 | 3120 |
3117 | 3121 |
3118 Node* AstGraphBuilder::BuildNamedLoad(Node* object, Handle<Name> name, | 3122 Node* AstGraphBuilder::BuildNamedLoad(Node* object, Handle<Name> name, |
3119 const VectorSlotPair& feedback, | 3123 const VectorSlotPair& feedback, |
3120 TypeFeedbackId id, ContextualMode mode) { | 3124 TypeFeedbackId id, ContextualMode mode) { |
3121 const Operator* op = | 3125 const Operator* op = |
3122 javascript()->LoadNamed(MakeUnique(name), feedback, mode); | 3126 javascript()->LoadNamed(MakeUnique(name), feedback, mode); |
3123 return Record(js_type_feedback_, NewNode(op, object), id); | 3127 return Record(js_type_feedback_, NewNode(op, object), id, feedback.slot()); |
3124 } | 3128 } |
3125 | 3129 |
3126 | 3130 |
3127 Node* AstGraphBuilder::BuildKeyedStore(Node* object, Node* key, Node* value, | 3131 Node* AstGraphBuilder::BuildKeyedStore(Node* object, Node* key, Node* value, |
3128 TypeFeedbackId id) { | 3132 TypeFeedbackId id) { |
3129 const Operator* op = javascript()->StoreProperty(language_mode()); | 3133 const Operator* op = javascript()->StoreProperty(language_mode()); |
3130 return Record(js_type_feedback_, NewNode(op, object, key, value), id); | 3134 return Record(js_type_feedback_, NewNode(op, object, key, value), id, |
| 3135 FeedbackVectorICSlot::Invalid()); |
3131 } | 3136 } |
3132 | 3137 |
3133 | 3138 |
3134 Node* AstGraphBuilder::BuildNamedStore(Node* object, Handle<Name> name, | 3139 Node* AstGraphBuilder::BuildNamedStore(Node* object, Handle<Name> name, |
3135 Node* value, TypeFeedbackId id) { | 3140 Node* value, TypeFeedbackId id) { |
3136 const Operator* op = | 3141 const Operator* op = |
3137 javascript()->StoreNamed(language_mode(), MakeUnique(name)); | 3142 javascript()->StoreNamed(language_mode(), MakeUnique(name)); |
3138 return Record(js_type_feedback_, NewNode(op, object, value), id); | 3143 return Record(js_type_feedback_, NewNode(op, object, value), id, |
| 3144 FeedbackVectorICSlot::Invalid()); |
3139 } | 3145 } |
3140 | 3146 |
3141 | 3147 |
3142 Node* AstGraphBuilder::BuildLoadObjectField(Node* object, int offset) { | 3148 Node* AstGraphBuilder::BuildLoadObjectField(Node* object, int offset) { |
3143 return NewNode(jsgraph()->machine()->Load(kMachAnyTagged), object, | 3149 return NewNode(jsgraph()->machine()->Load(kMachAnyTagged), object, |
3144 jsgraph()->IntPtrConstant(offset - kHeapObjectTag)); | 3150 jsgraph()->IntPtrConstant(offset - kHeapObjectTag)); |
3145 } | 3151 } |
3146 | 3152 |
3147 | 3153 |
3148 Node* AstGraphBuilder::BuildLoadBuiltinsObject() { | 3154 Node* AstGraphBuilder::BuildLoadBuiltinsObject() { |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3649 // Phi does not exist yet, introduce one. | 3655 // Phi does not exist yet, introduce one. |
3650 value = NewPhi(inputs, value, control); | 3656 value = NewPhi(inputs, value, control); |
3651 value->ReplaceInput(inputs - 1, other); | 3657 value->ReplaceInput(inputs - 1, other); |
3652 } | 3658 } |
3653 return value; | 3659 return value; |
3654 } | 3660 } |
3655 | 3661 |
3656 } // namespace compiler | 3662 } // namespace compiler |
3657 } // namespace internal | 3663 } // namespace internal |
3658 } // namespace v8 | 3664 } // namespace v8 |
OLD | NEW |