| 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 V(StackCheck, BUILTIN, UNINITIALIZED, \ | 209 V(StackCheck, BUILTIN, UNINITIALIZED, \ |
| 210 Code::kNoExtraICState) \ | 210 Code::kNoExtraICState) \ |
| 211 \ | 211 \ |
| 212 V(MarkCodeAsExecutedOnce, BUILTIN, UNINITIALIZED, \ | 212 V(MarkCodeAsExecutedOnce, BUILTIN, UNINITIALIZED, \ |
| 213 Code::kNoExtraICState) \ | 213 Code::kNoExtraICState) \ |
| 214 V(MarkCodeAsExecutedTwice, BUILTIN, UNINITIALIZED, \ | 214 V(MarkCodeAsExecutedTwice, BUILTIN, UNINITIALIZED, \ |
| 215 Code::kNoExtraICState) \ | 215 Code::kNoExtraICState) \ |
| 216 CODE_AGE_LIST_WITH_ARG(DECLARE_CODE_AGE_BUILTIN, V) | 216 CODE_AGE_LIST_WITH_ARG(DECLARE_CODE_AGE_BUILTIN, V) |
| 217 | 217 |
| 218 // Define list of builtin handlers implemented in assembly. | 218 // Define list of builtin handlers implemented in assembly. |
| 219 #define BUILTIN_LIST_H(V) \ | 219 #define BUILTIN_LIST_H(V) \ |
| 220 V(LoadIC_Slow, LOAD_IC, Code::kNoExtraICState) \ | 220 V(LoadIC_Slow, LOAD_IC) \ |
| 221 V(KeyedLoadIC_Slow, KEYED_LOAD_IC, Code::kNoExtraICState) \ | 221 V(KeyedLoadIC_Slow, KEYED_LOAD_IC) \ |
| 222 V(StoreIC_Slow, STORE_IC, Code::kNoExtraICState) \ | 222 V(StoreIC_Slow, STORE_IC) \ |
| 223 V(StoreIC_Slow_Strict, STORE_IC, kStrictMode) \ | 223 V(KeyedStoreIC_Slow, KEYED_STORE_IC) \ |
| 224 V(KeyedStoreIC_Slow, KEYED_STORE_IC, Code::kNoExtraICState)\ | 224 V(LoadIC_Normal, LOAD_IC) \ |
| 225 V(KeyedStoreIC_Slow_Strict, KEYED_STORE_IC, kStrictMode) \ | 225 V(StoreIC_Normal, STORE_IC) |
| 226 V(LoadIC_Normal, LOAD_IC, Code::kNoExtraICState) \ | |
| 227 V(StoreIC_Normal, STORE_IC, Code::kNoExtraICState) \ | |
| 228 V(StoreIC_Normal_Strict, STORE_IC, kStrictMode) | |
| 229 | 226 |
| 230 #ifdef ENABLE_DEBUGGER_SUPPORT | 227 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 231 // Define list of builtins used by the debugger implemented in assembly. | 228 // Define list of builtins used by the debugger implemented in assembly. |
| 232 #define BUILTIN_LIST_DEBUG_A(V) \ | 229 #define BUILTIN_LIST_DEBUG_A(V) \ |
| 233 V(Return_DebugBreak, BUILTIN, DEBUG_STUB, \ | 230 V(Return_DebugBreak, BUILTIN, DEBUG_STUB, \ |
| 234 DEBUG_BREAK) \ | 231 DEBUG_BREAK) \ |
| 235 V(CallFunctionStub_DebugBreak, BUILTIN, DEBUG_STUB, \ | 232 V(CallFunctionStub_DebugBreak, BUILTIN, DEBUG_STUB, \ |
| 236 DEBUG_BREAK) \ | 233 DEBUG_BREAK) \ |
| 237 V(CallFunctionStub_Recording_DebugBreak, BUILTIN, DEBUG_STUB, \ | 234 V(CallFunctionStub_Recording_DebugBreak, BUILTIN, DEBUG_STUB, \ |
| 238 DEBUG_BREAK) \ | 235 DEBUG_BREAK) \ |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 | 304 |
| 308 // Garbage collection support. | 305 // Garbage collection support. |
| 309 void IterateBuiltins(ObjectVisitor* v); | 306 void IterateBuiltins(ObjectVisitor* v); |
| 310 | 307 |
| 311 // Disassembler support. | 308 // Disassembler support. |
| 312 const char* Lookup(byte* pc); | 309 const char* Lookup(byte* pc); |
| 313 | 310 |
| 314 enum Name { | 311 enum Name { |
| 315 #define DEF_ENUM_C(name, ignore) k##name, | 312 #define DEF_ENUM_C(name, ignore) k##name, |
| 316 #define DEF_ENUM_A(name, kind, state, extra) k##name, | 313 #define DEF_ENUM_A(name, kind, state, extra) k##name, |
| 317 #define DEF_ENUM_H(name, kind, extra) k##name, | 314 #define DEF_ENUM_H(name, kind) k##name, |
| 318 BUILTIN_LIST_C(DEF_ENUM_C) | 315 BUILTIN_LIST_C(DEF_ENUM_C) |
| 319 BUILTIN_LIST_A(DEF_ENUM_A) | 316 BUILTIN_LIST_A(DEF_ENUM_A) |
| 320 BUILTIN_LIST_H(DEF_ENUM_H) | 317 BUILTIN_LIST_H(DEF_ENUM_H) |
| 321 BUILTIN_LIST_DEBUG_A(DEF_ENUM_A) | 318 BUILTIN_LIST_DEBUG_A(DEF_ENUM_A) |
| 322 #undef DEF_ENUM_C | 319 #undef DEF_ENUM_C |
| 323 #undef DEF_ENUM_A | 320 #undef DEF_ENUM_A |
| 324 builtin_count | 321 builtin_count |
| 325 }; | 322 }; |
| 326 | 323 |
| 327 enum CFunctionId { | 324 enum CFunctionId { |
| 328 #define DEF_ENUM_C(name, ignore) c_##name, | 325 #define DEF_ENUM_C(name, ignore) c_##name, |
| 329 BUILTIN_LIST_C(DEF_ENUM_C) | 326 BUILTIN_LIST_C(DEF_ENUM_C) |
| 330 #undef DEF_ENUM_C | 327 #undef DEF_ENUM_C |
| 331 cfunction_count | 328 cfunction_count |
| 332 }; | 329 }; |
| 333 | 330 |
| 334 enum JavaScript { | 331 enum JavaScript { |
| 335 #define DEF_ENUM(name, ignore) name, | 332 #define DEF_ENUM(name, ignore) name, |
| 336 BUILTINS_LIST_JS(DEF_ENUM) | 333 BUILTINS_LIST_JS(DEF_ENUM) |
| 337 #undef DEF_ENUM | 334 #undef DEF_ENUM |
| 338 id_count | 335 id_count |
| 339 }; | 336 }; |
| 340 | 337 |
| 341 #define DECLARE_BUILTIN_ACCESSOR_C(name, ignore) Handle<Code> name(); | 338 #define DECLARE_BUILTIN_ACCESSOR_C(name, ignore) Handle<Code> name(); |
| 342 #define DECLARE_BUILTIN_ACCESSOR_A(name, kind, state, extra) \ | 339 #define DECLARE_BUILTIN_ACCESSOR_A(name, kind, state, extra) \ |
| 343 Handle<Code> name(); | 340 Handle<Code> name(); |
| 344 #define DECLARE_BUILTIN_ACCESSOR_H(name, kind, extra) Handle<Code> name(); | 341 #define DECLARE_BUILTIN_ACCESSOR_H(name, kind) Handle<Code> name(); |
| 345 BUILTIN_LIST_C(DECLARE_BUILTIN_ACCESSOR_C) | 342 BUILTIN_LIST_C(DECLARE_BUILTIN_ACCESSOR_C) |
| 346 BUILTIN_LIST_A(DECLARE_BUILTIN_ACCESSOR_A) | 343 BUILTIN_LIST_A(DECLARE_BUILTIN_ACCESSOR_A) |
| 347 BUILTIN_LIST_H(DECLARE_BUILTIN_ACCESSOR_H) | 344 BUILTIN_LIST_H(DECLARE_BUILTIN_ACCESSOR_H) |
| 348 BUILTIN_LIST_DEBUG_A(DECLARE_BUILTIN_ACCESSOR_A) | 345 BUILTIN_LIST_DEBUG_A(DECLARE_BUILTIN_ACCESSOR_A) |
| 349 #undef DECLARE_BUILTIN_ACCESSOR_C | 346 #undef DECLARE_BUILTIN_ACCESSOR_C |
| 350 #undef DECLARE_BUILTIN_ACCESSOR_A | 347 #undef DECLARE_BUILTIN_ACCESSOR_A |
| 351 | 348 |
| 352 Code* builtin(Name name) { | 349 Code* builtin(Name name) { |
| 353 // Code::cast cannot be used here since we access builtins | 350 // Code::cast cannot be used here since we access builtins |
| 354 // during the marking phase of mark sweep. See IC::Clear. | 351 // during the marking phase of mark sweep. See IC::Clear. |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 | 434 |
| 438 friend class BuiltinFunctionTable; | 435 friend class BuiltinFunctionTable; |
| 439 friend class Isolate; | 436 friend class Isolate; |
| 440 | 437 |
| 441 DISALLOW_COPY_AND_ASSIGN(Builtins); | 438 DISALLOW_COPY_AND_ASSIGN(Builtins); |
| 442 }; | 439 }; |
| 443 | 440 |
| 444 } } // namespace v8::internal | 441 } } // namespace v8::internal |
| 445 | 442 |
| 446 #endif // V8_BUILTINS_H_ | 443 #endif // V8_BUILTINS_H_ |
| OLD | NEW |