diff options
Diffstat (limited to 'deps/v8/src/stub-cache.h')
-rw-r--r-- | deps/v8/src/stub-cache.h | 50 |
1 files changed, 18 insertions, 32 deletions
diff --git a/deps/v8/src/stub-cache.h b/deps/v8/src/stub-cache.h index 7a6d4003ee..a7829a600e 100644 --- a/deps/v8/src/stub-cache.h +++ b/deps/v8/src/stub-cache.h @@ -643,37 +643,20 @@ class KeyedStoreStubCompiler: public StubCompiler { }; -// 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 @@ class CallStubCompiler: public StubCompiler { 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 @@ class CallStubCompiler: public StubCompiler { CUSTOM_CALL_IC_GENERATORS(DECLARE_CALL_GENERATOR) #undef DECLARE_CALL_GENERATOR - private: const ParameterCount arguments_; const InLoopFlag in_loop_; const Code::Kind kind_; |