| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 13 matching lines...) Expand all Loading... |
| 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 #ifndef V8_CODE_STUBS_H_ | 28 #ifndef V8_CODE_STUBS_H_ |
| 29 #define V8_CODE_STUBS_H_ | 29 #define V8_CODE_STUBS_H_ |
| 30 | 30 |
| 31 namespace v8 { | 31 namespace v8 { |
| 32 namespace internal { | 32 namespace internal { |
| 33 | 33 |
| 34 // List of code stubs used on all platforms. The order in this list is important |
| 35 // as only the stubs up to and including RecordWrite allows nested stub calls. |
| 36 #define CODE_STUB_LIST_ALL(V) \ |
| 37 V(CallFunction) \ |
| 38 V(GenericBinaryOp) \ |
| 39 V(SmiOp) \ |
| 40 V(Compare) \ |
| 41 V(RecordWrite) \ |
| 42 V(ConvertToDouble) \ |
| 43 V(WriteInt32ToHeapNumber) \ |
| 44 V(StackCheck) \ |
| 45 V(UnarySub) \ |
| 46 V(RevertToNumber) \ |
| 47 V(ToBoolean) \ |
| 48 V(Instanceof) \ |
| 49 V(CounterOp) \ |
| 50 V(ArgumentsAccess) \ |
| 51 V(Runtime) \ |
| 52 V(CEntry) \ |
| 53 V(JSEntry) |
| 54 |
| 55 // List of code stubs only used on ARM platforms. |
| 56 #ifdef V8_TARGET_ARCH_ARM |
| 57 #define CODE_STUB_LIST_ARM(V) \ |
| 58 V(GetProperty) \ |
| 59 V(SetProperty) \ |
| 60 V(InvokeBuiltin) \ |
| 61 V(RegExpCEntry) |
| 62 #else |
| 63 #define CODE_STUB_LIST_ARM(V) |
| 64 #endif |
| 65 |
| 66 // Combined list of code stubs. |
| 67 #define CODE_STUB_LIST(V) \ |
| 68 CODE_STUB_LIST_ALL(V) \ |
| 69 CODE_STUB_LIST_ARM(V) |
| 34 | 70 |
| 35 // Stub is base classes of all stubs. | 71 // Stub is base classes of all stubs. |
| 36 class CodeStub BASE_EMBEDDED { | 72 class CodeStub BASE_EMBEDDED { |
| 37 public: | 73 public: |
| 38 enum Major { | 74 enum Major { |
| 39 CallFunction, | 75 #define DEF_ENUM(name) name, |
| 40 GenericBinaryOp, | 76 CODE_STUB_LIST(DEF_ENUM) |
| 41 SmiOp, | 77 #undef DEF_ENUM |
| 42 Compare, | |
| 43 RecordWrite, // Last stub that allows stub calls inside. | |
| 44 ConvertToDouble, | |
| 45 WriteInt32ToHeapNumber, | |
| 46 StackCheck, | |
| 47 UnarySub, | |
| 48 RevertToNumber, | |
| 49 ToBoolean, | |
| 50 Instanceof, | |
| 51 CounterOp, | |
| 52 ArgumentsAccess, | |
| 53 Runtime, | |
| 54 CEntry, | |
| 55 JSEntry, | |
| 56 GetProperty, // ARM only | |
| 57 SetProperty, // ARM only | |
| 58 InvokeBuiltin, // ARM only | |
| 59 RegExpCEntry, // ARM only | |
| 60 NUMBER_OF_IDS | 78 NUMBER_OF_IDS |
| 61 }; | 79 }; |
| 62 | 80 |
| 63 // Retrieve the code for the stub. Generate the code if needed. | 81 // Retrieve the code for the stub. Generate the code if needed. |
| 64 Handle<Code> GetCode(); | 82 Handle<Code> GetCode(); |
| 65 | 83 |
| 66 static Major MajorKeyFromKey(uint32_t key) { | 84 static Major MajorKeyFromKey(uint32_t key) { |
| 67 return static_cast<Major>(MajorKeyBits::decode(key)); | 85 return static_cast<Major>(MajorKeyBits::decode(key)); |
| 68 }; | 86 }; |
| 69 static int MinorKeyFromKey(uint32_t key) { | 87 static int MinorKeyFromKey(uint32_t key) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 125 |
| 108 class MajorKeyBits: public BitField<uint32_t, 0, kMajorBits> {}; | 126 class MajorKeyBits: public BitField<uint32_t, 0, kMajorBits> {}; |
| 109 class MinorKeyBits: public BitField<uint32_t, kMajorBits, kMinorBits> {}; | 127 class MinorKeyBits: public BitField<uint32_t, kMajorBits, kMinorBits> {}; |
| 110 | 128 |
| 111 friend class BreakPointIterator; | 129 friend class BreakPointIterator; |
| 112 }; | 130 }; |
| 113 | 131 |
| 114 } } // namespace v8::internal | 132 } } // namespace v8::internal |
| 115 | 133 |
| 116 #endif // V8_CODE_STUBS_H_ | 134 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |