| Index: src/stub-cache.h
|
| ===================================================================
|
| --- src/stub-cache.h (revision 6095)
|
| +++ src/stub-cache.h (working copy)
|
| @@ -643,37 +643,20 @@
|
| };
|
|
|
|
|
| -// List of functions with custom constant call IC stubs.
|
| -//
|
| -// Installation of custom call generators for the selected builtins is
|
| -// handled by the bootstrapper.
|
| -//
|
| -// Each entry has a name of a global object property holding an object
|
| -// optionally followed by ".prototype" (this controls whether the
|
| -// generator is set on the object itself or, in case it's a function,
|
| -// on the its instance prototype), a name of a builtin function on the
|
| -// object (the one the generator is set for), and a name of the
|
| -// generator (used to build ids and generator function names).
|
| -#define CUSTOM_CALL_IC_GENERATORS(V) \
|
| - V(Array.prototype, push, ArrayPush) \
|
| - V(Array.prototype, pop, ArrayPop) \
|
| - V(String.prototype, charCodeAt, StringCharCodeAt) \
|
| - V(String.prototype, charAt, StringCharAt) \
|
| - V(String, fromCharCode, StringFromCharCode) \
|
| - V(Math, floor, MathFloor) \
|
| - V(Math, abs, MathAbs)
|
| +// Subset of FUNCTIONS_WITH_ID_LIST with custom constant/global call
|
| +// IC stubs.
|
| +#define CUSTOM_CALL_IC_GENERATORS(V) \
|
| + V(ArrayPush) \
|
| + V(ArrayPop) \
|
| + V(StringCharCodeAt) \
|
| + V(StringCharAt) \
|
| + V(StringFromCharCode) \
|
| + V(MathFloor) \
|
| + V(MathAbs)
|
|
|
|
|
| class CallStubCompiler: public StubCompiler {
|
| public:
|
| - enum {
|
| -#define DECLARE_CALL_GENERATOR_ID(ignored1, ignore2, name) \
|
| - k##name##CallGenerator,
|
| - CUSTOM_CALL_IC_GENERATORS(DECLARE_CALL_GENERATOR_ID)
|
| -#undef DECLARE_CALL_GENERATOR_ID
|
| - kNumCallGenerators
|
| - };
|
| -
|
| CallStubCompiler(int argc,
|
| InLoopFlag in_loop,
|
| Code::Kind kind,
|
| @@ -697,16 +680,20 @@
|
| JSFunction* function,
|
| String* name);
|
|
|
| - // Compiles a custom call constant/global IC using the generator
|
| - // with given id. For constant calls cell is NULL.
|
| - MUST_USE_RESULT MaybeObject* CompileCustomCall(int generator_id,
|
| + static bool HasCustomCallGenerator(BuiltinFunctionId id);
|
| +
|
| + private:
|
| + // Compiles a custom call constant/global IC. For constant calls
|
| + // cell is NULL. Returns undefined if there is no custom call code
|
| + // for the given function or it can't be generated.
|
| + MUST_USE_RESULT MaybeObject* CompileCustomCall(BuiltinFunctionId id,
|
| Object* object,
|
| JSObject* holder,
|
| JSGlobalPropertyCell* cell,
|
| JSFunction* function,
|
| String* name);
|
|
|
| -#define DECLARE_CALL_GENERATOR(ignored1, ignored2, name) \
|
| +#define DECLARE_CALL_GENERATOR(name) \
|
| MUST_USE_RESULT MaybeObject* Compile##name##Call(Object* object, \
|
| JSObject* holder, \
|
| JSGlobalPropertyCell* cell, \
|
| @@ -715,7 +702,6 @@
|
| CUSTOM_CALL_IC_GENERATORS(DECLARE_CALL_GENERATOR)
|
| #undef DECLARE_CALL_GENERATOR
|
|
|
| - private:
|
| const ParameterCount arguments_;
|
| const InLoopFlag in_loop_;
|
| const Code::Kind kind_;
|
|
|