| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 enum FrameDepth { | 87 enum FrameDepth { |
| 88 NO_EXTRA_FRAME = 0, | 88 NO_EXTRA_FRAME = 0, |
| 89 EXTRA_CALL_FRAME = 1 | 89 EXTRA_CALL_FRAME = 1 |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 // Construct the IC structure with the given number of extra | 92 // Construct the IC structure with the given number of extra |
| 93 // JavaScript frames on the stack. | 93 // JavaScript frames on the stack. |
| 94 IC(FrameDepth depth, Isolate* isolate); | 94 IC(FrameDepth depth, Isolate* isolate); |
| 95 virtual ~IC() {} | 95 virtual ~IC() {} |
| 96 | 96 |
| 97 // Get the call-site target; used for determining the state. | |
| 98 Handle<Code> target() const { return target_; } | |
| 99 Code* raw_target() const { return GetTargetAtAddress(address()); } | |
| 100 | |
| 101 State state() const { return state_; } | 97 State state() const { return state_; } |
| 102 inline Address address() const; | 98 inline Address address() const; |
| 103 | 99 |
| 104 // Compute the current IC state based on the target stub, receiver and name. | 100 // Compute the current IC state based on the target stub, receiver and name. |
| 105 void UpdateState(Handle<Object> receiver, Handle<Object> name); | 101 void UpdateState(Handle<Object> receiver, Handle<Object> name); |
| 106 void MarkMonomorphicPrototypeFailure() { | 102 void MarkMonomorphicPrototypeFailure() { |
| 107 state_ = MONOMORPHIC_PROTOTYPE_FAILURE; | 103 state_ = MONOMORPHIC_PROTOTYPE_FAILURE; |
| 108 } | 104 } |
| 109 | 105 |
| 110 // Clear the inline cache to initial state. | 106 // Clear the inline cache to initial state. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 123 } else { | 119 } else { |
| 124 ASSERT(!SlowIsUndeclaredGlobal()); | 120 ASSERT(!SlowIsUndeclaredGlobal()); |
| 125 return false; | 121 return false; |
| 126 } | 122 } |
| 127 } | 123 } |
| 128 | 124 |
| 129 bool SlowIsUndeclaredGlobal() { | 125 bool SlowIsUndeclaredGlobal() { |
| 130 return ComputeMode() == RelocInfo::CODE_TARGET_CONTEXT; | 126 return ComputeMode() == RelocInfo::CODE_TARGET_CONTEXT; |
| 131 } | 127 } |
| 132 | 128 |
| 129 #ifdef DEBUG |
| 130 bool IsLoadStub() { |
| 131 return target()->is_load_stub() || target()->is_keyed_load_stub(); |
| 132 } |
| 133 |
| 134 bool IsStoreStub() { |
| 135 return target()->is_store_stub() || target()->is_keyed_store_stub(); |
| 136 } |
| 137 |
| 138 bool IsCallStub() { |
| 139 return target()->is_call_stub() || target()->is_keyed_call_stub(); |
| 140 } |
| 141 #endif |
| 142 |
| 133 // Determines which map must be used for keeping the code stub. | 143 // Determines which map must be used for keeping the code stub. |
| 134 // These methods should not be called with undefined or null. | 144 // These methods should not be called with undefined or null. |
| 135 static inline InlineCacheHolderFlag GetCodeCacheForObject(Object* object, | 145 static inline InlineCacheHolderFlag GetCodeCacheForObject(Object* object); |
| 136 JSObject* holder); | 146 // TODO(verwaest): This currently returns a HeapObject rather than JSObject* |
| 137 static inline JSObject* GetCodeCacheHolder(Isolate* isolate, | 147 // since loading the IC for loading the length from strings are stored on |
| 138 Object* object, | 148 // the string map directly, rather than on the JSObject-typed prototype. |
| 139 InlineCacheHolderFlag holder); | 149 static inline HeapObject* GetCodeCacheHolder(Isolate* isolate, |
| 150 Object* object, |
| 151 InlineCacheHolderFlag holder); |
| 140 | 152 |
| 141 static bool IsCleared(Code* code) { | 153 static bool IsCleared(Code* code) { |
| 142 InlineCacheState state = code->ic_state(); | 154 InlineCacheState state = code->ic_state(); |
| 143 return state == UNINITIALIZED || state == PREMONOMORPHIC; | 155 return state == UNINITIALIZED || state == PREMONOMORPHIC; |
| 144 } | 156 } |
| 145 | 157 |
| 146 protected: | 158 protected: |
| 159 // Get the call-site target; used for determining the state. |
| 160 Handle<Code> target() const { return target_; } |
| 161 |
| 147 Address fp() const { return fp_; } | 162 Address fp() const { return fp_; } |
| 148 Address pc() const { return *pc_address_; } | 163 Address pc() const { return *pc_address_; } |
| 149 Isolate* isolate() const { return isolate_; } | 164 Isolate* isolate() const { return isolate_; } |
| 150 | 165 |
| 151 #ifdef ENABLE_DEBUGGER_SUPPORT | 166 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 152 // Computes the address in the original code when the code running is | 167 // Computes the address in the original code when the code running is |
| 153 // containing break points (calls to DebugBreakXXX builtins). | 168 // containing break points (calls to DebugBreakXXX builtins). |
| 154 Address OriginalCodeAddress() const; | 169 Address OriginalCodeAddress() const; |
| 155 #endif | 170 #endif |
| 156 | 171 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 173 Handle<Object> key); | 188 Handle<Object> key); |
| 174 Failure* ReferenceError(const char* type, Handle<String> name); | 189 Failure* ReferenceError(const char* type, Handle<String> name); |
| 175 | 190 |
| 176 // Access the target code for the given IC address. | 191 // Access the target code for the given IC address. |
| 177 static inline Code* GetTargetAtAddress(Address address); | 192 static inline Code* GetTargetAtAddress(Address address); |
| 178 static inline void SetTargetAtAddress(Address address, Code* target); | 193 static inline void SetTargetAtAddress(Address address, Code* target); |
| 179 static void PostPatching(Address address, Code* target, Code* old_target); | 194 static void PostPatching(Address address, Code* target, Code* old_target); |
| 180 | 195 |
| 181 // Compute the handler either by compiling or by retrieving a cached version. | 196 // Compute the handler either by compiling or by retrieving a cached version. |
| 182 Handle<Code> ComputeHandler(LookupResult* lookup, | 197 Handle<Code> ComputeHandler(LookupResult* lookup, |
| 183 Handle<JSObject> receiver, | 198 Handle<Object> object, |
| 184 Handle<String> name, | 199 Handle<String> name, |
| 185 Handle<Object> value = Handle<Code>::null()); | 200 Handle<Object> value = Handle<Code>::null()); |
| 186 virtual Handle<Code> CompileHandler(LookupResult* lookup, | 201 virtual Handle<Code> CompileHandler(LookupResult* lookup, |
| 187 Handle<JSObject> receiver, | 202 Handle<Object> object, |
| 188 Handle<String> name, | 203 Handle<String> name, |
| 189 Handle<Object> value) { | 204 Handle<Object> value, |
| 205 InlineCacheHolderFlag cache_holder) { |
| 190 UNREACHABLE(); | 206 UNREACHABLE(); |
| 191 return Handle<Code>::null(); | 207 return Handle<Code>::null(); |
| 192 } | 208 } |
| 193 void UpdateMonomorphicIC(Handle<HeapObject> receiver, | 209 void UpdateMonomorphicIC(Handle<Object> receiver, |
| 194 Handle<Code> handler, | 210 Handle<Code> handler, |
| 195 Handle<String> name); | 211 Handle<String> name); |
| 196 | 212 |
| 197 bool UpdatePolymorphicIC(Handle<HeapObject> receiver, | 213 bool UpdatePolymorphicIC(Handle<Object> receiver, |
| 198 Handle<String> name, | 214 Handle<String> name, |
| 199 Handle<Code> code); | 215 Handle<Code> code); |
| 200 | 216 |
| 201 void CopyICToMegamorphicCache(Handle<String> name); | 217 void CopyICToMegamorphicCache(Handle<String> name); |
| 202 bool IsTransitionedMapOfMonomorphicTarget(Map* receiver_map); | 218 bool IsTransitionedMapOfMonomorphicTarget(Map* receiver_map); |
| 203 void PatchCache(Handle<HeapObject> receiver, | 219 void PatchCache(Handle<Object> object, |
| 204 Handle<String> name, | 220 Handle<String> name, |
| 205 Handle<Code> code); | 221 Handle<Code> code); |
| 206 virtual void UpdateMegamorphicCache(Map* map, Name* name, Code* code); | 222 virtual void UpdateMegamorphicCache(Map* map, Name* name, Code* code); |
| 207 virtual Code::Kind kind() const { | 223 virtual Code::Kind kind() const { |
| 208 UNREACHABLE(); | 224 UNREACHABLE(); |
| 209 return Code::STUB; | 225 return Code::STUB; |
| 210 } | 226 } |
| 211 virtual Handle<Code> slow_stub() const { | 227 virtual Handle<Code> slow_stub() const { |
| 212 UNREACHABLE(); | 228 UNREACHABLE(); |
| 213 return Handle<Code>::null(); | 229 return Handle<Code>::null(); |
| 214 } | 230 } |
| 215 virtual Handle<Code> megamorphic_stub() { | 231 virtual Handle<Code> megamorphic_stub() { |
| 216 UNREACHABLE(); | 232 UNREACHABLE(); |
| 217 return Handle<Code>::null(); | 233 return Handle<Code>::null(); |
| 218 } | 234 } |
| 219 virtual Handle<Code> generic_stub() const { | 235 virtual Handle<Code> generic_stub() const { |
| 220 UNREACHABLE(); | 236 UNREACHABLE(); |
| 221 return Handle<Code>::null(); | 237 return Handle<Code>::null(); |
| 222 } | 238 } |
| 223 virtual StrictModeFlag strict_mode() const { return kNonStrictMode; } | 239 virtual StrictModeFlag strict_mode() const { return kNonStrictMode; } |
| 224 bool TryRemoveInvalidPrototypeDependentStub(Handle<Object> receiver, | 240 bool TryRemoveInvalidPrototypeDependentStub(Handle<Object> receiver, |
| 225 Handle<String> name); | 241 Handle<String> name); |
| 226 void TryRemoveInvalidHandlers(Handle<Map> map, Handle<String> name); | 242 void TryRemoveInvalidHandlers(Handle<Map> map, Handle<String> name); |
| 227 | 243 |
| 228 private: | 244 private: |
| 245 Code* raw_target() const { return GetTargetAtAddress(address()); } |
| 246 |
| 229 // Frame pointer for the frame that uses (calls) the IC. | 247 // Frame pointer for the frame that uses (calls) the IC. |
| 230 Address fp_; | 248 Address fp_; |
| 231 | 249 |
| 232 // All access to the program counter of an IC structure is indirect | 250 // All access to the program counter of an IC structure is indirect |
| 233 // to make the code GC safe. This feature is crucial since | 251 // to make the code GC safe. This feature is crucial since |
| 234 // GetProperty and SetProperty are called and they in turn might | 252 // GetProperty and SetProperty are called and they in turn might |
| 235 // invoke the garbage collector. | 253 // invoke the garbage collector. |
| 236 Address* pc_address_; | 254 Address* pc_address_; |
| 237 | 255 |
| 238 Isolate* isolate_; | 256 Isolate* isolate_; |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 | 399 |
| 382 static void GenerateMegamorphic(MacroAssembler* masm, int argc); | 400 static void GenerateMegamorphic(MacroAssembler* masm, int argc); |
| 383 static void GenerateNormal(MacroAssembler* masm, int argc); | 401 static void GenerateNormal(MacroAssembler* masm, int argc); |
| 384 static void GenerateNonStrictArguments(MacroAssembler* masm, int argc); | 402 static void GenerateNonStrictArguments(MacroAssembler* masm, int argc); |
| 385 }; | 403 }; |
| 386 | 404 |
| 387 | 405 |
| 388 class LoadIC: public IC { | 406 class LoadIC: public IC { |
| 389 public: | 407 public: |
| 390 explicit LoadIC(FrameDepth depth, Isolate* isolate) : IC(depth, isolate) { | 408 explicit LoadIC(FrameDepth depth, Isolate* isolate) : IC(depth, isolate) { |
| 391 ASSERT(target()->is_load_stub() || target()->is_keyed_load_stub()); | 409 ASSERT(IsLoadStub()); |
| 392 } | 410 } |
| 393 | 411 |
| 394 // Code generator routines. | 412 // Code generator routines. |
| 395 static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } | 413 static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } |
| 396 static void GeneratePreMonomorphic(MacroAssembler* masm) { | 414 static void GeneratePreMonomorphic(MacroAssembler* masm) { |
| 397 GenerateMiss(masm); | 415 GenerateMiss(masm); |
| 398 } | 416 } |
| 399 static void GenerateMiss(MacroAssembler* masm); | 417 static void GenerateMiss(MacroAssembler* masm); |
| 400 static void GenerateMegamorphic(MacroAssembler* masm); | 418 static void GenerateMegamorphic(MacroAssembler* masm); |
| 401 static void GenerateNormal(MacroAssembler* masm); | 419 static void GenerateNormal(MacroAssembler* masm); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 415 return isolate()->builtins()->LoadIC_Megamorphic(); | 433 return isolate()->builtins()->LoadIC_Megamorphic(); |
| 416 } | 434 } |
| 417 | 435 |
| 418 // Update the inline cache and the global stub cache based on the | 436 // Update the inline cache and the global stub cache based on the |
| 419 // lookup result. | 437 // lookup result. |
| 420 void UpdateCaches(LookupResult* lookup, | 438 void UpdateCaches(LookupResult* lookup, |
| 421 Handle<Object> object, | 439 Handle<Object> object, |
| 422 Handle<String> name); | 440 Handle<String> name); |
| 423 | 441 |
| 424 virtual Handle<Code> CompileHandler(LookupResult* lookup, | 442 virtual Handle<Code> CompileHandler(LookupResult* lookup, |
| 425 Handle<JSObject> receiver, | 443 Handle<Object> object, |
| 426 Handle<String> name, | 444 Handle<String> name, |
| 427 Handle<Object> unused); | 445 Handle<Object> unused, |
| 446 InlineCacheHolderFlag cache_holder); |
| 428 | 447 |
| 429 private: | 448 private: |
| 430 // Stub accessors. | 449 // Stub accessors. |
| 431 static Handle<Code> initialize_stub(Isolate* isolate) { | 450 static Handle<Code> initialize_stub(Isolate* isolate) { |
| 432 return isolate->builtins()->LoadIC_Initialize(); | 451 return isolate->builtins()->LoadIC_Initialize(); |
| 433 } | 452 } |
| 434 | 453 |
| 435 static Handle<Code> pre_monomorphic_stub(Isolate* isolate) { | 454 static Handle<Code> pre_monomorphic_stub(Isolate* isolate) { |
| 436 return isolate->builtins()->LoadIC_PreMonomorphic(); | 455 return isolate->builtins()->LoadIC_PreMonomorphic(); |
| 437 } | 456 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 457 }; | 476 }; |
| 458 | 477 |
| 459 | 478 |
| 460 class KeyedLoadIC: public LoadIC { | 479 class KeyedLoadIC: public LoadIC { |
| 461 public: | 480 public: |
| 462 explicit KeyedLoadIC(FrameDepth depth, Isolate* isolate) | 481 explicit KeyedLoadIC(FrameDepth depth, Isolate* isolate) |
| 463 : LoadIC(depth, isolate) { | 482 : LoadIC(depth, isolate) { |
| 464 ASSERT(target()->is_keyed_load_stub()); | 483 ASSERT(target()->is_keyed_load_stub()); |
| 465 } | 484 } |
| 466 | 485 |
| 486 MUST_USE_RESULT MaybeObject* LoadForceGeneric(Handle<Object> object, |
| 487 Handle<Object> key); |
| 488 |
| 467 MUST_USE_RESULT MaybeObject* Load(Handle<Object> object, | 489 MUST_USE_RESULT MaybeObject* Load(Handle<Object> object, |
| 468 Handle<Object> key, | 490 Handle<Object> key); |
| 469 ICMissMode force_generic); | |
| 470 | 491 |
| 471 // Code generator routines. | 492 // Code generator routines. |
| 472 static void GenerateMiss(MacroAssembler* masm, ICMissMode force_generic); | 493 static void GenerateMiss(MacroAssembler* masm, ICMissMode force_generic); |
| 473 static void GenerateRuntimeGetProperty(MacroAssembler* masm); | 494 static void GenerateRuntimeGetProperty(MacroAssembler* masm); |
| 474 static void GenerateInitialize(MacroAssembler* masm) { | 495 static void GenerateInitialize(MacroAssembler* masm) { |
| 475 GenerateMiss(masm, MISS); | 496 GenerateMiss(masm, MISS); |
| 476 } | 497 } |
| 477 static void GeneratePreMonomorphic(MacroAssembler* masm) { | 498 static void GeneratePreMonomorphic(MacroAssembler* masm) { |
| 478 GenerateMiss(masm, MISS); | 499 GenerateMiss(masm, MISS); |
| 479 } | 500 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 | 552 |
| 532 friend class IC; | 553 friend class IC; |
| 533 }; | 554 }; |
| 534 | 555 |
| 535 | 556 |
| 536 class StoreIC: public IC { | 557 class StoreIC: public IC { |
| 537 public: | 558 public: |
| 538 StoreIC(FrameDepth depth, Isolate* isolate) | 559 StoreIC(FrameDepth depth, Isolate* isolate) |
| 539 : IC(depth, isolate), | 560 : IC(depth, isolate), |
| 540 strict_mode_(Code::GetStrictMode(target()->extra_ic_state())) { | 561 strict_mode_(Code::GetStrictMode(target()->extra_ic_state())) { |
| 541 ASSERT(target()->is_store_stub() || target()->is_keyed_store_stub()); | 562 ASSERT(IsStoreStub()); |
| 542 } | 563 } |
| 543 | 564 |
| 544 virtual StrictModeFlag strict_mode() const { return strict_mode_; } | 565 virtual StrictModeFlag strict_mode() const { return strict_mode_; } |
| 545 | 566 |
| 546 // Code generators for stub routines. Only called once at startup. | 567 // Code generators for stub routines. Only called once at startup. |
| 547 static void GenerateSlow(MacroAssembler* masm); | 568 static void GenerateSlow(MacroAssembler* masm); |
| 548 static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } | 569 static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } |
| 549 static void GeneratePreMonomorphic(MacroAssembler* masm) { | 570 static void GeneratePreMonomorphic(MacroAssembler* masm) { |
| 550 GenerateMiss(masm); | 571 GenerateMiss(masm); |
| 551 } | 572 } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 } | 631 } |
| 611 } | 632 } |
| 612 | 633 |
| 613 // Update the inline cache and the global stub cache based on the | 634 // Update the inline cache and the global stub cache based on the |
| 614 // lookup result. | 635 // lookup result. |
| 615 void UpdateCaches(LookupResult* lookup, | 636 void UpdateCaches(LookupResult* lookup, |
| 616 Handle<JSObject> receiver, | 637 Handle<JSObject> receiver, |
| 617 Handle<String> name, | 638 Handle<String> name, |
| 618 Handle<Object> value); | 639 Handle<Object> value); |
| 619 virtual Handle<Code> CompileHandler(LookupResult* lookup, | 640 virtual Handle<Code> CompileHandler(LookupResult* lookup, |
| 620 Handle<JSObject> receiver, | 641 Handle<Object> object, |
| 621 Handle<String> name, | 642 Handle<String> name, |
| 622 Handle<Object> value); | 643 Handle<Object> value, |
| 644 InlineCacheHolderFlag cache_holder); |
| 623 | 645 |
| 624 private: | 646 private: |
| 625 void set_target(Code* code) { | 647 void set_target(Code* code) { |
| 626 // Strict mode must be preserved across IC patching. | 648 // Strict mode must be preserved across IC patching. |
| 627 ASSERT(Code::GetStrictMode(code->extra_ic_state()) == | 649 ASSERT(Code::GetStrictMode(code->extra_ic_state()) == |
| 628 Code::GetStrictMode(target()->extra_ic_state())); | 650 Code::GetStrictMode(target()->extra_ic_state())); |
| 629 IC::set_target(code); | 651 IC::set_target(code); |
| 630 } | 652 } |
| 631 | 653 |
| 632 static Handle<Code> initialize_stub(Isolate* isolate, | 654 static Handle<Code> initialize_stub(Isolate* isolate, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 658 }; | 680 }; |
| 659 | 681 |
| 660 | 682 |
| 661 class KeyedStoreIC: public StoreIC { | 683 class KeyedStoreIC: public StoreIC { |
| 662 public: | 684 public: |
| 663 KeyedStoreIC(FrameDepth depth, Isolate* isolate) | 685 KeyedStoreIC(FrameDepth depth, Isolate* isolate) |
| 664 : StoreIC(depth, isolate) { | 686 : StoreIC(depth, isolate) { |
| 665 ASSERT(target()->is_keyed_store_stub()); | 687 ASSERT(target()->is_keyed_store_stub()); |
| 666 } | 688 } |
| 667 | 689 |
| 690 MUST_USE_RESULT MaybeObject* StoreForceGeneric(Handle<Object> object, |
| 691 Handle<Object> name, |
| 692 Handle<Object> value); |
| 668 MUST_USE_RESULT MaybeObject* Store(Handle<Object> object, | 693 MUST_USE_RESULT MaybeObject* Store(Handle<Object> object, |
| 669 Handle<Object> name, | 694 Handle<Object> name, |
| 670 Handle<Object> value, | 695 Handle<Object> value); |
| 671 ICMissMode force_generic); | |
| 672 | 696 |
| 673 // Code generators for stub routines. Only called once at startup. | 697 // Code generators for stub routines. Only called once at startup. |
| 674 static void GenerateInitialize(MacroAssembler* masm) { | 698 static void GenerateInitialize(MacroAssembler* masm) { |
| 675 GenerateMiss(masm, MISS); | 699 GenerateMiss(masm, MISS); |
| 676 } | 700 } |
| 677 static void GeneratePreMonomorphic(MacroAssembler* masm) { | 701 static void GeneratePreMonomorphic(MacroAssembler* masm) { |
| 678 GenerateMiss(masm, MISS); | 702 GenerateMiss(masm, MISS); |
| 679 } | 703 } |
| 680 static void GenerateMiss(MacroAssembler* masm, ICMissMode force_generic); | 704 static void GenerateMiss(MacroAssembler* masm, ICMissMode force_generic); |
| 681 static void GenerateSlow(MacroAssembler* masm); | 705 static void GenerateSlow(MacroAssembler* masm); |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 814 Handle<Type>* left_type, | 838 Handle<Type>* left_type, |
| 815 Handle<Type>* right_type, | 839 Handle<Type>* right_type, |
| 816 Handle<Type>* overall_type, | 840 Handle<Type>* overall_type, |
| 817 Handle<Map> map, | 841 Handle<Map> map, |
| 818 Isolate* isolate); | 842 Isolate* isolate); |
| 819 | 843 |
| 820 CompareIC(Isolate* isolate, Token::Value op) | 844 CompareIC(Isolate* isolate, Token::Value op) |
| 821 : IC(EXTRA_CALL_FRAME, isolate), op_(op) { } | 845 : IC(EXTRA_CALL_FRAME, isolate), op_(op) { } |
| 822 | 846 |
| 823 // Update the inline cache for the given operands. | 847 // Update the inline cache for the given operands. |
| 824 void UpdateCaches(Handle<Object> x, Handle<Object> y); | 848 Code* UpdateCaches(Handle<Object> x, Handle<Object> y); |
| 825 | 849 |
| 826 | 850 |
| 827 // Factory method for getting an uninitialized compare stub. | 851 // Factory method for getting an uninitialized compare stub. |
| 828 static Handle<Code> GetUninitialized(Isolate* isolate, Token::Value op); | 852 static Handle<Code> GetUninitialized(Isolate* isolate, Token::Value op); |
| 829 | 853 |
| 830 // Helper function for computing the condition for a compare operation. | 854 // Helper function for computing the condition for a compare operation. |
| 831 static Condition ComputeCondition(Token::Value op); | 855 static Condition ComputeCondition(Token::Value op); |
| 832 | 856 |
| 833 static const char* GetStateName(State state); | 857 static const char* GetStateName(State state); |
| 834 | 858 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 867 | 891 |
| 868 static MUST_USE_RESULT MaybeObject* DoCompareNilSlow(NilValue nil, | 892 static MUST_USE_RESULT MaybeObject* DoCompareNilSlow(NilValue nil, |
| 869 Handle<Object> object); | 893 Handle<Object> object); |
| 870 }; | 894 }; |
| 871 | 895 |
| 872 | 896 |
| 873 class ToBooleanIC: public IC { | 897 class ToBooleanIC: public IC { |
| 874 public: | 898 public: |
| 875 explicit ToBooleanIC(Isolate* isolate) : IC(EXTRA_CALL_FRAME, isolate) { } | 899 explicit ToBooleanIC(Isolate* isolate) : IC(EXTRA_CALL_FRAME, isolate) { } |
| 876 | 900 |
| 877 MaybeObject* ToBoolean(Handle<Object> object, Code::ExtraICState state); | 901 MaybeObject* ToBoolean(Handle<Object> object); |
| 878 }; | 902 }; |
| 879 | 903 |
| 880 | 904 |
| 881 // Helper for BinaryOpIC and CompareIC. | 905 // Helper for BinaryOpIC and CompareIC. |
| 882 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; | 906 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; |
| 883 void PatchInlinedSmiCode(Address address, InlinedSmiCheck check); | 907 void PatchInlinedSmiCode(Address address, InlinedSmiCheck check); |
| 884 | 908 |
| 885 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissFromStubFailure); | 909 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissFromStubFailure); |
| 886 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_MissFromStubFailure); | 910 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_MissFromStubFailure); |
| 887 DECLARE_RUNTIME_FUNCTION(MaybeObject*, UnaryOpIC_Miss); | 911 DECLARE_RUNTIME_FUNCTION(MaybeObject*, UnaryOpIC_Miss); |
| 888 DECLARE_RUNTIME_FUNCTION(MaybeObject*, StoreIC_MissFromStubFailure); | 912 DECLARE_RUNTIME_FUNCTION(MaybeObject*, StoreIC_MissFromStubFailure); |
| 913 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedCallIC_MissFromStubFailure); |
| 889 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss); | 914 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss); |
| 890 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_Miss); | 915 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_Miss); |
| 891 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss); | 916 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss); |
| 892 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss); | 917 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss); |
| 893 | 918 |
| 894 | 919 |
| 895 } } // namespace v8::internal | 920 } } // namespace v8::internal |
| 896 | 921 |
| 897 #endif // V8_IC_H_ | 922 #endif // V8_IC_H_ |
| OLD | NEW |