Index: src/stub-cache.h |
diff --git a/src/stub-cache.h b/src/stub-cache.h |
index 7a6d4003ee560f69fe6422cfe8c39792fbd8e179..3e29b42eb6402537705db7b5ea40824df0e0bfed 100644 |
--- a/src/stub-cache.h |
+++ b/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,19 @@ 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. |
antonm
2010/12/13 13:44:15
as you're fixing the wording anyway: undefined can
Erik Corry
2010/12/13 14:08:17
Done.
Vitaly Repeshko
2010/12/14 18:55:33
Done.
|
+ 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 +701,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_; |