Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Unified Diff: src/stub-cache.cc

Issue 1981002: Refactored custom call IC generators: (Closed)
Patch Set: Review fixes. Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/stub-cache.h ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/stub-cache.cc
diff --git a/src/stub-cache.cc b/src/stub-cache.cc
index f3532533e7e01ac09996b96543dd10e40969d45d..6ebe495f16830b276ba0a115a1d1efe69a5ee018 100644
--- a/src/stub-cache.cc
+++ b/src/stub-cache.cc
@@ -1142,6 +1142,29 @@ Object* KeyedStoreStubCompiler::GetCode(PropertyType type, String* name) {
}
+Object* CallStubCompiler::CompileCustomCall(int generator_id,
+ Object* object,
+ JSObject* holder,
+ JSFunction* function,
+ String* fname,
+ CheckType check) {
+ ASSERT(generator_id >= 0 && generator_id < kNumCallGenerators);
+ switch (generator_id) {
+#define CALL_GENERATOR_CASE(ignored1, ignored2, name) \
+ case k##name##CallGenerator: \
+ return CallStubCompiler::Compile##name##Call(object, \
+ holder, \
+ function, \
+ fname, \
+ check);
+ CUSTOM_CALL_IC_GENERATORS(CALL_GENERATOR_CASE)
+#undef CALL_GENERATOR_CASE
+ }
+ UNREACHABLE();
+ return Heap::undefined_value();
+}
+
+
Object* CallStubCompiler::GetCode(PropertyType type, String* name) {
int argc = arguments_.immediate();
Code::Flags flags = Code::ComputeMonomorphicFlags(Code::CALL_IC,
@@ -1152,6 +1175,15 @@ Object* CallStubCompiler::GetCode(PropertyType type, String* name) {
}
+Object* CallStubCompiler::GetCode(JSFunction* function) {
+ String* function_name = NULL;
+ if (function->shared()->name()->IsString()) {
+ function_name = String::cast(function->shared()->name());
+ }
+ return GetCode(CONSTANT_FUNCTION, function_name);
+}
+
+
Object* ConstructStubCompiler::GetCode() {
Code::Flags flags = Code::ComputeFlags(Code::STUB);
Object* result = GetCodeWithFlags(flags, "ConstructStub");
« no previous file with comments | « src/stub-cache.h ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698