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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 V(HandleApiCallAsFunction) | 45 V(HandleApiCallAsFunction) |
46 | 46 |
47 | 47 |
48 // Define list of builtins implemented in assembly. | 48 // Define list of builtins implemented in assembly. |
49 #define BUILTIN_LIST_A(V) \ | 49 #define BUILTIN_LIST_A(V) \ |
50 V(ArgumentsAdaptorTrampoline, BUILTIN, UNINITIALIZED) \ | 50 V(ArgumentsAdaptorTrampoline, BUILTIN, UNINITIALIZED) \ |
51 V(JSConstructCall, BUILTIN, UNINITIALIZED) \ | 51 V(JSConstructCall, BUILTIN, UNINITIALIZED) \ |
52 V(JSEntryTrampoline, BUILTIN, UNINITIALIZED) \ | 52 V(JSEntryTrampoline, BUILTIN, UNINITIALIZED) \ |
53 V(JSConstructEntryTrampoline, BUILTIN, UNINITIALIZED) \ | 53 V(JSConstructEntryTrampoline, BUILTIN, UNINITIALIZED) \ |
54 \ | 54 \ |
55 V(Return_DebugBreak, BUILTIN, DEBUG_BREAK) \ | |
56 V(Return_DebugBreakEntry, BUILTIN, DEBUG_BREAK) \ | |
57 V(ConstructCall_DebugBreak, BUILTIN, DEBUG_BREAK) \ | |
58 V(StubNoRegisters_DebugBreak, BUILTIN, DEBUG_BREAK) \ | |
59 \ | |
60 V(LoadIC_Miss, BUILTIN, UNINITIALIZED) \ | 55 V(LoadIC_Miss, BUILTIN, UNINITIALIZED) \ |
61 V(KeyedLoadIC_Miss, BUILTIN, UNINITIALIZED) \ | 56 V(KeyedLoadIC_Miss, BUILTIN, UNINITIALIZED) \ |
62 V(StoreIC_Miss, BUILTIN, UNINITIALIZED) \ | 57 V(StoreIC_Miss, BUILTIN, UNINITIALIZED) \ |
63 V(KeyedStoreIC_Miss, BUILTIN, UNINITIALIZED) \ | 58 V(KeyedStoreIC_Miss, BUILTIN, UNINITIALIZED) \ |
64 \ | 59 \ |
65 V(StoreIC_ExtendStorage, BUILTIN, UNINITIALIZED) \ | 60 V(StoreIC_ExtendStorage, BUILTIN, UNINITIALIZED) \ |
66 V(KeyedStoreIC_ExtendStorage, BUILTIN, UNINITIALIZED) \ | 61 V(KeyedStoreIC_ExtendStorage, BUILTIN, UNINITIALIZED) \ |
67 \ | 62 \ |
68 V(LoadIC_Initialize, LOAD_IC, UNINITIALIZED) \ | 63 V(LoadIC_Initialize, LOAD_IC, UNINITIALIZED) \ |
69 V(LoadIC_PreMonomorphic, LOAD_IC, PREMONOMORPHIC) \ | 64 V(LoadIC_PreMonomorphic, LOAD_IC, PREMONOMORPHIC) \ |
70 V(LoadIC_Normal, LOAD_IC, MONOMORPHIC) \ | 65 V(LoadIC_Normal, LOAD_IC, MONOMORPHIC) \ |
71 V(LoadIC_ArrayLength, LOAD_IC, MONOMORPHIC) \ | 66 V(LoadIC_ArrayLength, LOAD_IC, MONOMORPHIC) \ |
72 V(LoadIC_StringLength, LOAD_IC, MONOMORPHIC) \ | 67 V(LoadIC_StringLength, LOAD_IC, MONOMORPHIC) \ |
73 V(LoadIC_FunctionPrototype, LOAD_IC, MONOMORPHIC) \ | 68 V(LoadIC_FunctionPrototype, LOAD_IC, MONOMORPHIC) \ |
74 V(LoadIC_Megamorphic, LOAD_IC, MEGAMORPHIC) \ | 69 V(LoadIC_Megamorphic, LOAD_IC, MEGAMORPHIC) \ |
75 V(LoadIC_DebugBreak, LOAD_IC, DEBUG_BREAK) \ | |
76 \ | 70 \ |
77 V(KeyedLoadIC_Initialize, KEYED_LOAD_IC, UNINITIALIZED) \ | 71 V(KeyedLoadIC_Initialize, KEYED_LOAD_IC, UNINITIALIZED) \ |
78 V(KeyedLoadIC_PreMonomorphic, KEYED_LOAD_IC, PREMONOMORPHIC) \ | 72 V(KeyedLoadIC_PreMonomorphic, KEYED_LOAD_IC, PREMONOMORPHIC) \ |
79 V(KeyedLoadIC_Generic, KEYED_LOAD_IC, MEGAMORPHIC) \ | 73 V(KeyedLoadIC_Generic, KEYED_LOAD_IC, MEGAMORPHIC) \ |
80 V(KeyedLoadIC_DebugBreak, KEYED_LOAD_IC, DEBUG_BREAK) \ | |
81 \ | 74 \ |
82 V(StoreIC_Initialize, STORE_IC, UNINITIALIZED) \ | 75 V(StoreIC_Initialize, STORE_IC, UNINITIALIZED) \ |
83 V(StoreIC_Megamorphic, STORE_IC, MEGAMORPHIC) \ | 76 V(StoreIC_Megamorphic, STORE_IC, MEGAMORPHIC) \ |
84 V(StoreIC_DebugBreak, STORE_IC, DEBUG_BREAK) \ | |
85 \ | 77 \ |
86 V(KeyedStoreIC_Initialize, KEYED_STORE_IC, UNINITIALIZED) \ | 78 V(KeyedStoreIC_Initialize, KEYED_STORE_IC, UNINITIALIZED) \ |
87 V(KeyedStoreIC_Generic, KEYED_STORE_IC, MEGAMORPHIC) \ | 79 V(KeyedStoreIC_Generic, KEYED_STORE_IC, MEGAMORPHIC) \ |
88 V(KeyedStoreIC_DebugBreak, KEYED_STORE_IC, DEBUG_BREAK) \ | |
89 \ | 80 \ |
90 /* Uses KeyedLoadIC_Initialize; must be after in list. */ \ | 81 /* Uses KeyedLoadIC_Initialize; must be after in list. */ \ |
91 V(FunctionCall, BUILTIN, UNINITIALIZED) \ | 82 V(FunctionCall, BUILTIN, UNINITIALIZED) \ |
92 V(FunctionApply, BUILTIN, UNINITIALIZED) | 83 V(FunctionApply, BUILTIN, UNINITIALIZED) |
93 | 84 |
94 | 85 |
| 86 // Define list of builtins used by the debugger implemented in assembly. |
| 87 #define BUILTIN_LIST_DEBUG_A(V) \ |
| 88 V(Return_DebugBreak, BUILTIN, DEBUG_BREAK) \ |
| 89 V(Return_DebugBreakEntry, BUILTIN, DEBUG_BREAK) \ |
| 90 V(ConstructCall_DebugBreak, BUILTIN, DEBUG_BREAK) \ |
| 91 V(StubNoRegisters_DebugBreak, BUILTIN, DEBUG_BREAK) \ |
| 92 V(LoadIC_DebugBreak, LOAD_IC, DEBUG_BREAK) \ |
| 93 V(KeyedLoadIC_DebugBreak, KEYED_LOAD_IC, DEBUG_BREAK) \ |
| 94 V(StoreIC_DebugBreak, STORE_IC, DEBUG_BREAK) \ |
| 95 V(KeyedStoreIC_DebugBreak, KEYED_STORE_IC, DEBUG_BREAK) |
| 96 |
| 97 |
95 // Define list of builtins implemented in JavaScript. | 98 // Define list of builtins implemented in JavaScript. |
96 #define BUILTINS_LIST_JS(V) \ | 99 #define BUILTINS_LIST_JS(V) \ |
97 V(EQUALS, 1) \ | 100 V(EQUALS, 1) \ |
98 V(STRICT_EQUALS, 1) \ | 101 V(STRICT_EQUALS, 1) \ |
99 V(COMPARE, 2) \ | 102 V(COMPARE, 2) \ |
100 V(ADD, 1) \ | 103 V(ADD, 1) \ |
101 V(SUB, 1) \ | 104 V(SUB, 1) \ |
102 V(MUL, 1) \ | 105 V(MUL, 1) \ |
103 V(DIV, 1) \ | 106 V(DIV, 1) \ |
104 V(MOD, 1) \ | 107 V(MOD, 1) \ |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 static void IterateBuiltins(ObjectVisitor* v); | 142 static void IterateBuiltins(ObjectVisitor* v); |
140 | 143 |
141 // Disassembler support. | 144 // Disassembler support. |
142 static const char* Lookup(byte* pc); | 145 static const char* Lookup(byte* pc); |
143 | 146 |
144 enum Name { | 147 enum Name { |
145 #define DEF_ENUM_C(name) name, | 148 #define DEF_ENUM_C(name) name, |
146 #define DEF_ENUM_A(name, kind, state) name, | 149 #define DEF_ENUM_A(name, kind, state) name, |
147 BUILTIN_LIST_C(DEF_ENUM_C) | 150 BUILTIN_LIST_C(DEF_ENUM_C) |
148 BUILTIN_LIST_A(DEF_ENUM_A) | 151 BUILTIN_LIST_A(DEF_ENUM_A) |
| 152 BUILTIN_LIST_DEBUG_A(DEF_ENUM_A) |
149 #undef DEF_ENUM_C | 153 #undef DEF_ENUM_C |
150 #undef DEF_ENUM_A | 154 #undef DEF_ENUM_A |
151 builtin_count | 155 builtin_count |
152 }; | 156 }; |
153 | 157 |
154 enum CFunctionId { | 158 enum CFunctionId { |
155 #define DEF_ENUM_C(name) c_##name, | 159 #define DEF_ENUM_C(name) c_##name, |
156 BUILTIN_LIST_C(DEF_ENUM_C) | 160 BUILTIN_LIST_C(DEF_ENUM_C) |
157 #undef DEF_ENUM_C | 161 #undef DEF_ENUM_C |
158 cfunction_count | 162 cfunction_count |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 static void Generate_KeyedStoreIC_DebugBreak(MacroAssembler* masm); | 220 static void Generate_KeyedStoreIC_DebugBreak(MacroAssembler* masm); |
217 static void Generate_ConstructCall_DebugBreak(MacroAssembler* masm); | 221 static void Generate_ConstructCall_DebugBreak(MacroAssembler* masm); |
218 static void Generate_Return_DebugBreak(MacroAssembler* masm); | 222 static void Generate_Return_DebugBreak(MacroAssembler* masm); |
219 static void Generate_Return_DebugBreakEntry(MacroAssembler* masm); | 223 static void Generate_Return_DebugBreakEntry(MacroAssembler* masm); |
220 static void Generate_StubNoRegisters_DebugBreak(MacroAssembler* masm); | 224 static void Generate_StubNoRegisters_DebugBreak(MacroAssembler* masm); |
221 }; | 225 }; |
222 | 226 |
223 } } // namespace v8::internal | 227 } } // namespace v8::internal |
224 | 228 |
225 #endif // V8_BUILTINS_H_ | 229 #endif // V8_BUILTINS_H_ |
OLD | NEW |