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

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

Issue 1407373007: Remove CallFunctionStub, always call through the Call builtin (also from CallIC) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
« no previous file with comments | « src/ic/ic-state.cc ('k') | src/mips64/code-stubs-mips64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/code-stubs-mips.cc
diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc
index f6ccc4b86b455be83ec35dbb2fd474a151d44cc6..71f7067fa3decceb5b13b6947127737a988b84cb 100644
--- a/src/mips/code-stubs-mips.cc
+++ b/src/mips/code-stubs-mips.cc
@@ -2502,123 +2502,6 @@ static void GenerateRecordCallTarget(MacroAssembler* masm, bool is_super) {
}
-static void EmitContinueIfStrictOrNative(MacroAssembler* masm, Label* cont) {
- // ----------- S t a t e -------------
- // -- a1 : the function to call
- // -- a3 : the function's shared function info
- // -----------------------------------
- __ lw(t0, FieldMemOperand(a3, SharedFunctionInfo::kCompilerHintsOffset));
-
- // Do not transform the receiver for strict mode functions.
- int32_t strict_mode_function_mask =
- 1 << (SharedFunctionInfo::kStrictModeFunction + kSmiTagSize);
- // Do not transform the receiver for native (Compilerhints already in a3).
- int32_t native_mask = 1 << (SharedFunctionInfo::kNative + kSmiTagSize);
- __ And(at, t0, Operand(strict_mode_function_mask | native_mask));
- __ Branch(cont, ne, at, Operand(zero_reg));
-}
-
-
-static void EmitSlowCase(MacroAssembler* masm, int argc) {
- __ li(a0, Operand(argc));
- __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
-}
-
-
-static void EmitWrapCase(MacroAssembler* masm, int argc, Label* cont) {
- // Wrap the receiver and patch it back onto the stack.
- { FrameScope frame_scope(masm, StackFrame::INTERNAL);
- __ Push(a1);
- __ mov(a0, a3);
- ToObjectStub stub(masm->isolate());
- __ CallStub(&stub);
- __ pop(a1);
- }
- __ Branch(USE_DELAY_SLOT, cont);
- __ sw(v0, MemOperand(sp, argc * kPointerSize));
-}
-
-
-static void EmitClassConstructorCallCheck(MacroAssembler* masm) {
- // ----------- S t a t e -------------
- // -- a1 : the function to call
- // -- a3 : the function's shared function info
- // -----------------------------------
- // ClassConstructor Check: ES6 section 9.2.1 [[Call]]
- Label non_class_constructor;
- // Check whether the current function is a classConstructor.
- __ lbu(t0, FieldMemOperand(a3, SharedFunctionInfo::kFunctionKindByteOffset));
- __ And(at, t0, Operand(SharedFunctionInfo::kClassConstructorBitsWithinByte));
- __ Branch(&non_class_constructor, eq, at, Operand(zero_reg));
- // Step: 2, If we call a classConstructor Function throw a TypeError.
- __ Jump(masm->isolate()->builtins()->CallFunction(), RelocInfo::CODE_TARGET);
- __ bind(&non_class_constructor);
-}
-
-
-static void CallFunctionNoFeedback(MacroAssembler* masm,
- int argc, bool needs_checks,
- bool call_as_method) {
- // a1 : the function to call
- Label slow, wrap, cont;
-
- if (needs_checks) {
- // Check that the function is really a JavaScript function.
- // a1: pushed function (to be verified)
- __ JumpIfSmi(a1, &slow);
-
- // Goto slow case if we do not have a function.
- __ GetObjectType(a1, t0, t0);
- __ Branch(&slow, ne, t0, Operand(JS_FUNCTION_TYPE));
- }
-
- __ lw(a3, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
- EmitClassConstructorCallCheck(masm);
-
- // Fast-case: Invoke the function now.
- // a1: pushed function
- ParameterCount actual(argc);
-
- if (call_as_method) {
- if (needs_checks) {
- EmitContinueIfStrictOrNative(masm, &cont);
- }
-
- // Compute the receiver in sloppy mode.
- __ lw(a3, MemOperand(sp, argc * kPointerSize));
-
- if (needs_checks) {
- __ JumpIfSmi(a3, &wrap);
- __ GetObjectType(a3, t0, t0);
- __ Branch(&wrap, lt, t0, Operand(FIRST_SPEC_OBJECT_TYPE));
- } else {
- __ jmp(&wrap);
- }
-
- __ bind(&cont);
- }
-
- __ InvokeFunction(a1, actual, JUMP_FUNCTION, NullCallWrapper());
-
- if (needs_checks) {
- // Slow-case: Non-function called.
- __ bind(&slow);
- EmitSlowCase(masm, argc);
- }
-
- if (call_as_method) {
- __ bind(&wrap);
- // Wrap the receiver and patch it back onto the stack.
- EmitWrapCase(masm, argc, &cont);
- }
-}
-
-
-void CallFunctionStub::Generate(MacroAssembler* masm) {
- CallFunctionNoFeedback(masm, argc(), NeedsChecks(), CallAsMethod());
-}
-
-
void CallConstructStub::Generate(MacroAssembler* masm) {
// a0 : number of arguments
// a1 : the function to call
@@ -2702,9 +2585,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
FixedArray::OffsetOfElementAt(TypeFeedbackVector::kWithTypesIndex);
const int generic_offset =
FixedArray::OffsetOfElementAt(TypeFeedbackVector::kGenericCountIndex);
- Label extra_checks_or_miss, slow_start;
- Label slow, wrap, cont;
- Label have_js_function;
+ Label extra_checks_or_miss, call;
int argc = arg_count();
ParameterCount actual(argc);
@@ -2741,38 +2622,15 @@ void CallICStub::Generate(MacroAssembler* masm) {
__ Addu(a3, a3, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement)));
__ sw(a3, FieldMemOperand(at, FixedArray::kHeaderSize + kPointerSize));
- __ bind(&have_js_function);
-
- __ lw(a3, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
- EmitClassConstructorCallCheck(masm);
-
- if (CallAsMethod()) {
- EmitContinueIfStrictOrNative(masm, &cont);
- // Compute the receiver in sloppy mode.
- __ lw(a3, MemOperand(sp, argc * kPointerSize));
-
- __ JumpIfSmi(a3, &wrap);
- __ GetObjectType(a3, t0, t0);
- __ Branch(&wrap, lt, t0, Operand(FIRST_SPEC_OBJECT_TYPE));
-
- __ bind(&cont);
- }
-
- __ InvokeFunction(a1, actual, JUMP_FUNCTION, NullCallWrapper());
-
- __ bind(&slow);
- EmitSlowCase(masm, argc);
-
- if (CallAsMethod()) {
- __ bind(&wrap);
- EmitWrapCase(masm, argc, &cont);
- }
+ __ bind(&call);
+ __ li(a0, Operand(argc));
+ __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
__ bind(&extra_checks_or_miss);
Label uninitialized, miss, not_allocation_site;
__ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex);
- __ Branch(&slow_start, eq, t0, Operand(at));
+ __ Branch(&call, eq, t0, Operand(at));
// Verify that t0 contains an AllocationSite
__ lw(t1, FieldMemOperand(t0, HeapObject::kMapOffset));
@@ -2807,7 +2665,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
__ sw(t0, FieldMemOperand(a2, with_types_offset));
__ lw(t0, FieldMemOperand(a2, generic_offset));
__ Addu(t0, t0, Operand(Smi::FromInt(1)));
- __ Branch(USE_DELAY_SLOT, &slow_start);
+ __ Branch(USE_DELAY_SLOT, &call);
__ sw(t0, FieldMemOperand(a2, generic_offset)); // In delay slot.
__ bind(&uninitialized);
@@ -2847,23 +2705,14 @@ void CallICStub::Generate(MacroAssembler* masm) {
__ Pop(a1);
}
- __ Branch(&have_js_function);
+ __ Branch(&call);
// We are here because tracing is on or we encountered a MISS case we can't
// handle here.
__ bind(&miss);
GenerateMiss(masm);
- // the slow case
- __ bind(&slow_start);
- // Check that the function is really a JavaScript function.
- // r1: pushed function (to be verified)
- __ JumpIfSmi(a1, &slow);
-
- // Goto slow case if we do not have a function.
- __ GetObjectType(a1, t0, t0);
- __ Branch(&slow, ne, t0, Operand(JS_FUNCTION_TYPE));
- __ Branch(&have_js_function);
+ __ Branch(&call);
}
« no previous file with comments | « src/ic/ic-state.cc ('k') | src/mips64/code-stubs-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698