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

Unified Diff: src/ia32/stub-cache-ia32.cc

Issue 8883011: Implement ICs for constructor calls. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years 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/ia32/macro-assembler-ia32.cc ('k') | src/ic.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/stub-cache-ia32.cc
diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc
index aa8f47a880fced25832dfb4feb8270027f3fd943..2aa22c467fcb7f5e1771dcd068e32d0bceabbb10 100644
--- a/src/ia32/stub-cache-ia32.cc
+++ b/src/ia32/stub-cache-ia32.cc
@@ -582,6 +582,7 @@ class CallInterceptorCompiler BASE_EMBEDDED {
}
// Invoke function.
+ ASSERT(!CallICBase::ConstructCall::decode(extra_state_));
if (can_do_fast_api_call) {
GenerateFastApiCall(masm, optimization, arguments_.immediate());
} else {
@@ -1298,11 +1299,15 @@ Handle<Code> CallStubCompiler::CompileCallField(Handle<JSObject> object,
}
// Invoke the function.
- CallKind call_kind = CallICBase::Contextual::decode(extra_state_)
- ? CALL_AS_FUNCTION
- : CALL_AS_METHOD;
- __ InvokeFunction(edi, arguments(), JUMP_FUNCTION,
- NullCallWrapper(), call_kind);
+ if (CallICBase::ConstructCall::decode(extra_state_)) {
+ __ InvokeConstruct(edi, arguments());
+ } else {
+ CallKind call_kind = CallICBase::Contextual::decode(extra_state_)
+ ? CALL_AS_FUNCTION
+ : CALL_AS_METHOD;
+ __ InvokeFunction(edi, arguments(), JUMP_FUNCTION,
+ NullCallWrapper(), call_kind);
+ }
// Handle call cache miss.
__ bind(&miss);
@@ -1807,6 +1812,7 @@ Handle<Code> CallStubCompiler::CompileStringFromCharCodeCall(
// Tail call the full function. We do not have to patch the receiver
// because the function makes no use of it.
__ bind(&slow);
+ ASSERT(!CallICBase::ConstructCall::decode(extra_state_));
CallKind call_kind = CallICBase::Contextual::decode(extra_state_)
? CALL_AS_FUNCTION
: CALL_AS_METHOD;
@@ -1940,6 +1946,7 @@ Handle<Code> CallStubCompiler::CompileMathFloorCall(
// Tail call the full function. We do not have to patch the receiver
// because the function makes no use of it.
__ bind(&slow);
+ ASSERT(!CallICBase::ConstructCall::decode(extra_state_));
__ InvokeFunction(function, arguments(), JUMP_FUNCTION,
NullCallWrapper(), CALL_AS_METHOD);
@@ -2045,6 +2052,7 @@ Handle<Code> CallStubCompiler::CompileMathAbsCall(
// Tail call the full function. We do not have to patch the receiver
// because the function makes no use of it.
__ bind(&slow);
+ ASSERT(!CallICBase::ConstructCall::decode(extra_state_));
__ InvokeFunction(function, arguments(), JUMP_FUNCTION,
NullCallWrapper(), CALL_AS_METHOD);
@@ -2230,11 +2238,15 @@ Handle<Code> CallStubCompiler::CompileCallConstant(Handle<Object> object,
break;
}
- CallKind call_kind = CallICBase::Contextual::decode(extra_state_)
- ? CALL_AS_FUNCTION
- : CALL_AS_METHOD;
- __ InvokeFunction(function, arguments(), JUMP_FUNCTION,
- NullCallWrapper(), call_kind);
+ if (CallICBase::ConstructCall::decode(extra_state_)) {
+ __ InvokeConstruct(function, arguments());
+ } else {
+ CallKind call_kind = CallICBase::Contextual::decode(extra_state_)
+ ? CALL_AS_FUNCTION
+ : CALL_AS_METHOD;
+ __ InvokeFunction(function, arguments(), JUMP_FUNCTION,
+ NullCallWrapper(), call_kind);
+ }
// Handle call cache miss.
__ bind(&miss);
@@ -2289,6 +2301,7 @@ Handle<Code> CallStubCompiler::CompileCallInterceptor(Handle<JSObject> object,
// Invoke the function.
__ mov(edi, eax);
+ ASSERT(!CallICBase::ConstructCall::decode(extra_state_));
CallKind call_kind = CallICBase::Contextual::decode(extra_state_)
? CALL_AS_FUNCTION
: CALL_AS_METHOD;
@@ -2344,16 +2357,20 @@ Handle<Code> CallStubCompiler::CompileCallGlobal(
// Jump to the cached code (tail call).
Counters* counters = isolate()->counters();
__ IncrementCounter(counters->call_global_inline(), 1);
- ParameterCount expected(function->shared()->formal_parameter_count());
- CallKind call_kind = CallICBase::Contextual::decode(extra_state_)
- ? CALL_AS_FUNCTION
- : CALL_AS_METHOD;
- // We call indirectly through the code field in the function to
- // allow recompilation to take effect without changing any of the
- // call sites.
- __ InvokeCode(FieldOperand(edi, JSFunction::kCodeEntryOffset),
- expected, arguments(), JUMP_FUNCTION,
- NullCallWrapper(), call_kind);
+ if (CallICBase::ConstructCall::decode(extra_state_)) {
+ __ InvokeConstruct(edi, arguments());
+ } else {
+ ParameterCount expected(function->shared()->formal_parameter_count());
+ CallKind call_kind = CallICBase::Contextual::decode(extra_state_)
+ ? CALL_AS_FUNCTION
+ : CALL_AS_METHOD;
+ // We call indirectly through the code field in the function to
+ // allow recompilation to take effect without changing any of the
+ // call sites.
+ __ InvokeCode(FieldOperand(edi, JSFunction::kCodeEntryOffset),
+ expected, arguments(), JUMP_FUNCTION,
+ NullCallWrapper(), call_kind);
+ }
// Handle call cache miss.
__ bind(&miss);
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/ic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698