OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 } | 335 } |
336 | 336 |
337 static void Clear(Address address, Code* target); | 337 static void Clear(Address address, Code* target); |
338 | 338 |
339 friend class IC; | 339 friend class IC; |
340 }; | 340 }; |
341 | 341 |
342 | 342 |
343 class KeyedIC: public IC { | 343 class KeyedIC: public IC { |
344 public: | 344 public: |
| 345 enum StubKind { |
| 346 LOAD, |
| 347 STORE_NO_TRANSITION, |
| 348 STORE_TRANSITION_SMI_TO_OBJECT, |
| 349 STORE_TRANSITION_SMI_TO_DOUBLE, |
| 350 STORE_TRANSITION_DOUBLE_TO_OBJECT |
| 351 }; |
345 explicit KeyedIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) {} | 352 explicit KeyedIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) {} |
346 virtual ~KeyedIC() {} | 353 virtual ~KeyedIC() {} |
347 | 354 |
348 virtual MaybeObject* GetElementStubWithoutMapCheck( | 355 virtual MaybeObject* GetElementStubWithoutMapCheck( |
349 bool is_js_array, | 356 bool is_js_array, |
350 ElementsKind elements_kind) = 0; | 357 ElementsKind elements_kind) = 0; |
351 | 358 |
352 protected: | 359 protected: |
353 virtual Code* string_stub() { | 360 virtual Code* string_stub() { |
354 return NULL; | 361 return NULL; |
355 } | 362 } |
356 | 363 |
357 virtual Code::Kind kind() const = 0; | 364 virtual Code::Kind kind() const = 0; |
358 | 365 |
359 MaybeObject* ComputeStub(JSObject* receiver, | 366 MaybeObject* ComputeStub(JSObject* receiver, |
360 bool is_store, | 367 StubKind stub_kind, |
361 StrictModeFlag strict_mode, | 368 StrictModeFlag strict_mode, |
362 Code* default_stub); | 369 Code* default_stub); |
363 | 370 |
364 virtual MaybeObject* ConstructMegamorphicStub( | 371 virtual MaybeObject* ConstructMegamorphicStub( |
365 MapList* receiver_maps, | 372 MapList* receiver_maps, |
366 CodeList* targets, | 373 CodeList* targets, |
367 StrictModeFlag strict_mode) = 0; | 374 StrictModeFlag strict_mode) = 0; |
368 | 375 |
369 private: | 376 private: |
370 void GetReceiverMapsForStub(Code* stub, MapList* result); | 377 void GetReceiverMapsForStub(Code* stub, MapList* result); |
371 | 378 |
372 MaybeObject* ComputeMonomorphicStubWithoutMapCheck( | 379 MaybeObject* ComputeMonomorphicStubWithoutMapCheck( |
373 Map* receiver_map, | 380 Map* receiver_map, |
374 StrictModeFlag strict_mode); | 381 StrictModeFlag strict_mode); |
375 | 382 |
376 MaybeObject* ComputeMonomorphicStub(JSObject* receiver, | 383 MaybeObject* ComputeMonomorphicStub(JSObject* receiver, |
377 bool is_store, | 384 StubKind stub_kind, |
378 StrictModeFlag strict_mode, | 385 StrictModeFlag strict_mode, |
379 Code* default_stub); | 386 Code* default_stub); |
| 387 |
| 388 MaybeObject* ComputePolymorphicStubWithTransition(JSObject* receiver, |
| 389 MapList* receiver_maps, |
| 390 Map* new_map, |
| 391 StrictModeFlag strict_mode); |
| 392 |
| 393 MaybeObject* ComputePolymorphicStub(MapList* receiver_maps, |
| 394 StrictModeFlag strict_mode); |
| 395 |
| 396 MaybeObject* ComputeTransitionedMap(JSObject* receiver, StubKind stub_kind); |
| 397 |
| 398 static bool IsTransitionStubKind(StubKind stub_kind) { |
| 399 return stub_kind > STORE_NO_TRANSITION; |
| 400 } |
380 }; | 401 }; |
381 | 402 |
382 | 403 |
383 class KeyedLoadIC: public KeyedIC { | 404 class KeyedLoadIC: public KeyedIC { |
384 public: | 405 public: |
385 explicit KeyedLoadIC(Isolate* isolate) : KeyedIC(isolate) { | 406 explicit KeyedLoadIC(Isolate* isolate) : KeyedIC(isolate) { |
386 ASSERT(target()->is_keyed_load_stub()); | 407 ASSERT(target()->is_keyed_load_stub()); |
387 } | 408 } |
388 | 409 |
389 MUST_USE_RESULT MaybeObject* Load(State state, | 410 MUST_USE_RESULT MaybeObject* Load(State state, |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
728 void patch(Code* code); | 749 void patch(Code* code); |
729 }; | 750 }; |
730 | 751 |
731 | 752 |
732 // Helper for BinaryOpIC and CompareIC. | 753 // Helper for BinaryOpIC and CompareIC. |
733 void PatchInlinedSmiCode(Address address); | 754 void PatchInlinedSmiCode(Address address); |
734 | 755 |
735 } } // namespace v8::internal | 756 } } // namespace v8::internal |
736 | 757 |
737 #endif // V8_IC_H_ | 758 #endif // V8_IC_H_ |
OLD | NEW |