| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 public: | 45 public: |
| 46 TypeFeedbackOracle(Handle<Code> code, | 46 TypeFeedbackOracle(Handle<Code> code, |
| 47 Handle<Context> native_context, | 47 Handle<Context> native_context, |
| 48 Zone* zone); | 48 Zone* zone); |
| 49 | 49 |
| 50 bool LoadIsUninitialized(TypeFeedbackId id); | 50 bool LoadIsUninitialized(TypeFeedbackId id); |
| 51 bool LoadIsPreMonomorphic(TypeFeedbackId id); | 51 bool LoadIsPreMonomorphic(TypeFeedbackId id); |
| 52 bool StoreIsUninitialized(TypeFeedbackId id); | 52 bool StoreIsUninitialized(TypeFeedbackId id); |
| 53 bool StoreIsPreMonomorphic(TypeFeedbackId id); | 53 bool StoreIsPreMonomorphic(TypeFeedbackId id); |
| 54 bool StoreIsKeyedPolymorphic(TypeFeedbackId id); | 54 bool StoreIsKeyedPolymorphic(TypeFeedbackId id); |
| 55 bool CallIsMonomorphic(int slot); |
| 55 bool CallIsMonomorphic(TypeFeedbackId aid); | 56 bool CallIsMonomorphic(TypeFeedbackId aid); |
| 56 bool KeyedArrayCallIsHoley(TypeFeedbackId id); | 57 bool KeyedArrayCallIsHoley(TypeFeedbackId id); |
| 57 bool CallNewIsMonomorphic(TypeFeedbackId id); | 58 bool CallNewIsMonomorphic(int slot); |
| 58 | 59 |
| 59 // TODO(1571) We can't use ForInStatement::ForInType as the return value due | 60 // TODO(1571) We can't use ForInStatement::ForInType as the return value due |
| 60 // to various cycles in our headers. | 61 // to various cycles in our headers. |
| 61 // TODO(rossberg): once all oracle access is removed from ast.cc, it should | 62 // TODO(rossberg): once all oracle access is removed from ast.cc, it should |
| 62 // be possible. | 63 // be possible. |
| 63 byte ForInType(TypeFeedbackId id); | 64 byte ForInType(int feedback_vector_slot); |
| 64 | 65 |
| 65 KeyedAccessStoreMode GetStoreMode(TypeFeedbackId id); | 66 KeyedAccessStoreMode GetStoreMode(TypeFeedbackId id); |
| 66 | 67 |
| 67 void CallReceiverTypes(TypeFeedbackId id, | 68 void CallReceiverTypes(TypeFeedbackId id, |
| 68 Handle<String> name, | 69 Handle<String> name, |
| 69 int arity, | 70 int arity, |
| 70 SmallMapList* types); | 71 SmallMapList* types); |
| 71 void PropertyReceiverTypes(TypeFeedbackId id, | 72 void PropertyReceiverTypes(TypeFeedbackId id, |
| 72 Handle<String> name, | 73 Handle<String> name, |
| 73 SmallMapList* receiver_types, | 74 SmallMapList* receiver_types, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 85 SmallMapList* receiver_types); | 86 SmallMapList* receiver_types); |
| 86 | 87 |
| 87 void CollectReceiverTypes(TypeFeedbackId id, | 88 void CollectReceiverTypes(TypeFeedbackId id, |
| 88 SmallMapList* types); | 89 SmallMapList* types); |
| 89 | 90 |
| 90 static bool CanRetainOtherContext(Map* map, Context* native_context); | 91 static bool CanRetainOtherContext(Map* map, Context* native_context); |
| 91 static bool CanRetainOtherContext(JSFunction* function, | 92 static bool CanRetainOtherContext(JSFunction* function, |
| 92 Context* native_context); | 93 Context* native_context); |
| 93 | 94 |
| 94 CheckType GetCallCheckType(TypeFeedbackId id); | 95 CheckType GetCallCheckType(TypeFeedbackId id); |
| 95 Handle<JSFunction> GetCallTarget(TypeFeedbackId id); | 96 Handle<JSFunction> GetCallTarget(int slot); |
| 96 Handle<JSFunction> GetCallNewTarget(TypeFeedbackId id); | 97 Handle<JSFunction> GetCallNewTarget(int slot); |
| 97 Handle<AllocationSite> GetCallNewAllocationSite(TypeFeedbackId id); | 98 Handle<AllocationSite> GetCallNewAllocationSite(int slot); |
| 98 | 99 |
| 99 bool LoadIsBuiltin(TypeFeedbackId id, Builtins::Name builtin_id); | 100 bool LoadIsBuiltin(TypeFeedbackId id, Builtins::Name builtin_id); |
| 100 bool LoadIsStub(TypeFeedbackId id, ICStub* stub); | 101 bool LoadIsStub(TypeFeedbackId id, ICStub* stub); |
| 101 | 102 |
| 102 // TODO(1571) We can't use ToBooleanStub::Types as the return value because | 103 // TODO(1571) We can't use ToBooleanStub::Types as the return value because |
| 103 // of various cycles in our headers. Death to tons of implementations in | 104 // of various cycles in our headers. Death to tons of implementations in |
| 104 // headers!! :-P | 105 // headers!! :-P |
| 105 byte ToBooleanTypes(TypeFeedbackId id); | 106 byte ToBooleanTypes(TypeFeedbackId id); |
| 106 | 107 |
| 107 // Get type information for arithmetic operations and compares. | 108 // Get type information for arithmetic operations and compares. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 131 | 132 |
| 132 void SetInfo(TypeFeedbackId id, Object* target); | 133 void SetInfo(TypeFeedbackId id, Object* target); |
| 133 | 134 |
| 134 void BuildDictionary(Handle<Code> code); | 135 void BuildDictionary(Handle<Code> code); |
| 135 void GetRelocInfos(Handle<Code> code, ZoneList<RelocInfo>* infos); | 136 void GetRelocInfos(Handle<Code> code, ZoneList<RelocInfo>* infos); |
| 136 void CreateDictionary(Handle<Code> code, ZoneList<RelocInfo>* infos); | 137 void CreateDictionary(Handle<Code> code, ZoneList<RelocInfo>* infos); |
| 137 void RelocateRelocInfos(ZoneList<RelocInfo>* infos, | 138 void RelocateRelocInfos(ZoneList<RelocInfo>* infos, |
| 138 byte* old_start, | 139 byte* old_start, |
| 139 byte* new_start); | 140 byte* new_start); |
| 140 void ProcessRelocInfos(ZoneList<RelocInfo>* infos); | 141 void ProcessRelocInfos(ZoneList<RelocInfo>* infos); |
| 141 void ProcessTypeFeedbackCells(Handle<Code> code); | |
| 142 | 142 |
| 143 // Returns an element from the backing store. Returns undefined if | 143 // Returns an element from the backing store. Returns undefined if |
| 144 // there is no information. | 144 // there is no information. |
| 145 Handle<Object> GetInfo(TypeFeedbackId id); | 145 Handle<Object> GetInfo(TypeFeedbackId id); |
| 146 | 146 |
| 147 // Returns an element from the type feedback vector. Returns undefined |
| 148 // if there is no information. |
| 149 Handle<Object> GetInfo(int slot); |
| 150 |
| 147 private: | 151 private: |
| 148 Handle<Context> native_context_; | 152 Handle<Context> native_context_; |
| 149 Zone* zone_; | 153 Zone* zone_; |
| 150 Handle<UnseededNumberDictionary> dictionary_; | 154 Handle<UnseededNumberDictionary> dictionary_; |
| 155 Handle<FixedArray> feedback_vector_; |
| 151 | 156 |
| 152 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle); | 157 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle); |
| 153 }; | 158 }; |
| 154 | 159 |
| 155 } } // namespace v8::internal | 160 } } // namespace v8::internal |
| 156 | 161 |
| 157 #endif // V8_TYPE_INFO_H_ | 162 #endif // V8_TYPE_INFO_H_ |
| OLD | NEW |