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 11 matching lines...) Expand all Loading... |
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #ifndef V8_TYPE_INFO_H_ | 28 #ifndef V8_TYPE_INFO_H_ |
29 #define V8_TYPE_INFO_H_ | 29 #define V8_TYPE_INFO_H_ |
30 | 30 |
31 #include "allocation.h" | 31 #include "allocation.h" |
| 32 #include "ast.h" |
32 #include "globals.h" | 33 #include "globals.h" |
33 #include "zone-inl.h" | 34 #include "zone-inl.h" |
34 | 35 |
35 namespace v8 { | 36 namespace v8 { |
36 namespace internal { | 37 namespace internal { |
37 | 38 |
38 const int kMaxKeyedPolymorphism = 4; | 39 const int kMaxKeyedPolymorphism = 4; |
39 | 40 |
40 // Unknown | 41 // Unknown |
41 // | \____________ | 42 // | \____________ |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 TypeFeedbackOracle(Handle<Code> code, | 237 TypeFeedbackOracle(Handle<Code> code, |
237 Handle<Context> global_context, | 238 Handle<Context> global_context, |
238 Isolate* isolate); | 239 Isolate* isolate); |
239 | 240 |
240 bool LoadIsMonomorphicNormal(Property* expr); | 241 bool LoadIsMonomorphicNormal(Property* expr); |
241 bool LoadIsMegamorphicWithTypeInfo(Property* expr); | 242 bool LoadIsMegamorphicWithTypeInfo(Property* expr); |
242 bool StoreIsMonomorphicNormal(Expression* expr); | 243 bool StoreIsMonomorphicNormal(Expression* expr); |
243 bool StoreIsMegamorphicWithTypeInfo(Expression* expr); | 244 bool StoreIsMegamorphicWithTypeInfo(Expression* expr); |
244 bool CallIsMonomorphic(Call* expr); | 245 bool CallIsMonomorphic(Call* expr); |
245 bool CallNewIsMonomorphic(CallNew* expr); | 246 bool CallNewIsMonomorphic(CallNew* expr); |
| 247 bool ObjectLiteralStoreIsMonomorphic(ObjectLiteral::Property* prop); |
246 | 248 |
247 bool IsForInFastCase(ForInStatement* expr); | 249 bool IsForInFastCase(ForInStatement* expr); |
248 | 250 |
249 Handle<Map> LoadMonomorphicReceiverType(Property* expr); | 251 Handle<Map> LoadMonomorphicReceiverType(Property* expr); |
250 Handle<Map> StoreMonomorphicReceiverType(Expression* expr); | 252 Handle<Map> StoreMonomorphicReceiverType(Expression* expr); |
251 | 253 |
252 void LoadReceiverTypes(Property* expr, | 254 void LoadReceiverTypes(Property* expr, |
253 Handle<String> name, | 255 Handle<String> name, |
254 SmallMapList* types); | 256 SmallMapList* types); |
255 void StoreReceiverTypes(Assignment* expr, | 257 void StoreReceiverTypes(Assignment* expr, |
256 Handle<String> name, | 258 Handle<String> name, |
257 SmallMapList* types); | 259 SmallMapList* types); |
258 void CallReceiverTypes(Call* expr, | 260 void CallReceiverTypes(Call* expr, |
259 Handle<String> name, | 261 Handle<String> name, |
260 CallKind call_kind, | 262 CallKind call_kind, |
261 SmallMapList* types); | 263 SmallMapList* types); |
262 void CollectKeyedReceiverTypes(unsigned ast_id, | 264 void CollectKeyedReceiverTypes(unsigned ast_id, |
263 SmallMapList* types); | 265 SmallMapList* types); |
264 | 266 |
265 static bool CanRetainOtherContext(Map* map, Context* global_context); | 267 static bool CanRetainOtherContext(Map* map, Context* global_context); |
266 static bool CanRetainOtherContext(JSFunction* function, | 268 static bool CanRetainOtherContext(JSFunction* function, |
267 Context* global_context); | 269 Context* global_context); |
268 | 270 |
269 CheckType GetCallCheckType(Call* expr); | 271 CheckType GetCallCheckType(Call* expr); |
270 Handle<JSObject> GetPrototypeForPrimitiveCheck(CheckType check); | 272 Handle<JSObject> GetPrototypeForPrimitiveCheck(CheckType check); |
271 | 273 |
272 Handle<JSFunction> GetCallTarget(Call* expr); | 274 Handle<JSFunction> GetCallTarget(Call* expr); |
273 Handle<JSFunction> GetCallNewTarget(CallNew* expr); | 275 Handle<JSFunction> GetCallNewTarget(CallNew* expr); |
274 | 276 |
| 277 Handle<Map> GetObjectLiteralStoreMap(ObjectLiteral::Property* prop); |
| 278 |
275 bool LoadIsBuiltin(Property* expr, Builtins::Name id); | 279 bool LoadIsBuiltin(Property* expr, Builtins::Name id); |
276 | 280 |
277 // TODO(1571) We can't use ToBooleanStub::Types as the return value because | 281 // TODO(1571) We can't use ToBooleanStub::Types as the return value because |
278 // of various cylces in our headers. Death to tons of implementations in | 282 // of various cylces in our headers. Death to tons of implementations in |
279 // headers!! :-P | 283 // headers!! :-P |
280 byte ToBooleanTypes(unsigned ast_id); | 284 byte ToBooleanTypes(unsigned ast_id); |
281 | 285 |
282 // Get type information for arithmetic operations and compares. | 286 // Get type information for arithmetic operations and compares. |
283 TypeInfo UnaryType(UnaryOperation* expr); | 287 TypeInfo UnaryType(UnaryOperation* expr); |
284 TypeInfo BinaryType(BinaryOperation* expr); | 288 TypeInfo BinaryType(BinaryOperation* expr); |
(...skipping 27 matching lines...) Expand all Loading... |
312 Handle<Context> global_context_; | 316 Handle<Context> global_context_; |
313 Isolate* isolate_; | 317 Isolate* isolate_; |
314 Handle<UnseededNumberDictionary> dictionary_; | 318 Handle<UnseededNumberDictionary> dictionary_; |
315 | 319 |
316 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle); | 320 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle); |
317 }; | 321 }; |
318 | 322 |
319 } } // namespace v8::internal | 323 } } // namespace v8::internal |
320 | 324 |
321 #endif // V8_TYPE_INFO_H_ | 325 #endif // V8_TYPE_INFO_H_ |
OLD | NEW |