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

Unified Diff: src/ia32/code-stubs-ia32.cc

Issue 1688283003: [Interpreter] Implements calls through CallICStub in the interpreter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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
Index: src/ia32/code-stubs-ia32.cc
diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc
index 9f639f91fcaf6abb550c7a90ddeb5fe1d0dc26f2..ccf8096d73f75fe9749a52ee31224b1e3ffc472c 100644
--- a/src/ia32/code-stubs-ia32.cc
+++ b/src/ia32/code-stubs-ia32.cc
@@ -1902,7 +1902,9 @@ void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) {
__ cmp(edi, ecx);
__ j(not_equal, miss);
- __ mov(eax, arg_count());
+ if (!argc_in_register()) {
+ __ mov(eax, arg_count());
+ }
// Reload ecx.
__ mov(ecx, FieldOperand(ebx, edx, times_half_pointer_size,
FixedArray::kHeaderSize));
@@ -1914,9 +1916,13 @@ void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) {
__ mov(ebx, ecx);
__ mov(edx, edi);
- ArrayConstructorStub stub(masm->isolate(), arg_count());
- __ TailCallStub(&stub);
-
+ if (argc_in_register()) {
+ ArrayConstructorStub stub(masm->isolate());
+ __ TailCallStub(&stub);
+ } else {
+ ArrayConstructorStub stub(masm->isolate(), arg_count());
+ __ TailCallStub(&stub);
+ }
// Unreachable.
}
@@ -1925,10 +1931,10 @@ void CallICStub::Generate(MacroAssembler* masm) {
// edi - function
// edx - slot id
// ebx - vector
+ // eax - number of arguments - if argc_in_register() is true.
Isolate* isolate = masm->isolate();
Label extra_checks_or_miss, call, call_function;
int argc = arg_count();
- ParameterCount actual(argc);
// The checks. First, does edi match the recorded monomorphic target?
__ mov(ecx, FieldOperand(ebx, edx, times_half_pointer_size,
@@ -1961,7 +1967,9 @@ void CallICStub::Generate(MacroAssembler* masm) {
Immediate(Smi::FromInt(CallICNexus::kCallCountIncrement)));
__ bind(&call_function);
- __ Set(eax, argc);
+ if (!argc_in_register()) {
+ __ Set(eax, argc);
+ }
rmcilroy 2016/02/12 14:21:03 Could we just pull this up to be below "argc = arg
mythria 2016/02/17 11:02:48 Done.
__ Jump(masm->isolate()->builtins()->CallFunction(convert_mode(),
tail_call_mode()),
RelocInfo::CODE_TARGET);
@@ -2001,7 +2009,9 @@ void CallICStub::Generate(MacroAssembler* masm) {
Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate)));
__ bind(&call);
- __ Set(eax, argc);
+ if (!argc_in_register()) {
+ __ Set(eax, argc);
+ }
__ Jump(masm->isolate()->builtins()->Call(convert_mode(), tail_call_mode()),
RelocInfo::CODE_TARGET);
@@ -2038,9 +2048,17 @@ void CallICStub::Generate(MacroAssembler* masm) {
{
FrameScope scope(masm, StackFrame::INTERNAL);
CreateWeakCellStub create_stub(isolate);
+ if (argc_in_register()) {
+ __ SmiTag(eax);
+ __ push(eax);
+ }
__ push(edi);
__ CallStub(&create_stub);
__ pop(edi);
+ if (argc_in_register()) {
+ __ pop(eax);
+ __ SmiUntag(eax);
+ }
}
__ jmp(&call_function);
@@ -2059,7 +2077,10 @@ void CallICStub::Generate(MacroAssembler* masm) {
void CallICStub::GenerateMiss(MacroAssembler* masm) {
FrameScope scope(masm, StackFrame::INTERNAL);
-
+ if (argc_in_register()) {
+ __ SmiTag(eax);
+ __ push(eax);
+ }
// Push the function and feedback info.
__ push(edi);
__ push(ebx);
@@ -2070,6 +2091,10 @@ void CallICStub::GenerateMiss(MacroAssembler* masm) {
// Move result to edi and exit the internal frame.
__ mov(edi, eax);
+ if (argc_in_register()) {
+ __ pop(eax);
+ __ SmiUntag(eax);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698