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

Unified Diff: src/stub-cache.cc

Issue 91963003: Cleanup in the CallStubCompiler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix check Created 7 years, 1 month 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
Index: src/stub-cache.cc
diff --git a/src/stub-cache.cc b/src/stub-cache.cc
index 631d64a6f1f816d200321a82539b93dae4fe99e8..a24bb55b513471bfddb810ec1e258ef5a4e7fd11 100644
--- a/src/stub-cache.cc
+++ b/src/stub-cache.cc
@@ -1126,12 +1126,63 @@ void StubCompiler::LookupPostInterceptor(Handle<JSObject> holder,
#define __ ACCESS_MASM(masm())
+CallKind CallStubCompiler::call_kind() {
+ return CallICBase::Contextual::decode(extra_state_)
+ ? CALL_AS_FUNCTION
+ : CALL_AS_METHOD;
+}
+
+
void CallStubCompiler::HandlerFrontendFooter(Label* miss) {
__ bind(miss);
GenerateMissBranch();
}
+void CallStubCompiler::GenerateCallFunction(Handle<Object> object,
Igor Sheludko 2013/11/28 13:06:08 What about name like GenerateTailCallFunction() or
Toon Verwaest 2013/11/28 15:24:09 Done.
+ Handle<JSFunction> function) {
+ PatchGlobalProxy(object);
+ ParameterCount expected(function);
+ __ InvokeFunction(function, expected, arguments(),
+ JUMP_FUNCTION, NullCallWrapper(), call_kind());
+}
+
+
+void CallStubCompiler::GenerateCallFunction(Handle<Object> object,
Igor Sheludko 2013/11/28 13:06:08 Same suggestion about name as above.
Toon Verwaest 2013/11/28 15:24:09 Done.
+ Register actual_closure,
+ Handle<JSFunction> function) {
+ PatchGlobalProxy(object);
+ ParameterCount expected(function);
+ __ InvokeFunction(actual_closure, expected, arguments(),
+ JUMP_FUNCTION, NullCallWrapper(), call_kind());
+}
+
+
+Handle<Code> CallStubCompiler::CompileCallConstant(
+ Handle<Object> object,
+ Handle<JSObject> holder,
+ Handle<Name> name,
+ CheckType check,
+ Handle<JSFunction> function) {
+ if (HasCustomCallGenerator(function)) {
+ Handle<Code> code = CompileCustomCall(object, holder,
+ Handle<Cell>::null(),
+ function, Handle<String>::cast(name),
+ Code::FAST);
+ // A null handle means bail out to the regular compiler code below.
+ if (!code.is_null()) return code;
+ }
+
+ Label miss;
+ HandlerFrontendHeader(object, holder, name, check, &miss);
+ GenerateCallFunction(object, function);
+ HandlerFrontendFooter(&miss);
+
+ // Return the generated code.
+ return GetCode(function);
+}
+
+
Register LoadStubCompiler::HandlerFrontendHeader(
Handle<Type> type,
Register object_reg,

Powered by Google App Engine
This is Rietveld 408576698