| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 void Setup(bool create_heap_objects); | 253 void Setup(bool create_heap_objects); |
| 254 void TearDown(); | 254 void TearDown(); |
| 255 | 255 |
| 256 // Garbage collection support. | 256 // Garbage collection support. |
| 257 void IterateBuiltins(ObjectVisitor* v); | 257 void IterateBuiltins(ObjectVisitor* v); |
| 258 | 258 |
| 259 // Disassembler support. | 259 // Disassembler support. |
| 260 const char* Lookup(byte* pc); | 260 const char* Lookup(byte* pc); |
| 261 | 261 |
| 262 enum Name { | 262 enum Name { |
| 263 #define DEF_ENUM_C(name, ignore) name, | 263 #define DEF_ENUM_C(name, ignore) k##name, |
| 264 #define DEF_ENUM_A(name, kind, state, extra) name, | 264 #define DEF_ENUM_A(name, kind, state, extra) k##name, |
| 265 BUILTIN_LIST_C(DEF_ENUM_C) | 265 BUILTIN_LIST_C(DEF_ENUM_C) |
| 266 BUILTIN_LIST_A(DEF_ENUM_A) | 266 BUILTIN_LIST_A(DEF_ENUM_A) |
| 267 BUILTIN_LIST_DEBUG_A(DEF_ENUM_A) | 267 BUILTIN_LIST_DEBUG_A(DEF_ENUM_A) |
| 268 #undef DEF_ENUM_C | 268 #undef DEF_ENUM_C |
| 269 #undef DEF_ENUM_A | 269 #undef DEF_ENUM_A |
| 270 builtin_count | 270 builtin_count |
| 271 }; | 271 }; |
| 272 | 272 |
| 273 enum CFunctionId { | 273 enum CFunctionId { |
| 274 #define DEF_ENUM_C(name, ignore) c_##name, | 274 #define DEF_ENUM_C(name, ignore) c_##name, |
| 275 BUILTIN_LIST_C(DEF_ENUM_C) | 275 BUILTIN_LIST_C(DEF_ENUM_C) |
| 276 #undef DEF_ENUM_C | 276 #undef DEF_ENUM_C |
| 277 cfunction_count | 277 cfunction_count |
| 278 }; | 278 }; |
| 279 | 279 |
| 280 enum JavaScript { | 280 enum JavaScript { |
| 281 #define DEF_ENUM(name, ignore) name, | 281 #define DEF_ENUM(name, ignore) name, |
| 282 BUILTINS_LIST_JS(DEF_ENUM) | 282 BUILTINS_LIST_JS(DEF_ENUM) |
| 283 #undef DEF_ENUM | 283 #undef DEF_ENUM |
| 284 id_count | 284 id_count |
| 285 }; | 285 }; |
| 286 | 286 |
| 287 #define DECLARE_BUILTIN_ACCESSOR_C(name, ignore) Handle<Code> name(); |
| 288 #define DECLARE_BUILTIN_ACCESSOR_A(name, kind, state, extra) \ |
| 289 Handle<Code> name(); |
| 290 BUILTIN_LIST_C(DECLARE_BUILTIN_ACCESSOR_C) |
| 291 BUILTIN_LIST_A(DECLARE_BUILTIN_ACCESSOR_A) |
| 292 BUILTIN_LIST_DEBUG_A(DECLARE_BUILTIN_ACCESSOR_A) |
| 293 #undef DECLARE_BUILTIN_ACCESSOR_C |
| 294 #undef DECLARE_BUILTIN_ACCESSOR_A |
| 295 |
| 287 Code* builtin(Name name) { | 296 Code* builtin(Name name) { |
| 288 // Code::cast cannot be used here since we access builtins | 297 // Code::cast cannot be used here since we access builtins |
| 289 // during the marking phase of mark sweep. See IC::Clear. | 298 // during the marking phase of mark sweep. See IC::Clear. |
| 290 return reinterpret_cast<Code*>(builtins_[name]); | 299 return reinterpret_cast<Code*>(builtins_[name]); |
| 291 } | 300 } |
| 292 | 301 |
| 293 Address builtin_address(Name name) { | 302 Address builtin_address(Name name) { |
| 294 return reinterpret_cast<Address>(&builtins_[name]); | 303 return reinterpret_cast<Address>(&builtins_[name]); |
| 295 } | 304 } |
| 296 | 305 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 | 359 |
| 351 friend class BuiltinFunctionTable; | 360 friend class BuiltinFunctionTable; |
| 352 friend class Isolate; | 361 friend class Isolate; |
| 353 | 362 |
| 354 DISALLOW_COPY_AND_ASSIGN(Builtins); | 363 DISALLOW_COPY_AND_ASSIGN(Builtins); |
| 355 }; | 364 }; |
| 356 | 365 |
| 357 } } // namespace v8::internal | 366 } } // namespace v8::internal |
| 358 | 367 |
| 359 #endif // V8_BUILTINS_H_ | 368 #endif // V8_BUILTINS_H_ |
| OLD | NEW |