Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(560)

Side by Side Diff: src/builtins.h

Issue 25049003: Tag normal as handlers, and make code handler-specific. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Simplify code Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/builtins.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 Code::kNoExtraICState) \ 108 Code::kNoExtraICState) \
109 V(NotifyStubFailure, BUILTIN, UNINITIALIZED, \ 109 V(NotifyStubFailure, BUILTIN, UNINITIALIZED, \
110 Code::kNoExtraICState) \ 110 Code::kNoExtraICState) \
111 \ 111 \
112 V(LoadIC_Miss, BUILTIN, UNINITIALIZED, \ 112 V(LoadIC_Miss, BUILTIN, UNINITIALIZED, \
113 Code::kNoExtraICState) \ 113 Code::kNoExtraICState) \
114 V(KeyedLoadIC_Miss, BUILTIN, UNINITIALIZED, \ 114 V(KeyedLoadIC_Miss, BUILTIN, UNINITIALIZED, \
115 Code::kNoExtraICState) \ 115 Code::kNoExtraICState) \
116 V(KeyedLoadIC_MissForceGeneric, BUILTIN, UNINITIALIZED, \ 116 V(KeyedLoadIC_MissForceGeneric, BUILTIN, UNINITIALIZED, \
117 Code::kNoExtraICState) \ 117 Code::kNoExtraICState) \
118 V(KeyedLoadIC_Slow, HANDLER, MONOMORPHIC, \
119 Code::kNoExtraICState) \
120 V(StoreIC_Miss, BUILTIN, UNINITIALIZED, \ 118 V(StoreIC_Miss, BUILTIN, UNINITIALIZED, \
121 Code::kNoExtraICState) \ 119 Code::kNoExtraICState) \
122 V(StoreIC_Slow, BUILTIN, UNINITIALIZED, \ 120 V(StoreIC_Slow, BUILTIN, UNINITIALIZED, \
123 Code::kNoExtraICState) \ 121 Code::kNoExtraICState) \
124 V(KeyedStoreIC_Miss, BUILTIN, UNINITIALIZED, \ 122 V(KeyedStoreIC_Miss, BUILTIN, UNINITIALIZED, \
125 Code::kNoExtraICState) \ 123 Code::kNoExtraICState) \
126 V(KeyedStoreIC_MissForceGeneric, BUILTIN, UNINITIALIZED, \ 124 V(KeyedStoreIC_MissForceGeneric, BUILTIN, UNINITIALIZED, \
127 Code::kNoExtraICState) \ 125 Code::kNoExtraICState) \
128 V(KeyedStoreIC_Slow, BUILTIN, UNINITIALIZED, \ 126 V(KeyedStoreIC_Slow, BUILTIN, UNINITIALIZED, \
129 Code::kNoExtraICState) \ 127 Code::kNoExtraICState) \
130 V(LoadIC_Initialize, LOAD_IC, UNINITIALIZED, \ 128 V(LoadIC_Initialize, LOAD_IC, UNINITIALIZED, \
131 Code::kNoExtraICState) \ 129 Code::kNoExtraICState) \
132 V(LoadIC_PreMonomorphic, LOAD_IC, PREMONOMORPHIC, \ 130 V(LoadIC_PreMonomorphic, LOAD_IC, PREMONOMORPHIC, \
133 Code::kNoExtraICState) \ 131 Code::kNoExtraICState) \
134 V(LoadIC_Normal, LOAD_IC, MONOMORPHIC, \
135 Code::kNoExtraICState) \
136 V(LoadIC_Megamorphic, LOAD_IC, MEGAMORPHIC, \ 132 V(LoadIC_Megamorphic, LOAD_IC, MEGAMORPHIC, \
137 Code::kNoExtraICState) \ 133 Code::kNoExtraICState) \
138 V(LoadIC_Getter_ForDeopt, LOAD_IC, MONOMORPHIC, \ 134 V(LoadIC_Getter_ForDeopt, LOAD_IC, MONOMORPHIC, \
139 Code::kNoExtraICState) \ 135 Code::kNoExtraICState) \
140 V(LoadIC_Slow, HANDLER, MONOMORPHIC, \
141 Code::kNoExtraICState) \
142 \ 136 \
143 V(KeyedLoadIC_Initialize, KEYED_LOAD_IC, UNINITIALIZED, \ 137 V(KeyedLoadIC_Initialize, KEYED_LOAD_IC, UNINITIALIZED, \
144 Code::kNoExtraICState) \ 138 Code::kNoExtraICState) \
145 V(KeyedLoadIC_PreMonomorphic, KEYED_LOAD_IC, PREMONOMORPHIC, \ 139 V(KeyedLoadIC_PreMonomorphic, KEYED_LOAD_IC, PREMONOMORPHIC, \
146 Code::kNoExtraICState) \ 140 Code::kNoExtraICState) \
147 V(KeyedLoadIC_Generic, KEYED_LOAD_IC, GENERIC, \ 141 V(KeyedLoadIC_Generic, KEYED_LOAD_IC, GENERIC, \
148 Code::kNoExtraICState) \ 142 Code::kNoExtraICState) \
149 V(KeyedLoadIC_String, KEYED_LOAD_IC, MEGAMORPHIC, \ 143 V(KeyedLoadIC_String, KEYED_LOAD_IC, MEGAMORPHIC, \
150 Code::kNoExtraICState) \ 144 Code::kNoExtraICState) \
151 V(KeyedLoadIC_IndexedInterceptor, KEYED_LOAD_IC, MONOMORPHIC, \ 145 V(KeyedLoadIC_IndexedInterceptor, KEYED_LOAD_IC, MONOMORPHIC, \
152 Code::kNoExtraICState) \ 146 Code::kNoExtraICState) \
153 V(KeyedLoadIC_NonStrictArguments, KEYED_LOAD_IC, MONOMORPHIC, \ 147 V(KeyedLoadIC_NonStrictArguments, KEYED_LOAD_IC, MONOMORPHIC, \
154 Code::kNoExtraICState) \ 148 Code::kNoExtraICState) \
155 \ 149 \
156 V(StoreIC_Initialize, STORE_IC, UNINITIALIZED, \ 150 V(StoreIC_Initialize, STORE_IC, UNINITIALIZED, \
157 Code::kNoExtraICState) \ 151 Code::kNoExtraICState) \
158 V(StoreIC_PreMonomorphic, STORE_IC, PREMONOMORPHIC, \ 152 V(StoreIC_PreMonomorphic, STORE_IC, PREMONOMORPHIC, \
159 Code::kNoExtraICState) \ 153 Code::kNoExtraICState) \
160 V(StoreIC_Normal, STORE_IC, MONOMORPHIC, \
161 Code::kNoExtraICState) \
162 V(StoreIC_Megamorphic, STORE_IC, MEGAMORPHIC, \ 154 V(StoreIC_Megamorphic, STORE_IC, MEGAMORPHIC, \
163 Code::kNoExtraICState) \ 155 Code::kNoExtraICState) \
164 V(StoreIC_Generic, STORE_IC, GENERIC, \ 156 V(StoreIC_Generic, STORE_IC, GENERIC, \
165 Code::kNoExtraICState) \ 157 Code::kNoExtraICState) \
166 V(StoreIC_Generic_Strict, STORE_IC, GENERIC, \ 158 V(StoreIC_Generic_Strict, STORE_IC, GENERIC, \
167 kStrictMode) \ 159 kStrictMode) \
168 V(StoreIC_GlobalProxy, STORE_IC, GENERIC, \ 160 V(StoreIC_GlobalProxy, STORE_IC, GENERIC, \
169 Code::kNoExtraICState) \ 161 Code::kNoExtraICState) \
170 V(StoreIC_Initialize_Strict, STORE_IC, UNINITIALIZED, \ 162 V(StoreIC_Initialize_Strict, STORE_IC, UNINITIALIZED, \
171 kStrictMode) \ 163 kStrictMode) \
172 V(StoreIC_PreMonomorphic_Strict, STORE_IC, PREMONOMORPHIC, \ 164 V(StoreIC_PreMonomorphic_Strict, STORE_IC, PREMONOMORPHIC, \
173 kStrictMode) \ 165 kStrictMode) \
174 V(StoreIC_Normal_Strict, STORE_IC, MONOMORPHIC, \
175 kStrictMode) \
176 V(StoreIC_Megamorphic_Strict, STORE_IC, MEGAMORPHIC, \ 166 V(StoreIC_Megamorphic_Strict, STORE_IC, MEGAMORPHIC, \
177 kStrictMode) \ 167 kStrictMode) \
178 V(StoreIC_GlobalProxy_Strict, STORE_IC, GENERIC, \ 168 V(StoreIC_GlobalProxy_Strict, STORE_IC, GENERIC, \
179 kStrictMode) \ 169 kStrictMode) \
180 V(StoreIC_Setter_ForDeopt, STORE_IC, MONOMORPHIC, \ 170 V(StoreIC_Setter_ForDeopt, STORE_IC, MONOMORPHIC, \
181 kStrictMode) \ 171 kStrictMode) \
182 \ 172 \
183 V(KeyedStoreIC_Initialize, KEYED_STORE_IC, UNINITIALIZED, \ 173 V(KeyedStoreIC_Initialize, KEYED_STORE_IC, UNINITIALIZED, \
184 Code::kNoExtraICState) \ 174 Code::kNoExtraICState) \
185 V(KeyedStoreIC_PreMonomorphic, KEYED_STORE_IC, PREMONOMORPHIC, \ 175 V(KeyedStoreIC_PreMonomorphic, KEYED_STORE_IC, PREMONOMORPHIC, \
(...skipping 27 matching lines...) Expand all
213 V(OnStackReplacement, BUILTIN, UNINITIALIZED, \ 203 V(OnStackReplacement, BUILTIN, UNINITIALIZED, \
214 Code::kNoExtraICState) \ 204 Code::kNoExtraICState) \
215 V(InterruptCheck, BUILTIN, UNINITIALIZED, \ 205 V(InterruptCheck, BUILTIN, UNINITIALIZED, \
216 Code::kNoExtraICState) \ 206 Code::kNoExtraICState) \
217 V(OsrAfterStackCheck, BUILTIN, UNINITIALIZED, \ 207 V(OsrAfterStackCheck, BUILTIN, UNINITIALIZED, \
218 Code::kNoExtraICState) \ 208 Code::kNoExtraICState) \
219 V(StackCheck, BUILTIN, UNINITIALIZED, \ 209 V(StackCheck, BUILTIN, UNINITIALIZED, \
220 Code::kNoExtraICState) \ 210 Code::kNoExtraICState) \
221 CODE_AGE_LIST_WITH_ARG(DECLARE_CODE_AGE_BUILTIN, V) 211 CODE_AGE_LIST_WITH_ARG(DECLARE_CODE_AGE_BUILTIN, V)
222 212
213 // Define list of builtin handlers implemented in assembly.
214 #define BUILTIN_LIST_H(V) \
215 V(LoadIC_Slow, LOAD_IC, Code::kNoExtraICState) \
216 V(KeyedLoadIC_Slow, KEYED_LOAD_IC, Code::kNoExtraICState) \
217 V(LoadIC_Normal, LOAD_IC, Code::kNoExtraICState) \
218 V(StoreIC_Normal, STORE_IC, Code::kNoExtraICState) \
219 V(StoreIC_Normal_Strict, STORE_IC, kStrictMode)
220
223 #ifdef ENABLE_DEBUGGER_SUPPORT 221 #ifdef ENABLE_DEBUGGER_SUPPORT
224 // Define list of builtins used by the debugger implemented in assembly. 222 // Define list of builtins used by the debugger implemented in assembly.
225 #define BUILTIN_LIST_DEBUG_A(V) \ 223 #define BUILTIN_LIST_DEBUG_A(V) \
226 V(Return_DebugBreak, BUILTIN, DEBUG_STUB, \ 224 V(Return_DebugBreak, BUILTIN, DEBUG_STUB, \
227 DEBUG_BREAK) \ 225 DEBUG_BREAK) \
228 V(CallFunctionStub_DebugBreak, BUILTIN, DEBUG_STUB, \ 226 V(CallFunctionStub_DebugBreak, BUILTIN, DEBUG_STUB, \
229 DEBUG_BREAK) \ 227 DEBUG_BREAK) \
230 V(CallFunctionStub_Recording_DebugBreak, BUILTIN, DEBUG_STUB, \ 228 V(CallFunctionStub_Recording_DebugBreak, BUILTIN, DEBUG_STUB, \
231 DEBUG_BREAK) \ 229 DEBUG_BREAK) \
232 V(CallConstructStub_DebugBreak, BUILTIN, DEBUG_STUB, \ 230 V(CallConstructStub_DebugBreak, BUILTIN, DEBUG_STUB, \
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 298
301 // Garbage collection support. 299 // Garbage collection support.
302 void IterateBuiltins(ObjectVisitor* v); 300 void IterateBuiltins(ObjectVisitor* v);
303 301
304 // Disassembler support. 302 // Disassembler support.
305 const char* Lookup(byte* pc); 303 const char* Lookup(byte* pc);
306 304
307 enum Name { 305 enum Name {
308 #define DEF_ENUM_C(name, ignore) k##name, 306 #define DEF_ENUM_C(name, ignore) k##name,
309 #define DEF_ENUM_A(name, kind, state, extra) k##name, 307 #define DEF_ENUM_A(name, kind, state, extra) k##name,
308 #define DEF_ENUM_H(name, kind, extra) k##name,
310 BUILTIN_LIST_C(DEF_ENUM_C) 309 BUILTIN_LIST_C(DEF_ENUM_C)
311 BUILTIN_LIST_A(DEF_ENUM_A) 310 BUILTIN_LIST_A(DEF_ENUM_A)
311 BUILTIN_LIST_H(DEF_ENUM_H)
312 BUILTIN_LIST_DEBUG_A(DEF_ENUM_A) 312 BUILTIN_LIST_DEBUG_A(DEF_ENUM_A)
313 #undef DEF_ENUM_C 313 #undef DEF_ENUM_C
314 #undef DEF_ENUM_A 314 #undef DEF_ENUM_A
315 builtin_count 315 builtin_count
316 }; 316 };
317 317
318 enum CFunctionId { 318 enum CFunctionId {
319 #define DEF_ENUM_C(name, ignore) c_##name, 319 #define DEF_ENUM_C(name, ignore) c_##name,
320 BUILTIN_LIST_C(DEF_ENUM_C) 320 BUILTIN_LIST_C(DEF_ENUM_C)
321 #undef DEF_ENUM_C 321 #undef DEF_ENUM_C
322 cfunction_count 322 cfunction_count
323 }; 323 };
324 324
325 enum JavaScript { 325 enum JavaScript {
326 #define DEF_ENUM(name, ignore) name, 326 #define DEF_ENUM(name, ignore) name,
327 BUILTINS_LIST_JS(DEF_ENUM) 327 BUILTINS_LIST_JS(DEF_ENUM)
328 #undef DEF_ENUM 328 #undef DEF_ENUM
329 id_count 329 id_count
330 }; 330 };
331 331
332 #define DECLARE_BUILTIN_ACCESSOR_C(name, ignore) Handle<Code> name(); 332 #define DECLARE_BUILTIN_ACCESSOR_C(name, ignore) Handle<Code> name();
333 #define DECLARE_BUILTIN_ACCESSOR_A(name, kind, state, extra) \ 333 #define DECLARE_BUILTIN_ACCESSOR_A(name, kind, state, extra) \
334 Handle<Code> name(); 334 Handle<Code> name();
335 #define DECLARE_BUILTIN_ACCESSOR_H(name, kind, extra) Handle<Code> name();
335 BUILTIN_LIST_C(DECLARE_BUILTIN_ACCESSOR_C) 336 BUILTIN_LIST_C(DECLARE_BUILTIN_ACCESSOR_C)
336 BUILTIN_LIST_A(DECLARE_BUILTIN_ACCESSOR_A) 337 BUILTIN_LIST_A(DECLARE_BUILTIN_ACCESSOR_A)
338 BUILTIN_LIST_H(DECLARE_BUILTIN_ACCESSOR_H)
337 BUILTIN_LIST_DEBUG_A(DECLARE_BUILTIN_ACCESSOR_A) 339 BUILTIN_LIST_DEBUG_A(DECLARE_BUILTIN_ACCESSOR_A)
338 #undef DECLARE_BUILTIN_ACCESSOR_C 340 #undef DECLARE_BUILTIN_ACCESSOR_C
339 #undef DECLARE_BUILTIN_ACCESSOR_A 341 #undef DECLARE_BUILTIN_ACCESSOR_A
340 342
341 Code* builtin(Name name) { 343 Code* builtin(Name name) {
342 // Code::cast cannot be used here since we access builtins 344 // Code::cast cannot be used here since we access builtins
343 // during the marking phase of mark sweep. See IC::Clear. 345 // during the marking phase of mark sweep. See IC::Clear.
344 return reinterpret_cast<Code*>(builtins_[name]); 346 return reinterpret_cast<Code*>(builtins_[name]);
345 } 347 }
346 348
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 419
418 friend class BuiltinFunctionTable; 420 friend class BuiltinFunctionTable;
419 friend class Isolate; 421 friend class Isolate;
420 422
421 DISALLOW_COPY_AND_ASSIGN(Builtins); 423 DISALLOW_COPY_AND_ASSIGN(Builtins);
422 }; 424 };
423 425
424 } } // namespace v8::internal 426 } } // namespace v8::internal
425 427
426 #endif // V8_BUILTINS_H_ 428 #endif // V8_BUILTINS_H_
OLDNEW
« no previous file with comments | « no previous file | src/builtins.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698