OLD | NEW |
1 // Copyright 2010 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 |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 V(HandleApiCallAsFunction, NO_EXTRA_ARGUMENTS) \ | 60 V(HandleApiCallAsFunction, NO_EXTRA_ARGUMENTS) \ |
61 V(HandleApiCallAsConstructor, NO_EXTRA_ARGUMENTS) \ | 61 V(HandleApiCallAsConstructor, NO_EXTRA_ARGUMENTS) \ |
62 \ | 62 \ |
63 V(StrictArgumentsCallee, NO_EXTRA_ARGUMENTS) \ | 63 V(StrictArgumentsCallee, NO_EXTRA_ARGUMENTS) \ |
64 V(StrictArgumentsCaller, NO_EXTRA_ARGUMENTS) \ | 64 V(StrictArgumentsCaller, NO_EXTRA_ARGUMENTS) \ |
65 V(StrictFunctionCaller, NO_EXTRA_ARGUMENTS) \ | 65 V(StrictFunctionCaller, NO_EXTRA_ARGUMENTS) \ |
66 V(StrictFunctionArguments, NO_EXTRA_ARGUMENTS) | 66 V(StrictFunctionArguments, NO_EXTRA_ARGUMENTS) |
67 | 67 |
68 | 68 |
69 // Define list of builtins implemented in assembly. | 69 // Define list of builtins implemented in assembly. |
70 #define BUILTIN_LIST_A(V) \ | 70 #define BUILTIN_LIST_A(V) \ |
71 V(ArgumentsAdaptorTrampoline, BUILTIN, UNINITIALIZED, \ | 71 V(ArgumentsAdaptorTrampoline, BUILTIN, UNINITIALIZED, \ |
72 Code::kNoExtraICState) \ | 72 Code::kNoExtraICState) \ |
73 V(JSConstructCall, BUILTIN, UNINITIALIZED, \ | 73 V(JSConstructCall, BUILTIN, UNINITIALIZED, \ |
74 Code::kNoExtraICState) \ | 74 Code::kNoExtraICState) \ |
75 V(JSConstructStubCountdown, BUILTIN, UNINITIALIZED, \ | 75 V(JSConstructStubCountdown, BUILTIN, UNINITIALIZED, \ |
76 Code::kNoExtraICState) \ | 76 Code::kNoExtraICState) \ |
77 V(JSConstructStubGeneric, BUILTIN, UNINITIALIZED, \ | 77 V(JSConstructStubGeneric, BUILTIN, UNINITIALIZED, \ |
78 Code::kNoExtraICState) \ | 78 Code::kNoExtraICState) \ |
79 V(JSConstructStubApi, BUILTIN, UNINITIALIZED, \ | 79 V(JSConstructStubApi, BUILTIN, UNINITIALIZED, \ |
80 Code::kNoExtraICState) \ | 80 Code::kNoExtraICState) \ |
81 V(JSEntryTrampoline, BUILTIN, UNINITIALIZED, \ | 81 V(JSEntryTrampoline, BUILTIN, UNINITIALIZED, \ |
82 Code::kNoExtraICState) \ | 82 Code::kNoExtraICState) \ |
83 V(JSConstructEntryTrampoline, BUILTIN, UNINITIALIZED, \ | 83 V(JSConstructEntryTrampoline, BUILTIN, UNINITIALIZED, \ |
84 Code::kNoExtraICState) \ | 84 Code::kNoExtraICState) \ |
85 V(LazyCompile, BUILTIN, UNINITIALIZED, \ | 85 V(LazyCompile, BUILTIN, UNINITIALIZED, \ |
86 Code::kNoExtraICState) \ | 86 Code::kNoExtraICState) \ |
87 V(LazyRecompile, BUILTIN, UNINITIALIZED, \ | 87 V(LazyRecompile, BUILTIN, UNINITIALIZED, \ |
88 Code::kNoExtraICState) \ | 88 Code::kNoExtraICState) \ |
89 V(NotifyDeoptimized, BUILTIN, UNINITIALIZED, \ | 89 V(NotifyDeoptimized, BUILTIN, UNINITIALIZED, \ |
90 Code::kNoExtraICState) \ | 90 Code::kNoExtraICState) \ |
91 V(NotifyLazyDeoptimized, BUILTIN, UNINITIALIZED, \ | 91 V(NotifyLazyDeoptimized, BUILTIN, UNINITIALIZED, \ |
92 Code::kNoExtraICState) \ | 92 Code::kNoExtraICState) \ |
93 V(NotifyOSR, BUILTIN, UNINITIALIZED, \ | 93 V(NotifyOSR, BUILTIN, UNINITIALIZED, \ |
94 Code::kNoExtraICState) \ | 94 Code::kNoExtraICState) \ |
95 \ | 95 \ |
96 V(LoadIC_Miss, BUILTIN, UNINITIALIZED, \ | 96 V(LoadIC_Miss, BUILTIN, UNINITIALIZED, \ |
97 Code::kNoExtraICState) \ | 97 Code::kNoExtraICState) \ |
98 V(KeyedLoadIC_Miss, BUILTIN, UNINITIALIZED, \ | 98 V(KeyedLoadIC_Miss, BUILTIN, UNINITIALIZED, \ |
99 Code::kNoExtraICState) \ | 99 Code::kNoExtraICState) \ |
100 V(StoreIC_Miss, BUILTIN, UNINITIALIZED, \ | 100 V(KeyedLoadIC_MissForceGeneric, BUILTIN, UNINITIALIZED, \ |
101 Code::kNoExtraICState) \ | 101 Code::kNoExtraICState) \ |
102 V(KeyedStoreIC_Miss, BUILTIN, UNINITIALIZED, \ | 102 V(KeyedLoadIC_Slow, BUILTIN, UNINITIALIZED, \ |
103 Code::kNoExtraICState) \ | 103 Code::kNoExtraICState) \ |
104 \ | 104 V(StoreIC_Miss, BUILTIN, UNINITIALIZED, \ |
105 V(LoadIC_Initialize, LOAD_IC, UNINITIALIZED, \ | 105 Code::kNoExtraICState) \ |
106 Code::kNoExtraICState) \ | 106 V(KeyedStoreIC_Miss, BUILTIN, UNINITIALIZED, \ |
107 V(LoadIC_PreMonomorphic, LOAD_IC, PREMONOMORPHIC, \ | 107 Code::kNoExtraICState) \ |
108 Code::kNoExtraICState) \ | 108 V(KeyedStoreIC_MissForceGeneric, BUILTIN, UNINITIALIZED, \ |
109 V(LoadIC_Normal, LOAD_IC, MONOMORPHIC, \ | 109 Code::kNoExtraICState) \ |
110 Code::kNoExtraICState) \ | 110 V(KeyedStoreIC_Slow, BUILTIN, UNINITIALIZED, \ |
111 V(LoadIC_ArrayLength, LOAD_IC, MONOMORPHIC, \ | 111 Code::kNoExtraICState) \ |
112 Code::kNoExtraICState) \ | 112 V(LoadIC_Initialize, LOAD_IC, UNINITIALIZED, \ |
113 V(LoadIC_StringLength, LOAD_IC, MONOMORPHIC, \ | 113 Code::kNoExtraICState) \ |
114 Code::kNoExtraICState) \ | 114 V(LoadIC_PreMonomorphic, LOAD_IC, PREMONOMORPHIC, \ |
115 V(LoadIC_StringWrapperLength, LOAD_IC, MONOMORPHIC, \ | 115 Code::kNoExtraICState) \ |
116 Code::kNoExtraICState) \ | 116 V(LoadIC_Normal, LOAD_IC, MONOMORPHIC, \ |
117 V(LoadIC_FunctionPrototype, LOAD_IC, MONOMORPHIC, \ | 117 Code::kNoExtraICState) \ |
118 Code::kNoExtraICState) \ | 118 V(LoadIC_ArrayLength, LOAD_IC, MONOMORPHIC, \ |
119 V(LoadIC_Megamorphic, LOAD_IC, MEGAMORPHIC, \ | 119 Code::kNoExtraICState) \ |
120 Code::kNoExtraICState) \ | 120 V(LoadIC_StringLength, LOAD_IC, MONOMORPHIC, \ |
121 \ | 121 Code::kNoExtraICState) \ |
122 V(KeyedLoadIC_Initialize, KEYED_LOAD_IC, UNINITIALIZED, \ | 122 V(LoadIC_StringWrapperLength, LOAD_IC, MONOMORPHIC, \ |
123 Code::kNoExtraICState) \ | 123 Code::kNoExtraICState) \ |
124 V(KeyedLoadIC_PreMonomorphic, KEYED_LOAD_IC, PREMONOMORPHIC, \ | 124 V(LoadIC_FunctionPrototype, LOAD_IC, MONOMORPHIC, \ |
125 Code::kNoExtraICState) \ | 125 Code::kNoExtraICState) \ |
126 V(KeyedLoadIC_Generic, KEYED_LOAD_IC, MEGAMORPHIC, \ | 126 V(LoadIC_Megamorphic, LOAD_IC, MEGAMORPHIC, \ |
127 Code::kNoExtraICState) \ | 127 Code::kNoExtraICState) \ |
128 V(KeyedLoadIC_String, KEYED_LOAD_IC, MEGAMORPHIC, \ | 128 \ |
129 Code::kNoExtraICState) \ | 129 V(KeyedLoadIC_Initialize, KEYED_LOAD_IC, UNINITIALIZED, \ |
130 V(KeyedLoadIC_IndexedInterceptor, KEYED_LOAD_IC, MEGAMORPHIC, \ | 130 Code::kNoExtraICState) \ |
131 Code::kNoExtraICState) \ | 131 V(KeyedLoadIC_PreMonomorphic, KEYED_LOAD_IC, PREMONOMORPHIC, \ |
132 \ | 132 Code::kNoExtraICState) \ |
133 V(StoreIC_Initialize, STORE_IC, UNINITIALIZED, \ | 133 V(KeyedLoadIC_Generic, KEYED_LOAD_IC, MEGAMORPHIC, \ |
134 Code::kNoExtraICState) \ | 134 Code::kNoExtraICState) \ |
135 V(StoreIC_ArrayLength, STORE_IC, MONOMORPHIC, \ | 135 V(KeyedLoadIC_String, KEYED_LOAD_IC, MEGAMORPHIC, \ |
136 Code::kNoExtraICState) \ | 136 Code::kNoExtraICState) \ |
137 V(StoreIC_Normal, STORE_IC, MONOMORPHIC, \ | 137 V(KeyedLoadIC_IndexedInterceptor, KEYED_LOAD_IC, MEGAMORPHIC, \ |
138 Code::kNoExtraICState) \ | 138 Code::kNoExtraICState) \ |
139 V(StoreIC_Megamorphic, STORE_IC, MEGAMORPHIC, \ | 139 \ |
140 Code::kNoExtraICState) \ | 140 V(StoreIC_Initialize, STORE_IC, UNINITIALIZED, \ |
141 V(StoreIC_GlobalProxy, STORE_IC, MEGAMORPHIC, \ | 141 Code::kNoExtraICState) \ |
142 Code::kNoExtraICState) \ | 142 V(StoreIC_ArrayLength, STORE_IC, MONOMORPHIC, \ |
143 V(StoreIC_Initialize_Strict, STORE_IC, UNINITIALIZED, \ | 143 Code::kNoExtraICState) \ |
144 kStrictMode) \ | 144 V(StoreIC_Normal, STORE_IC, MONOMORPHIC, \ |
145 V(StoreIC_ArrayLength_Strict, STORE_IC, MONOMORPHIC, \ | 145 Code::kNoExtraICState) \ |
146 kStrictMode) \ | 146 V(StoreIC_Megamorphic, STORE_IC, MEGAMORPHIC, \ |
147 V(StoreIC_Normal_Strict, STORE_IC, MONOMORPHIC, \ | 147 Code::kNoExtraICState) \ |
148 kStrictMode) \ | 148 V(StoreIC_GlobalProxy, STORE_IC, MEGAMORPHIC, \ |
149 V(StoreIC_Megamorphic_Strict, STORE_IC, MEGAMORPHIC, \ | 149 Code::kNoExtraICState) \ |
150 kStrictMode) \ | 150 V(StoreIC_Initialize_Strict, STORE_IC, UNINITIALIZED, \ |
151 V(StoreIC_GlobalProxy_Strict, STORE_IC, MEGAMORPHIC, \ | 151 kStrictMode) \ |
152 kStrictMode) \ | 152 V(StoreIC_ArrayLength_Strict, STORE_IC, MONOMORPHIC, \ |
153 \ | 153 kStrictMode) \ |
154 V(KeyedStoreIC_Initialize, KEYED_STORE_IC, UNINITIALIZED, \ | 154 V(StoreIC_Normal_Strict, STORE_IC, MONOMORPHIC, \ |
155 Code::kNoExtraICState) \ | 155 kStrictMode) \ |
156 V(KeyedStoreIC_Generic, KEYED_STORE_IC, MEGAMORPHIC, \ | 156 V(StoreIC_Megamorphic_Strict, STORE_IC, MEGAMORPHIC, \ |
157 Code::kNoExtraICState) \ | 157 kStrictMode) \ |
158 \ | 158 V(StoreIC_GlobalProxy_Strict, STORE_IC, MEGAMORPHIC, \ |
159 V(KeyedStoreIC_Initialize_Strict, KEYED_STORE_IC, UNINITIALIZED, \ | 159 kStrictMode) \ |
160 kStrictMode) \ | 160 \ |
161 V(KeyedStoreIC_Generic_Strict, KEYED_STORE_IC, MEGAMORPHIC, \ | 161 V(KeyedStoreIC_Initialize, KEYED_STORE_IC, UNINITIALIZED, \ |
162 kStrictMode) \ | 162 Code::kNoExtraICState) \ |
163 \ | 163 V(KeyedStoreIC_Generic, KEYED_STORE_IC, MEGAMORPHIC, \ |
164 /* Uses KeyedLoadIC_Initialize; must be after in list. */ \ | 164 Code::kNoExtraICState) \ |
165 V(FunctionCall, BUILTIN, UNINITIALIZED, \ | 165 \ |
166 Code::kNoExtraICState) \ | 166 V(KeyedStoreIC_Initialize_Strict, KEYED_STORE_IC, UNINITIALIZED, \ |
167 V(FunctionApply, BUILTIN, UNINITIALIZED, \ | 167 kStrictMode) \ |
168 Code::kNoExtraICState) \ | 168 V(KeyedStoreIC_Generic_Strict, KEYED_STORE_IC, MEGAMORPHIC, \ |
169 \ | 169 kStrictMode) \ |
170 V(ArrayCode, BUILTIN, UNINITIALIZED, \ | 170 \ |
171 Code::kNoExtraICState) \ | 171 /* Uses KeyedLoadIC_Initialize; must be after in list. */ \ |
172 V(ArrayConstructCode, BUILTIN, UNINITIALIZED, \ | 172 V(FunctionCall, BUILTIN, UNINITIALIZED, \ |
173 Code::kNoExtraICState) \ | 173 Code::kNoExtraICState) \ |
174 \ | 174 V(FunctionApply, BUILTIN, UNINITIALIZED, \ |
175 V(StringConstructCode, BUILTIN, UNINITIALIZED, \ | 175 Code::kNoExtraICState) \ |
176 Code::kNoExtraICState) \ | 176 \ |
177 \ | 177 V(ArrayCode, BUILTIN, UNINITIALIZED, \ |
178 V(OnStackReplacement, BUILTIN, UNINITIALIZED, \ | 178 Code::kNoExtraICState) \ |
| 179 V(ArrayConstructCode, BUILTIN, UNINITIALIZED, \ |
| 180 Code::kNoExtraICState) \ |
| 181 \ |
| 182 V(StringConstructCode, BUILTIN, UNINITIALIZED, \ |
| 183 Code::kNoExtraICState) \ |
| 184 \ |
| 185 V(OnStackReplacement, BUILTIN, UNINITIALIZED, \ |
179 Code::kNoExtraICState) | 186 Code::kNoExtraICState) |
180 | 187 |
181 | 188 |
182 #ifdef ENABLE_DEBUGGER_SUPPORT | 189 #ifdef ENABLE_DEBUGGER_SUPPORT |
183 // Define list of builtins used by the debugger implemented in assembly. | 190 // Define list of builtins used by the debugger implemented in assembly. |
184 #define BUILTIN_LIST_DEBUG_A(V) \ | 191 #define BUILTIN_LIST_DEBUG_A(V) \ |
185 V(Return_DebugBreak, BUILTIN, DEBUG_BREAK, \ | 192 V(Return_DebugBreak, BUILTIN, DEBUG_BREAK, \ |
186 Code::kNoExtraICState) \ | 193 Code::kNoExtraICState) \ |
187 V(ConstructCall_DebugBreak, BUILTIN, DEBUG_BREAK, \ | 194 V(ConstructCall_DebugBreak, BUILTIN, DEBUG_BREAK, \ |
188 Code::kNoExtraICState) \ | 195 Code::kNoExtraICState) \ |
(...skipping 11 matching lines...) Expand all Loading... |
200 Code::kNoExtraICState) \ | 207 Code::kNoExtraICState) \ |
201 V(PlainReturn_LiveEdit, BUILTIN, DEBUG_BREAK, \ | 208 V(PlainReturn_LiveEdit, BUILTIN, DEBUG_BREAK, \ |
202 Code::kNoExtraICState) \ | 209 Code::kNoExtraICState) \ |
203 V(FrameDropper_LiveEdit, BUILTIN, DEBUG_BREAK, \ | 210 V(FrameDropper_LiveEdit, BUILTIN, DEBUG_BREAK, \ |
204 Code::kNoExtraICState) | 211 Code::kNoExtraICState) |
205 #else | 212 #else |
206 #define BUILTIN_LIST_DEBUG_A(V) | 213 #define BUILTIN_LIST_DEBUG_A(V) |
207 #endif | 214 #endif |
208 | 215 |
209 // Define list of builtins implemented in JavaScript. | 216 // Define list of builtins implemented in JavaScript. |
210 #define BUILTINS_LIST_JS(V) \ | 217 #define BUILTINS_LIST_JS(V) \ |
211 V(EQUALS, 1) \ | 218 V(EQUALS, 1) \ |
212 V(STRICT_EQUALS, 1) \ | 219 V(STRICT_EQUALS, 1) \ |
213 V(COMPARE, 2) \ | 220 V(COMPARE, 2) \ |
214 V(ADD, 1) \ | 221 V(ADD, 1) \ |
215 V(SUB, 1) \ | 222 V(SUB, 1) \ |
216 V(MUL, 1) \ | 223 V(MUL, 1) \ |
217 V(DIV, 1) \ | 224 V(DIV, 1) \ |
218 V(MOD, 1) \ | 225 V(MOD, 1) \ |
219 V(BIT_OR, 1) \ | 226 V(BIT_OR, 1) \ |
220 V(BIT_AND, 1) \ | 227 V(BIT_AND, 1) \ |
221 V(BIT_XOR, 1) \ | 228 V(BIT_XOR, 1) \ |
222 V(UNARY_MINUS, 0) \ | 229 V(UNARY_MINUS, 0) \ |
223 V(BIT_NOT, 0) \ | 230 V(BIT_NOT, 0) \ |
224 V(SHL, 1) \ | 231 V(SHL, 1) \ |
225 V(SAR, 1) \ | 232 V(SAR, 1) \ |
226 V(SHR, 1) \ | 233 V(SHR, 1) \ |
227 V(DELETE, 2) \ | 234 V(DELETE, 2) \ |
228 V(IN, 1) \ | 235 V(IN, 1) \ |
229 V(INSTANCE_OF, 1) \ | 236 V(INSTANCE_OF, 1) \ |
230 V(GET_KEYS, 0) \ | 237 V(GET_KEYS, 0) \ |
231 V(FILTER_KEY, 1) \ | 238 V(FILTER_KEY, 1) \ |
232 V(CALL_NON_FUNCTION, 0) \ | 239 V(CALL_NON_FUNCTION, 0) \ |
233 V(CALL_NON_FUNCTION_AS_CONSTRUCTOR, 0) \ | 240 V(CALL_NON_FUNCTION_AS_CONSTRUCTOR, 0) \ |
234 V(TO_OBJECT, 0) \ | 241 V(TO_OBJECT, 0) \ |
235 V(TO_NUMBER, 0) \ | 242 V(TO_NUMBER, 0) \ |
236 V(TO_STRING, 0) \ | 243 V(TO_STRING, 0) \ |
237 V(STRING_ADD_LEFT, 1) \ | 244 V(STRING_ADD_LEFT, 1) \ |
238 V(STRING_ADD_RIGHT, 1) \ | 245 V(STRING_ADD_RIGHT, 1) \ |
239 V(APPLY_PREPARE, 1) \ | 246 V(APPLY_PREPARE, 1) \ |
240 V(APPLY_OVERFLOW, 1) | 247 V(APPLY_OVERFLOW, 1) |
241 | 248 |
242 | 249 |
243 class BuiltinFunctionTable; | 250 class BuiltinFunctionTable; |
244 class ObjectVisitor; | 251 class ObjectVisitor; |
245 | 252 |
246 | 253 |
247 class Builtins { | 254 class Builtins { |
248 public: | 255 public: |
249 ~Builtins(); | 256 ~Builtins(); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 | 366 |
360 friend class BuiltinFunctionTable; | 367 friend class BuiltinFunctionTable; |
361 friend class Isolate; | 368 friend class Isolate; |
362 | 369 |
363 DISALLOW_COPY_AND_ASSIGN(Builtins); | 370 DISALLOW_COPY_AND_ASSIGN(Builtins); |
364 }; | 371 }; |
365 | 372 |
366 } } // namespace v8::internal | 373 } } // namespace v8::internal |
367 | 374 |
368 #endif // V8_BUILTINS_H_ | 375 #endif // V8_BUILTINS_H_ |
OLD | NEW |