| 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/contexts.h" | 9 #include "src/contexts.h" |
| 10 #include "src/globals.h" | 10 #include "src/globals.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 class TypeFeedbackOracle: public ZoneObject { | 22 class TypeFeedbackOracle: public ZoneObject { |
| 23 public: | 23 public: |
| 24 TypeFeedbackOracle(Isolate* isolate, Zone* zone, Handle<Code> code, | 24 TypeFeedbackOracle(Isolate* isolate, Zone* zone, Handle<Code> code, |
| 25 Handle<TypeFeedbackVector> feedback_vector, | 25 Handle<TypeFeedbackVector> feedback_vector, |
| 26 Handle<Context> native_context); | 26 Handle<Context> native_context); |
| 27 | 27 |
| 28 InlineCacheState LoadInlineCacheState(TypeFeedbackId id); | 28 InlineCacheState LoadInlineCacheState(TypeFeedbackId id); |
| 29 InlineCacheState LoadInlineCacheState(FeedbackVectorICSlot slot); | 29 InlineCacheState LoadInlineCacheState(FeedbackVectorICSlot slot); |
| 30 bool StoreIsUninitialized(TypeFeedbackId id); | 30 bool StoreIsUninitialized(TypeFeedbackId id); |
| 31 bool StoreIsUninitialized(FeedbackVectorICSlot slot); |
| 31 bool CallIsUninitialized(FeedbackVectorICSlot slot); | 32 bool CallIsUninitialized(FeedbackVectorICSlot slot); |
| 32 bool CallIsMonomorphic(FeedbackVectorICSlot slot); | 33 bool CallIsMonomorphic(FeedbackVectorICSlot slot); |
| 33 bool KeyedArrayCallIsHoley(TypeFeedbackId id); | 34 bool KeyedArrayCallIsHoley(TypeFeedbackId id); |
| 34 bool CallNewIsMonomorphic(FeedbackVectorSlot slot); | 35 bool CallNewIsMonomorphic(FeedbackVectorSlot slot); |
| 35 | 36 |
| 36 // TODO(1571) We can't use ForInStatement::ForInType as the return value due | 37 // TODO(1571) We can't use ForInStatement::ForInType as the return value due |
| 37 // to various cycles in our headers. | 38 // to various cycles in our headers. |
| 38 // TODO(rossberg): once all oracle access is removed from ast.cc, it should | 39 // TODO(rossberg): once all oracle access is removed from ast.cc, it should |
| 39 // be possible. | 40 // be possible. |
| 40 byte ForInType(FeedbackVectorSlot feedback_vector_slot); | 41 byte ForInType(FeedbackVectorSlot feedback_vector_slot); |
| 41 | 42 |
| 42 void GetStoreModeAndKeyType(TypeFeedbackId id, | 43 void GetStoreModeAndKeyType(TypeFeedbackId id, |
| 43 KeyedAccessStoreMode* store_mode, | 44 KeyedAccessStoreMode* store_mode, |
| 44 IcCheckType* key_type); | 45 IcCheckType* key_type); |
| 46 void GetStoreModeAndKeyType(FeedbackVectorICSlot slot, |
| 47 KeyedAccessStoreMode* store_mode, |
| 48 IcCheckType* key_type); |
| 45 void GetLoadKeyType(TypeFeedbackId id, IcCheckType* key_type); | 49 void GetLoadKeyType(TypeFeedbackId id, IcCheckType* key_type); |
| 46 | 50 |
| 47 void PropertyReceiverTypes(FeedbackVectorICSlot slot, Handle<Name> name, | 51 void PropertyReceiverTypes(FeedbackVectorICSlot slot, Handle<Name> name, |
| 48 SmallMapList* receiver_types); | 52 SmallMapList* receiver_types); |
| 49 void KeyedPropertyReceiverTypes(FeedbackVectorICSlot slot, | 53 void KeyedPropertyReceiverTypes(FeedbackVectorICSlot slot, |
| 50 SmallMapList* receiver_types, bool* is_string, | 54 SmallMapList* receiver_types, bool* is_string, |
| 51 IcCheckType* key_type); | 55 IcCheckType* key_type); |
| 52 void AssignmentReceiverTypes(TypeFeedbackId id, Handle<Name> name, | 56 void AssignmentReceiverTypes(TypeFeedbackId id, Handle<Name> name, |
| 53 SmallMapList* receiver_types); | 57 SmallMapList* receiver_types); |
| 58 void AssignmentReceiverTypes(FeedbackVectorICSlot slot, Handle<Name> name, |
| 59 SmallMapList* receiver_types); |
| 54 void KeyedAssignmentReceiverTypes(TypeFeedbackId id, | 60 void KeyedAssignmentReceiverTypes(TypeFeedbackId id, |
| 55 SmallMapList* receiver_types, | 61 SmallMapList* receiver_types, |
| 56 KeyedAccessStoreMode* store_mode, | 62 KeyedAccessStoreMode* store_mode, |
| 57 IcCheckType* key_type); | 63 IcCheckType* key_type); |
| 64 void KeyedAssignmentReceiverTypes(FeedbackVectorICSlot slot, |
| 65 SmallMapList* receiver_types, |
| 66 KeyedAccessStoreMode* store_mode, |
| 67 IcCheckType* key_type); |
| 58 void CountReceiverTypes(TypeFeedbackId id, | 68 void CountReceiverTypes(TypeFeedbackId id, |
| 59 SmallMapList* receiver_types); | 69 SmallMapList* receiver_types); |
| 60 | 70 |
| 71 void CollectReceiverTypes(FeedbackVectorICSlot slot, SmallMapList* types); |
| 61 void CollectReceiverTypes(TypeFeedbackId id, | 72 void CollectReceiverTypes(TypeFeedbackId id, |
| 62 SmallMapList* types); | 73 SmallMapList* types); |
| 63 template <class T> | 74 template <class T> |
| 64 void CollectReceiverTypes(T* obj, SmallMapList* types); | 75 void CollectReceiverTypes(T* obj, SmallMapList* types); |
| 65 | 76 |
| 66 static bool IsRelevantFeedback(Map* map, Context* native_context) { | 77 static bool IsRelevantFeedback(Map* map, Context* native_context) { |
| 67 Object* constructor = map->GetConstructor(); | 78 Object* constructor = map->GetConstructor(); |
| 68 return !constructor->IsJSFunction() || | 79 return !constructor->IsJSFunction() || |
| 69 JSFunction::cast(constructor)->context()->native_context() == | 80 JSFunction::cast(constructor)->context()->native_context() == |
| 70 native_context; | 81 native_context; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 95 Type** left, | 106 Type** left, |
| 96 Type** right, | 107 Type** right, |
| 97 Type** combined); | 108 Type** combined); |
| 98 | 109 |
| 99 Type* CountType(TypeFeedbackId id); | 110 Type* CountType(TypeFeedbackId id); |
| 100 | 111 |
| 101 Zone* zone() const { return zone_; } | 112 Zone* zone() const { return zone_; } |
| 102 Isolate* isolate() const { return isolate_; } | 113 Isolate* isolate() const { return isolate_; } |
| 103 | 114 |
| 104 private: | 115 private: |
| 116 void CollectReceiverTypes(FeedbackVectorICSlot slot, Handle<Name> name, |
| 117 Code::Flags flags, SmallMapList* types); |
| 105 void CollectReceiverTypes(TypeFeedbackId id, Handle<Name> name, | 118 void CollectReceiverTypes(TypeFeedbackId id, Handle<Name> name, |
| 106 Code::Flags flags, SmallMapList* types); | 119 Code::Flags flags, SmallMapList* types); |
| 107 template <class T> | 120 template <class T> |
| 108 void CollectReceiverTypes(T* obj, Handle<Name> name, Code::Flags flags, | 121 void CollectReceiverTypes(T* obj, Handle<Name> name, Code::Flags flags, |
| 109 SmallMapList* types); | 122 SmallMapList* types); |
| 110 | 123 |
| 111 // Returns true if there is at least one string map and if | 124 // Returns true if there is at least one string map and if |
| 112 // all maps are string maps. | 125 // all maps are string maps. |
| 113 bool HasOnlyStringMaps(SmallMapList* receiver_types); | 126 bool HasOnlyStringMaps(SmallMapList* receiver_types); |
| 114 | 127 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 137 Zone* zone_; | 150 Zone* zone_; |
| 138 Handle<UnseededNumberDictionary> dictionary_; | 151 Handle<UnseededNumberDictionary> dictionary_; |
| 139 Handle<TypeFeedbackVector> feedback_vector_; | 152 Handle<TypeFeedbackVector> feedback_vector_; |
| 140 | 153 |
| 141 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle); | 154 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle); |
| 142 }; | 155 }; |
| 143 | 156 |
| 144 } } // namespace v8::internal | 157 } } // namespace v8::internal |
| 145 | 158 |
| 146 #endif // V8_TYPE_INFO_H_ | 159 #endif // V8_TYPE_INFO_H_ |
| OLD | NEW |