| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 // Support for patching the map that is checked in an inlined | 391 // Support for patching the map that is checked in an inlined |
| 392 // version of keyed load. | 392 // version of keyed load. |
| 393 static bool PatchInlinedLoad(Address address, Object* map); | 393 static bool PatchInlinedLoad(Address address, Object* map); |
| 394 | 394 |
| 395 friend class IC; | 395 friend class IC; |
| 396 }; | 396 }; |
| 397 | 397 |
| 398 | 398 |
| 399 class StoreIC: public IC { | 399 class StoreIC: public IC { |
| 400 public: | 400 public: |
| 401 |
| 402 enum StoreICStrictMode { |
| 403 kStoreICNonStrict = kNonStrictMode, |
| 404 kStoreICStrict = kStrictMode |
| 405 }; |
| 406 |
| 401 StoreIC() : IC(NO_EXTRA_FRAME) { ASSERT(target()->is_store_stub()); } | 407 StoreIC() : IC(NO_EXTRA_FRAME) { ASSERT(target()->is_store_stub()); } |
| 402 | 408 |
| 403 MUST_USE_RESULT MaybeObject* Store(State state, | 409 MUST_USE_RESULT MaybeObject* Store(State state, |
| 410 Code::ExtraICState extra_ic_state, |
| 404 Handle<Object> object, | 411 Handle<Object> object, |
| 405 Handle<String> name, | 412 Handle<String> name, |
| 406 Handle<Object> value); | 413 Handle<Object> value); |
| 407 | 414 |
| 408 // Code generators for stub routines. Only called once at startup. | 415 // Code generators for stub routines. Only called once at startup. |
| 409 static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } | 416 static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } |
| 410 static void GenerateMiss(MacroAssembler* masm); | 417 static void GenerateMiss(MacroAssembler* masm); |
| 411 static void GenerateMegamorphic(MacroAssembler* masm); | 418 static void GenerateMegamorphic(MacroAssembler* masm, |
| 419 Code::ExtraICState extra_ic_state); |
| 412 static void GenerateArrayLength(MacroAssembler* masm); | 420 static void GenerateArrayLength(MacroAssembler* masm); |
| 413 static void GenerateNormal(MacroAssembler* masm); | 421 static void GenerateNormal(MacroAssembler* masm); |
| 414 static void GenerateGlobalProxy(MacroAssembler* masm); | 422 static void GenerateGlobalProxy(MacroAssembler* masm); |
| 415 | 423 |
| 416 // Clear the use of an inlined version. | 424 // Clear the use of an inlined version. |
| 417 static void ClearInlinedVersion(Address address); | 425 static void ClearInlinedVersion(Address address); |
| 418 | 426 |
| 419 // The offset from the inlined patch site to the start of the | 427 // The offset from the inlined patch site to the start of the |
| 420 // inlined store instruction. | 428 // inlined store instruction. |
| 421 static const int kOffsetToStoreInstruction; | 429 static const int kOffsetToStoreInstruction; |
| 422 | 430 |
| 423 private: | 431 private: |
| 424 // Update the inline cache and the global stub cache based on the | 432 // Update the inline cache and the global stub cache based on the |
| 425 // lookup result. | 433 // lookup result. |
| 426 void UpdateCaches(LookupResult* lookup, | 434 void UpdateCaches(LookupResult* lookup, |
| 427 State state, Handle<JSObject> receiver, | 435 State state, |
| 436 Code::ExtraICState extra_ic_state, |
| 437 Handle<JSObject> receiver, |
| 428 Handle<String> name, | 438 Handle<String> name, |
| 429 Handle<Object> value); | 439 Handle<Object> value); |
| 430 | 440 |
| 431 // Stub accessors. | 441 // Stub accessors. |
| 432 static Code* megamorphic_stub() { | 442 static Code* megamorphic_stub() { |
| 433 return Builtins::builtin(Builtins::StoreIC_Megamorphic); | 443 return Builtins::builtin(Builtins::StoreIC_Megamorphic); |
| 434 } | 444 } |
| 445 static Code* megamorphic_stub_strict() { |
| 446 return Builtins::builtin(Builtins::StoreIC_Megamorphic_Strict); |
| 447 } |
| 435 static Code* initialize_stub() { | 448 static Code* initialize_stub() { |
| 436 return Builtins::builtin(Builtins::StoreIC_Initialize); | 449 return Builtins::builtin(Builtins::StoreIC_Initialize); |
| 437 } | 450 } |
| 451 static Code* initialize_stub_strict() { |
| 452 return Builtins::builtin(Builtins::StoreIC_Initialize_Strict); |
| 453 } |
| 438 static Code* global_proxy_stub() { | 454 static Code* global_proxy_stub() { |
| 439 return Builtins::builtin(Builtins::StoreIC_GlobalProxy); | 455 return Builtins::builtin(Builtins::StoreIC_GlobalProxy); |
| 440 } | 456 } |
| 457 static Code* global_proxy_stub_strict() { |
| 458 return Builtins::builtin(Builtins::StoreIC_GlobalProxy_Strict); |
| 459 } |
| 441 | 460 |
| 442 static void Clear(Address address, Code* target); | 461 static void Clear(Address address, Code* target); |
| 443 | 462 |
| 444 // Support for patching the index and the map that is checked in an | 463 // Support for patching the index and the map that is checked in an |
| 445 // inlined version of the named store. | 464 // inlined version of the named store. |
| 446 static bool PatchInlinedStore(Address address, Object* map, int index); | 465 static bool PatchInlinedStore(Address address, Object* map, int index); |
| 447 | 466 |
| 448 friend class IC; | 467 friend class IC; |
| 449 }; | 468 }; |
| 450 | 469 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 | 609 |
| 591 Token::Value op_; | 610 Token::Value op_; |
| 592 }; | 611 }; |
| 593 | 612 |
| 594 // Helper for TRBinaryOpIC and CompareIC. | 613 // Helper for TRBinaryOpIC and CompareIC. |
| 595 void PatchInlinedSmiCode(Address address); | 614 void PatchInlinedSmiCode(Address address); |
| 596 | 615 |
| 597 } } // namespace v8::internal | 616 } } // namespace v8::internal |
| 598 | 617 |
| 599 #endif // V8_IC_H_ | 618 #endif // V8_IC_H_ |
| OLD | NEW |