| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #ifndef V8_TYPE_INFO_H_ | 5 #ifndef V8_TYPE_INFO_H_ |
| 6 #define V8_TYPE_INFO_H_ | 6 #define V8_TYPE_INFO_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/globals.h" | 9 #include "src/globals.h" |
| 10 #include "src/types.h" | 10 #include "src/types.h" |
| 11 #include "src/zone-inl.h" | 11 #include "src/zone-inl.h" |
| 12 | 12 |
| 13 namespace v8 { | 13 namespace v8 { |
| 14 namespace internal { | 14 namespace internal { |
| 15 | 15 |
| 16 // Forward declarations. | 16 // Forward declarations. |
| 17 class SmallMapList; | 17 class SmallMapList; |
| 18 | 18 |
| 19 | 19 |
| 20 class TypeFeedbackOracle: public ZoneObject { | 20 class TypeFeedbackOracle: public ZoneObject { |
| 21 public: | 21 public: |
| 22 TypeFeedbackOracle(Handle<Code> code, | 22 TypeFeedbackOracle(Isolate* isolate, Zone* zone, Handle<Code> code, |
| 23 Handle<TypeFeedbackVector> feedback_vector, | 23 Handle<TypeFeedbackVector> feedback_vector, |
| 24 Handle<Context> native_context, Zone* zone); | 24 Handle<Context> native_context); |
| 25 | 25 |
| 26 bool LoadIsUninitialized(TypeFeedbackId id); | 26 bool LoadIsUninitialized(TypeFeedbackId id); |
| 27 bool LoadIsUninitialized(FeedbackVectorICSlot slot); | 27 bool LoadIsUninitialized(FeedbackVectorICSlot slot); |
| 28 bool StoreIsUninitialized(TypeFeedbackId id); | 28 bool StoreIsUninitialized(TypeFeedbackId id); |
| 29 bool CallIsUninitialized(FeedbackVectorICSlot slot); | 29 bool CallIsUninitialized(FeedbackVectorICSlot slot); |
| 30 bool CallIsMonomorphic(FeedbackVectorICSlot slot); | 30 bool CallIsMonomorphic(FeedbackVectorICSlot slot); |
| 31 bool KeyedArrayCallIsHoley(TypeFeedbackId id); | 31 bool KeyedArrayCallIsHoley(TypeFeedbackId id); |
| 32 bool CallNewIsMonomorphic(FeedbackVectorSlot slot); | 32 bool CallNewIsMonomorphic(FeedbackVectorSlot slot); |
| 33 | 33 |
| 34 // TODO(1571) We can't use ForInStatement::ForInType as the return value due | 34 // TODO(1571) We can't use ForInStatement::ForInType as the return value due |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 Token::Value operation); | 94 Token::Value operation); |
| 95 | 95 |
| 96 void CompareType(TypeFeedbackId id, | 96 void CompareType(TypeFeedbackId id, |
| 97 Type** left, | 97 Type** left, |
| 98 Type** right, | 98 Type** right, |
| 99 Type** combined); | 99 Type** combined); |
| 100 | 100 |
| 101 Type* CountType(TypeFeedbackId id); | 101 Type* CountType(TypeFeedbackId id); |
| 102 | 102 |
| 103 Zone* zone() const { return zone_; } | 103 Zone* zone() const { return zone_; } |
| 104 Isolate* isolate() const { return zone_->isolate(); } | 104 Isolate* isolate() const { return isolate_; } |
| 105 | 105 |
| 106 private: | 106 private: |
| 107 void CollectReceiverTypes(TypeFeedbackId id, | 107 void CollectReceiverTypes(TypeFeedbackId id, |
| 108 Handle<String> name, | 108 Handle<String> name, |
| 109 Code::Flags flags, | 109 Code::Flags flags, |
| 110 SmallMapList* types); | 110 SmallMapList* types); |
| 111 template <class T> | 111 template <class T> |
| 112 void CollectReceiverTypes(T* obj, Handle<String> name, Code::Flags flags, | 112 void CollectReceiverTypes(T* obj, Handle<String> name, Code::Flags flags, |
| 113 SmallMapList* types); | 113 SmallMapList* types); |
| 114 | 114 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 130 // there is no information. | 130 // there is no information. |
| 131 Handle<Object> GetInfo(TypeFeedbackId id); | 131 Handle<Object> GetInfo(TypeFeedbackId id); |
| 132 | 132 |
| 133 // Returns an element from the type feedback vector. Returns undefined | 133 // Returns an element from the type feedback vector. Returns undefined |
| 134 // if there is no information. | 134 // if there is no information. |
| 135 Handle<Object> GetInfo(FeedbackVectorSlot slot); | 135 Handle<Object> GetInfo(FeedbackVectorSlot slot); |
| 136 Handle<Object> GetInfo(FeedbackVectorICSlot slot); | 136 Handle<Object> GetInfo(FeedbackVectorICSlot slot); |
| 137 | 137 |
| 138 private: | 138 private: |
| 139 Handle<Context> native_context_; | 139 Handle<Context> native_context_; |
| 140 Isolate* isolate_; |
| 140 Zone* zone_; | 141 Zone* zone_; |
| 141 Handle<UnseededNumberDictionary> dictionary_; | 142 Handle<UnseededNumberDictionary> dictionary_; |
| 142 Handle<TypeFeedbackVector> feedback_vector_; | 143 Handle<TypeFeedbackVector> feedback_vector_; |
| 143 | 144 |
| 144 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle); | 145 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle); |
| 145 }; | 146 }; |
| 146 | 147 |
| 147 } } // namespace v8::internal | 148 } } // namespace v8::internal |
| 148 | 149 |
| 149 #endif // V8_TYPE_INFO_H_ | 150 #endif // V8_TYPE_INFO_H_ |
| OLD | NEW |