Chromium Code Reviews| Index: src/builtins/builtins.h |
| diff --git a/src/builtins/builtins.h b/src/builtins/builtins.h |
| index 10d6f21705b3c99e1f8e039d0cd5722d08192449..68fd84ec0dd0aa7a973afaca5f4e123e3a86d41e 100644 |
| --- a/src/builtins/builtins.h |
| +++ b/src/builtins/builtins.h |
| @@ -569,13 +569,38 @@ class Builtins { |
| #define DEF_ENUM(Name, ...) k##Name, |
| BUILTIN_LIST_ALL(DEF_ENUM) |
| #undef DEF_ENUM |
| - builtin_count |
| + BUILTIN_COUNT |
| }; |
| #define DECLARE_BUILTIN_ACCESSOR(Name, ...) Handle<Code> Name(); |
| BUILTIN_LIST_ALL(DECLARE_BUILTIN_ACCESSOR) |
| #undef DECLARE_BUILTIN_ACCESSOR |
| + enum Kind { CPP, API, TFJ, TFS, ASM, ASH, DBG }; |
|
Toon Verwaest
2016/08/19 11:58:15
Here I'd write the names out so we don't need to g
|
| + |
| + struct Descriptor { |
| + Descriptor() {} |
| + Descriptor(Name id, Kind kind, Address entry, Object* code, |
| + const char* debug_name) |
| + : id(id), |
| + kind(kind), |
| + entry(entry), |
| + code(code), |
| + debug_name(debug_name) {} |
| + |
| + Name id; |
| + Kind kind; |
| + |
| + // For CPP and API functions, this is the C++ entry point. |
| + Address entry; |
| + |
| + // Note: These are always Code objects, but to conform with |
| + // IterateBuiltins(), we use an Object* here. |
| + Object* code; |
|
Toon Verwaest
2016/08/19 11:58:15
You should be able to just make this a Code*, whic
|
| + |
| + const char* debug_name; |
|
Toon Verwaest
2016/08/19 11:58:15
#ifdef DEBUG?
|
| + }; |
| + |
| // Convenience wrappers. |
| Handle<Code> CallFunction( |
| ConvertReceiverMode = ConvertReceiverMode::kAny, |
| @@ -593,11 +618,11 @@ class Builtins { |
| Code* builtin(Name name) { |
| // Code::cast cannot be used here since we access builtins |
| // during the marking phase of mark sweep. See IC::Clear. |
|
Toon Verwaest
2016/08/19 11:58:15
Then you don't need to reinterpret_cast here.
|
| - return reinterpret_cast<Code*>(builtins_[name]); |
| + return reinterpret_cast<Code*>(builtins_[name].code); |
| } |
| Address builtin_address(Name name) { |
| - return reinterpret_cast<Address>(&builtins_[name]); |
| + return reinterpret_cast<Address>(&builtins_[name].code); |
| } |
| const char* name(int index); |
| @@ -651,10 +676,7 @@ class Builtins { |
| #undef DECLARE_ASM |
| #undef DECLARE_TF |
| - // Note: These are always Code objects, but to conform with |
| - // IterateBuiltins() above which assumes Object**'s for the callback |
| - // function f, we use an Object* array here. |
| - Object* builtins_[builtin_count]; |
| + Descriptor builtins_[BUILTIN_COUNT]; |
| bool initialized_; |
| friend class Isolate; |