| 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 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 // Forward declarations. | 39 // Forward declarations. |
| 40 class ICStub; | 40 class ICStub; |
| 41 class SmallMapList; | 41 class SmallMapList; |
| 42 | 42 |
| 43 | 43 |
| 44 class TypeFeedbackOracle: public ZoneObject { | 44 class TypeFeedbackOracle: public ZoneObject { |
| 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 Isolate* isolate, | |
| 49 Zone* zone); | 48 Zone* zone); |
| 50 | 49 |
| 51 bool LoadIsUninitialized(TypeFeedbackId id); | 50 bool LoadIsUninitialized(TypeFeedbackId id); |
| 52 bool LoadIsPreMonomorphic(TypeFeedbackId id); | 51 bool LoadIsPreMonomorphic(TypeFeedbackId id); |
| 53 bool StoreIsUninitialized(TypeFeedbackId id); | 52 bool StoreIsUninitialized(TypeFeedbackId id); |
| 54 bool StoreIsPreMonomorphic(TypeFeedbackId id); | 53 bool StoreIsPreMonomorphic(TypeFeedbackId id); |
| 55 bool StoreIsKeyedPolymorphic(TypeFeedbackId id); | 54 bool StoreIsKeyedPolymorphic(TypeFeedbackId id); |
| 56 bool CallIsMonomorphic(TypeFeedbackId aid); | 55 bool CallIsMonomorphic(TypeFeedbackId aid); |
| 57 bool KeyedArrayCallIsHoley(TypeFeedbackId id); | 56 bool KeyedArrayCallIsHoley(TypeFeedbackId id); |
| 58 bool CallNewIsMonomorphic(TypeFeedbackId id); | 57 bool CallNewIsMonomorphic(TypeFeedbackId id); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 88 void CollectReceiverTypes(TypeFeedbackId id, | 87 void CollectReceiverTypes(TypeFeedbackId id, |
| 89 SmallMapList* types); | 88 SmallMapList* types); |
| 90 | 89 |
| 91 static bool CanRetainOtherContext(Map* map, Context* native_context); | 90 static bool CanRetainOtherContext(Map* map, Context* native_context); |
| 92 static bool CanRetainOtherContext(JSFunction* function, | 91 static bool CanRetainOtherContext(JSFunction* function, |
| 93 Context* native_context); | 92 Context* native_context); |
| 94 | 93 |
| 95 CheckType GetCallCheckType(TypeFeedbackId id); | 94 CheckType GetCallCheckType(TypeFeedbackId id); |
| 96 Handle<JSFunction> GetCallTarget(TypeFeedbackId id); | 95 Handle<JSFunction> GetCallTarget(TypeFeedbackId id); |
| 97 Handle<JSFunction> GetCallNewTarget(TypeFeedbackId id); | 96 Handle<JSFunction> GetCallNewTarget(TypeFeedbackId id); |
| 98 Handle<Cell> GetCallNewAllocationInfoCell(TypeFeedbackId id); | 97 Handle<AllocationSite> GetCallNewAllocationSite(TypeFeedbackId id); |
| 99 | 98 |
| 100 bool LoadIsBuiltin(TypeFeedbackId id, Builtins::Name builtin_id); | 99 bool LoadIsBuiltin(TypeFeedbackId id, Builtins::Name builtin_id); |
| 101 bool LoadIsStub(TypeFeedbackId id, ICStub* stub); | 100 bool LoadIsStub(TypeFeedbackId id, ICStub* stub); |
| 102 | 101 |
| 103 // TODO(1571) We can't use ToBooleanStub::Types as the return value because | 102 // TODO(1571) We can't use ToBooleanStub::Types as the return value because |
| 104 // of various cycles in our headers. Death to tons of implementations in | 103 // of various cycles in our headers. Death to tons of implementations in |
| 105 // headers!! :-P | 104 // headers!! :-P |
| 106 byte ToBooleanTypes(TypeFeedbackId id); | 105 byte ToBooleanTypes(TypeFeedbackId id); |
| 107 | 106 |
| 108 // Get type information for arithmetic operations and compares. | 107 // Get type information for arithmetic operations and compares. |
| 109 void BinaryType(TypeFeedbackId id, | 108 void BinaryType(TypeFeedbackId id, |
| 110 Handle<Type>* left, | 109 Type** left, |
| 111 Handle<Type>* right, | 110 Type** right, |
| 112 Handle<Type>* result, | 111 Type** result, |
| 113 Maybe<int>* fixed_right_arg, | 112 Maybe<int>* fixed_right_arg, |
| 114 Handle<AllocationSite>* allocation_site, | 113 Handle<AllocationSite>* allocation_site, |
| 115 Token::Value operation); | 114 Token::Value operation); |
| 116 | 115 |
| 117 void CompareType(TypeFeedbackId id, | 116 void CompareType(TypeFeedbackId id, |
| 118 Handle<Type>* left, | 117 Type** left, |
| 119 Handle<Type>* right, | 118 Type** right, |
| 120 Handle<Type>* combined); | 119 Type** combined); |
| 121 | 120 |
| 122 Handle<Type> CountType(TypeFeedbackId id); | 121 Type* CountType(TypeFeedbackId id); |
| 123 | 122 |
| 124 Zone* zone() const { return zone_; } | 123 Zone* zone() const { return zone_; } |
| 125 Isolate* isolate() const { return isolate_; } | 124 Isolate* isolate() const { return zone_->isolate(); } |
| 126 | 125 |
| 127 private: | 126 private: |
| 128 void CollectReceiverTypes(TypeFeedbackId id, | 127 void CollectReceiverTypes(TypeFeedbackId id, |
| 129 Handle<String> name, | 128 Handle<String> name, |
| 130 Code::Flags flags, | 129 Code::Flags flags, |
| 131 SmallMapList* types); | 130 SmallMapList* types); |
| 132 | 131 |
| 133 void SetInfo(TypeFeedbackId id, Object* target); | 132 void SetInfo(TypeFeedbackId id, Object* target); |
| 134 | 133 |
| 135 void BuildDictionary(Handle<Code> code); | 134 void BuildDictionary(Handle<Code> code); |
| 136 void GetRelocInfos(Handle<Code> code, ZoneList<RelocInfo>* infos); | 135 void GetRelocInfos(Handle<Code> code, ZoneList<RelocInfo>* infos); |
| 137 void CreateDictionary(Handle<Code> code, ZoneList<RelocInfo>* infos); | 136 void CreateDictionary(Handle<Code> code, ZoneList<RelocInfo>* infos); |
| 138 void RelocateRelocInfos(ZoneList<RelocInfo>* infos, | 137 void RelocateRelocInfos(ZoneList<RelocInfo>* infos, |
| 139 byte* old_start, | 138 byte* old_start, |
| 140 byte* new_start); | 139 byte* new_start); |
| 141 void ProcessRelocInfos(ZoneList<RelocInfo>* infos); | 140 void ProcessRelocInfos(ZoneList<RelocInfo>* infos); |
| 142 void ProcessTypeFeedbackCells(Handle<Code> code); | 141 void ProcessTypeFeedbackCells(Handle<Code> code); |
| 143 | 142 |
| 144 // Returns an element from the backing store. Returns undefined if | 143 // Returns an element from the backing store. Returns undefined if |
| 145 // there is no information. | 144 // there is no information. |
| 146 Handle<Object> GetInfo(TypeFeedbackId id); | 145 Handle<Object> GetInfo(TypeFeedbackId id); |
| 147 | 146 |
| 148 // Return the cell that contains type feedback. | |
| 149 Handle<Cell> GetInfoCell(TypeFeedbackId id); | |
| 150 | |
| 151 private: | 147 private: |
| 152 Handle<Context> native_context_; | 148 Handle<Context> native_context_; |
| 153 Isolate* isolate_; | |
| 154 Zone* zone_; | 149 Zone* zone_; |
| 155 Handle<UnseededNumberDictionary> dictionary_; | 150 Handle<UnseededNumberDictionary> dictionary_; |
| 156 | 151 |
| 157 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle); | 152 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle); |
| 158 }; | 153 }; |
| 159 | 154 |
| 160 } } // namespace v8::internal | 155 } } // namespace v8::internal |
| 161 | 156 |
| 162 #endif // V8_TYPE_INFO_H_ | 157 #endif // V8_TYPE_INFO_H_ |
| OLD | NEW |