| 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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 STORE_TRANSITION_DOUBLE_TO_OBJECT | 349 STORE_TRANSITION_DOUBLE_TO_OBJECT |
| 350 }; | 350 }; |
| 351 explicit KeyedIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) {} | 351 explicit KeyedIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) {} |
| 352 virtual ~KeyedIC() {} | 352 virtual ~KeyedIC() {} |
| 353 | 353 |
| 354 virtual MaybeObject* GetElementStubWithoutMapCheck( | 354 virtual MaybeObject* GetElementStubWithoutMapCheck( |
| 355 bool is_js_array, | 355 bool is_js_array, |
| 356 ElementsKind elements_kind) = 0; | 356 ElementsKind elements_kind) = 0; |
| 357 | 357 |
| 358 protected: | 358 protected: |
| 359 virtual Code* string_stub() { | 359 virtual Handle<Code> string_stub() { |
| 360 return NULL; | 360 return Handle<Code>::null(); |
| 361 } | 361 } |
| 362 | 362 |
| 363 virtual Code::Kind kind() const = 0; | 363 virtual Code::Kind kind() const = 0; |
| 364 | 364 |
| 365 Handle<Code> ComputeStub(Handle<JSObject> receiver, |
| 366 StubKind stub_kind, |
| 367 StrictModeFlag strict_mode, |
| 368 Handle<Code> default_stub); |
| 369 |
| 365 MaybeObject* ComputeStub(JSObject* receiver, | 370 MaybeObject* ComputeStub(JSObject* receiver, |
| 366 StubKind stub_kind, | 371 StubKind stub_kind, |
| 367 StrictModeFlag strict_mode, | 372 StrictModeFlag strict_mode, |
| 368 Code* default_stub); | 373 Code* default_stub); |
| 369 | 374 |
| 370 virtual MaybeObject* ComputePolymorphicStub(MapList* receiver_maps, | 375 virtual MaybeObject* ComputePolymorphicStub(MapList* receiver_maps, |
| 371 StrictModeFlag strict_mode) = 0; | 376 StrictModeFlag strict_mode) = 0; |
| 372 | 377 |
| 373 MaybeObject* ComputeMonomorphicStubWithoutMapCheck( | 378 MaybeObject* ComputeMonomorphicStubWithoutMapCheck( |
| 374 Map* receiver_map, | 379 Map* receiver_map, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 bool is_js_array, | 431 bool is_js_array, |
| 427 ElementsKind elements_kind); | 432 ElementsKind elements_kind); |
| 428 | 433 |
| 429 protected: | 434 protected: |
| 430 virtual Code::Kind kind() const { return Code::KEYED_LOAD_IC; } | 435 virtual Code::Kind kind() const { return Code::KEYED_LOAD_IC; } |
| 431 | 436 |
| 432 virtual MaybeObject* ComputePolymorphicStub( | 437 virtual MaybeObject* ComputePolymorphicStub( |
| 433 MapList* receiver_maps, | 438 MapList* receiver_maps, |
| 434 StrictModeFlag strict_mode); | 439 StrictModeFlag strict_mode); |
| 435 | 440 |
| 436 virtual Code* string_stub() { | 441 virtual Handle<Code> string_stub() { |
| 437 return isolate()->builtins()->builtin( | 442 return isolate()->builtins()->KeyedLoadIC_String(); |
| 438 Builtins::kKeyedLoadIC_String); | |
| 439 } | 443 } |
| 440 | 444 |
| 441 private: | 445 private: |
| 442 // Update the inline cache. | 446 // Update the inline cache. |
| 443 void UpdateCaches(LookupResult* lookup, | 447 void UpdateCaches(LookupResult* lookup, |
| 444 State state, | 448 State state, |
| 445 Handle<Object> object, | 449 Handle<Object> object, |
| 446 Handle<String> name); | 450 Handle<String> name); |
| 447 | 451 |
| 448 // Stub accessors. | 452 // Stub accessors. |
| 449 static Code* initialize_stub() { | 453 static Code* initialize_stub() { |
| 450 return Isolate::Current()->builtins()->builtin( | 454 return Isolate::Current()->builtins()->builtin( |
| 451 Builtins::kKeyedLoadIC_Initialize); | 455 Builtins::kKeyedLoadIC_Initialize); |
| 452 } | 456 } |
| 453 Code* megamorphic_stub() { | 457 Handle<Code> megamorphic_stub() { |
| 454 return isolate()->builtins()->builtin( | 458 return isolate()->builtins()->KeyedLoadIC_Generic(); |
| 455 Builtins::kKeyedLoadIC_Generic); | |
| 456 } | 459 } |
| 457 Code* generic_stub() { | 460 Handle<Code> generic_stub() { |
| 458 return isolate()->builtins()->builtin( | 461 return isolate()->builtins()->KeyedLoadIC_Generic(); |
| 459 Builtins::kKeyedLoadIC_Generic); | |
| 460 } | 462 } |
| 461 Code* pre_monomorphic_stub() { | 463 Handle<Code> pre_monomorphic_stub() { |
| 462 return isolate()->builtins()->builtin( | 464 return isolate()->builtins()->KeyedLoadIC_PreMonomorphic(); |
| 463 Builtins::kKeyedLoadIC_PreMonomorphic); | |
| 464 } | 465 } |
| 465 Code* indexed_interceptor_stub() { | 466 Handle<Code> indexed_interceptor_stub() { |
| 466 return isolate()->builtins()->builtin( | 467 return isolate()->builtins()->KeyedLoadIC_IndexedInterceptor(); |
| 467 Builtins::kKeyedLoadIC_IndexedInterceptor); | |
| 468 } | 468 } |
| 469 Code* non_strict_arguments_stub() { | 469 Handle<Code> non_strict_arguments_stub() { |
| 470 return isolate()->builtins()->builtin( | 470 return isolate()->builtins()->KeyedLoadIC_NonStrictArguments(); |
| 471 Builtins::kKeyedLoadIC_NonStrictArguments); | |
| 472 } | 471 } |
| 473 | 472 |
| 474 static void Clear(Address address, Code* target); | 473 static void Clear(Address address, Code* target); |
| 475 | 474 |
| 476 friend class IC; | 475 friend class IC; |
| 477 }; | 476 }; |
| 478 | 477 |
| 479 | 478 |
| 480 class StoreIC: public IC { | 479 class StoreIC: public IC { |
| 481 public: | 480 public: |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 void patch(Code* code); | 735 void patch(Code* code); |
| 737 }; | 736 }; |
| 738 | 737 |
| 739 | 738 |
| 740 // Helper for BinaryOpIC and CompareIC. | 739 // Helper for BinaryOpIC and CompareIC. |
| 741 void PatchInlinedSmiCode(Address address); | 740 void PatchInlinedSmiCode(Address address); |
| 742 | 741 |
| 743 } } // namespace v8::internal | 742 } } // namespace v8::internal |
| 744 | 743 |
| 745 #endif // V8_IC_H_ | 744 #endif // V8_IC_H_ |
| OLD | NEW |