| 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 22 matching lines...) Expand all Loading... |
| 33 namespace v8 { | 33 namespace v8 { |
| 34 namespace internal { | 34 namespace internal { |
| 35 | 35 |
| 36 // List of code stubs used on all platforms. The order in this list is important | 36 // List of code stubs used on all platforms. The order in this list is important |
| 37 // as only the stubs up to and including Instanceof allows nested stub calls. | 37 // as only the stubs up to and including Instanceof allows nested stub calls. |
| 38 #define CODE_STUB_LIST_ALL_PLATFORMS(V) \ | 38 #define CODE_STUB_LIST_ALL_PLATFORMS(V) \ |
| 39 V(CallFunction) \ | 39 V(CallFunction) \ |
| 40 V(GenericBinaryOp) \ | 40 V(GenericBinaryOp) \ |
| 41 V(TypeRecordingBinaryOp) \ | 41 V(TypeRecordingBinaryOp) \ |
| 42 V(StringAdd) \ | 42 V(StringAdd) \ |
| 43 V(StringCharAt) \ | |
| 44 V(SubString) \ | 43 V(SubString) \ |
| 45 V(StringCompare) \ | 44 V(StringCompare) \ |
| 46 V(SmiOp) \ | 45 V(SmiOp) \ |
| 47 V(Compare) \ | 46 V(Compare) \ |
| 48 V(CompareIC) \ | 47 V(CompareIC) \ |
| 49 V(MathPow) \ | 48 V(MathPow) \ |
| 50 V(IncrementalMarkingRecordWrite) \ | 49 V(IncrementalMarkingRecordWrite) \ |
| 51 V(StoreBufferOverflow) \ | 50 V(StoreBufferOverflow) \ |
| 52 V(RegExpExec) \ | 51 V(RegExpExec) \ |
| 53 V(TranscendentalCache) \ | 52 V(TranscendentalCache) \ |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 virtual int GetCodeKind(); | 161 virtual int GetCodeKind(); |
| 163 | 162 |
| 164 // GenericBinaryOpStub needs to override this. | 163 // GenericBinaryOpStub needs to override this. |
| 165 virtual InlineCacheState GetICState() { | 164 virtual InlineCacheState GetICState() { |
| 166 return UNINITIALIZED; | 165 return UNINITIALIZED; |
| 167 } | 166 } |
| 168 | 167 |
| 169 // Returns a name for logging/debugging purposes. | 168 // Returns a name for logging/debugging purposes. |
| 170 virtual const char* GetName() { return MajorName(MajorKey(), false); } | 169 virtual const char* GetName() { return MajorName(MajorKey(), false); } |
| 171 | 170 |
| 172 #ifdef DEBUG | 171 // Returns whether the code generated for this stub needs to be allocated as |
| 172 // a fixed (non-moveable) code object. |
| 173 virtual bool NeedsImmovableCode() { return false; } |
| 174 |
| 175 #ifdef DEBUG |
| 173 virtual void Print() { PrintF("%s\n", GetName()); } | 176 virtual void Print() { PrintF("%s\n", GetName()); } |
| 174 #endif | 177 #endif |
| 175 | 178 |
| 176 // Computes the key based on major and minor. | 179 // Computes the key based on major and minor. |
| 177 uint32_t GetKey() { | 180 uint32_t GetKey() { |
| 178 ASSERT(static_cast<int>(MajorKey()) < NUMBER_OF_IDS); | 181 ASSERT(static_cast<int>(MajorKey()) < NUMBER_OF_IDS); |
| 179 return MinorKeyBits::encode(MinorKey()) | | 182 return MinorKeyBits::encode(MinorKey()) | |
| 180 MajorKeyBits::encode(MajorKey()); | 183 MajorKeyBits::encode(MajorKey()); |
| 181 } | 184 } |
| 182 | 185 |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 virtual void Generate(MacroAssembler* masm); | 432 virtual void Generate(MacroAssembler* masm); |
| 430 | 433 |
| 431 private: | 434 private: |
| 432 virtual CodeStub::Major MajorKey() { return MathPow; } | 435 virtual CodeStub::Major MajorKey() { return MathPow; } |
| 433 virtual int MinorKey() { return 0; } | 436 virtual int MinorKey() { return 0; } |
| 434 | 437 |
| 435 const char* GetName() { return "MathPowStub"; } | 438 const char* GetName() { return "MathPowStub"; } |
| 436 }; | 439 }; |
| 437 | 440 |
| 438 | 441 |
| 439 class StringCharAtStub: public CodeStub { | |
| 440 public: | |
| 441 StringCharAtStub() {} | |
| 442 | |
| 443 private: | |
| 444 Major MajorKey() { return StringCharAt; } | |
| 445 int MinorKey() { return 0; } | |
| 446 | |
| 447 void Generate(MacroAssembler* masm); | |
| 448 }; | |
| 449 | |
| 450 | |
| 451 class ICCompareStub: public CodeStub { | 442 class ICCompareStub: public CodeStub { |
| 452 public: | 443 public: |
| 453 ICCompareStub(Token::Value op, CompareIC::State state) | 444 ICCompareStub(Token::Value op, CompareIC::State state) |
| 454 : op_(op), state_(state) { | 445 : op_(op), state_(state) { |
| 455 ASSERT(Token::IsCompareOp(op)); | 446 ASSERT(Token::IsCompareOp(op)); |
| 456 } | 447 } |
| 457 | 448 |
| 458 virtual void Generate(MacroAssembler* masm); | 449 virtual void Generate(MacroAssembler* masm); |
| 459 | 450 |
| 460 private: | 451 private: |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 void GenerateThrowUncatchable(MacroAssembler* masm, | 609 void GenerateThrowUncatchable(MacroAssembler* masm, |
| 619 UncatchableExceptionType type); | 610 UncatchableExceptionType type); |
| 620 | 611 |
| 621 // Number of pointers/values returned. | 612 // Number of pointers/values returned. |
| 622 const int result_size_; | 613 const int result_size_; |
| 623 SaveFPRegsMode save_doubles_; | 614 SaveFPRegsMode save_doubles_; |
| 624 | 615 |
| 625 Major MajorKey() { return CEntry; } | 616 Major MajorKey() { return CEntry; } |
| 626 int MinorKey(); | 617 int MinorKey(); |
| 627 | 618 |
| 619 bool NeedsImmovableCode(); |
| 620 |
| 628 const char* GetName() { return "CEntryStub"; } | 621 const char* GetName() { return "CEntryStub"; } |
| 629 }; | 622 }; |
| 630 | 623 |
| 631 | 624 |
| 632 class JSEntryStub : public CodeStub { | 625 class JSEntryStub : public CodeStub { |
| 633 public: | 626 public: |
| 634 JSEntryStub() { } | 627 JSEntryStub() { } |
| 635 | 628 |
| 636 void Generate(MacroAssembler* masm) { GenerateBody(masm, false); } | 629 void Generate(MacroAssembler* masm) { GenerateBody(masm, false); } |
| 637 | 630 |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 943 private: | 936 private: |
| 944 MacroAssembler* masm_; | 937 MacroAssembler* masm_; |
| 945 bool previous_allow_; | 938 bool previous_allow_; |
| 946 | 939 |
| 947 DISALLOW_COPY_AND_ASSIGN(AllowStubCallsScope); | 940 DISALLOW_COPY_AND_ASSIGN(AllowStubCallsScope); |
| 948 }; | 941 }; |
| 949 | 942 |
| 950 } } // namespace v8::internal | 943 } } // namespace v8::internal |
| 951 | 944 |
| 952 #endif // V8_CODE_STUBS_H_ | 945 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |