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

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

Issue 1423973006: PPC: 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/full-codegen/ppc/full-codegen-ppc.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ppc/code-stubs-ppc.cc
diff --git a/src/ppc/code-stubs-ppc.cc b/src/ppc/code-stubs-ppc.cc
index f4a4fa5184ba664f174f0568fec575ae488483bc..b9da2b1317d51172cced052d93696b2616d6d435 100644
--- a/src/ppc/code-stubs-ppc.cc
+++ b/src/ppc/code-stubs-ppc.cc
@@ -2529,119 +2529,6 @@ static void GenerateRecordCallTarget(MacroAssembler* masm, bool is_super) {
}
-static void EmitContinueIfStrictOrNative(MacroAssembler* masm, Label* cont) {
- // ----------- S t a t e -------------
- // -- r4 : the function to call
- // -- r6 : the function's shared function info
- // -----------------------------------
- // Do not transform the receiver for strict mode functions and natives.
- __ lwz(r7, FieldMemOperand(r6, SharedFunctionInfo::kCompilerHintsOffset));
- __ andi(r0, r7, Operand((1 << SharedFunctionInfo::kStrictModeBit) |
- (1 << SharedFunctionInfo::kNativeBit)));
- __ bne(cont, cr0);
-}
-
-
-static void EmitSlowCase(MacroAssembler* masm, int argc) {
- __ mov(r3, 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.
- {
- FrameAndConstantPoolScope frame_scope(masm, StackFrame::INTERNAL);
- __ push(r4);
- __ mr(r3, r6);
- ToObjectStub stub(masm->isolate());
- __ CallStub(&stub);
- __ pop(r4);
- }
- __ StoreP(r3, MemOperand(sp, argc * kPointerSize), r0);
- __ b(cont);
-}
-
-
-static void EmitClassConstructorCallCheck(MacroAssembler* masm) {
- // ----------- S t a t e -------------
- // -- r4 : the function to call
- // -- r6 : 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.
- __ lwz(r7, FieldMemOperand(r6, SharedFunctionInfo::kCompilerHintsOffset));
- __ TestBitMask(r7, SharedFunctionInfo::kClassConstructorBits, r0);
- __ beq(&non_class_constructor, cr0);
- // If we call a classConstructor Function throw a TypeError
- // indirectly via the CallFunction builtin.
- __ 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) {
- // r4 : the function to call
- Label slow, wrap, cont;
-
- if (needs_checks) {
- // Check that the function is really a JavaScript function.
- // r4: pushed function (to be verified)
- __ JumpIfSmi(r4, &slow);
-
- // Goto slow case if we do not have a function.
- __ CompareObjectType(r4, r7, r7, JS_FUNCTION_TYPE);
- __ bne(&slow);
- }
-
- __ LoadP(r6, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset));
- EmitClassConstructorCallCheck(masm);
-
- // Fast-case: Invoke the function now.
- // r4: pushed function
- ParameterCount actual(argc);
-
- if (call_as_method) {
- if (needs_checks) {
- EmitContinueIfStrictOrNative(masm, &cont);
- }
-
- // Compute the receiver in sloppy mode.
- __ LoadP(r6, MemOperand(sp, argc * kPointerSize), r0);
-
- if (needs_checks) {
- __ JumpIfSmi(r6, &wrap);
- __ CompareObjectType(r6, r7, r7, FIRST_SPEC_OBJECT_TYPE);
- __ blt(&wrap);
- } else {
- __ b(&wrap);
- }
-
- __ bind(&cont);
- }
-
- __ InvokeFunction(r4, actual, JUMP_FUNCTION, NullCallWrapper());
-
- if (needs_checks) {
- // Slow-case: Non-function called.
- __ bind(&slow);
- EmitSlowCase(masm, argc);
- }
-
- if (call_as_method) {
- __ bind(&wrap);
- EmitWrapCase(masm, argc, &cont);
- }
-}
-
-
-void CallFunctionStub::Generate(MacroAssembler* masm) {
- CallFunctionNoFeedback(masm, argc(), NeedsChecks(), CallAsMethod());
-}
-
-
void CallConstructStub::Generate(MacroAssembler* masm) {
// r3 : number of arguments
// r4 : the function to call
@@ -2732,9 +2619,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);
@@ -2771,38 +2656,15 @@ void CallICStub::Generate(MacroAssembler* masm) {
__ AddSmiLiteral(r6, r6, Smi::FromInt(CallICNexus::kCallCountIncrement), r0);
__ StoreP(r6, FieldMemOperand(r9, count_offset), r0);
- __ bind(&have_js_function);
-
- __ LoadP(r6, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset));
- EmitClassConstructorCallCheck(masm);
-
- if (CallAsMethod()) {
- EmitContinueIfStrictOrNative(masm, &cont);
- // Compute the receiver in sloppy mode.
- __ LoadP(r6, MemOperand(sp, argc * kPointerSize), r0);
-
- __ JumpIfSmi(r6, &wrap);
- __ CompareObjectType(r6, r7, r7, FIRST_SPEC_OBJECT_TYPE);
- __ blt(&wrap);
-
- __ bind(&cont);
- }
-
- __ InvokeFunction(r4, actual, JUMP_FUNCTION, NullCallWrapper());
-
- __ bind(&slow);
- EmitSlowCase(masm, argc);
-
- if (CallAsMethod()) {
- __ bind(&wrap);
- EmitWrapCase(masm, argc, &cont);
- }
+ __ bind(&call);
+ __ mov(r3, Operand(argc));
+ __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
__ bind(&extra_checks_or_miss);
Label uninitialized, miss, not_allocation_site;
__ CompareRoot(r7, Heap::kmegamorphic_symbolRootIndex);
- __ beq(&slow_start);
+ __ beq(&call);
// Verify that r7 contains an AllocationSite
__ LoadP(r8, FieldMemOperand(r7, HeapObject::kMapOffset));
@@ -2837,7 +2699,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
__ LoadP(r7, FieldMemOperand(r5, generic_offset));
__ AddSmiLiteral(r7, r7, Smi::FromInt(1), r0);
__ StoreP(r7, FieldMemOperand(r5, generic_offset), r0);
- __ b(&slow_start);
+ __ b(&call);
__ bind(&uninitialized);
@@ -2875,23 +2737,14 @@ void CallICStub::Generate(MacroAssembler* masm) {
__ Pop(r4);
}
- __ b(&have_js_function);
+ __ b(&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.
- // r4: pushed function (to be verified)
- __ JumpIfSmi(r4, &slow);
-
- // Goto slow case if we do not have a function.
- __ CompareObjectType(r4, r7, r7, JS_FUNCTION_TYPE);
- __ bne(&slow);
- __ b(&have_js_function);
+ __ b(&call);
}
« no previous file with comments | « src/full-codegen/ppc/full-codegen-ppc.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698