Index: src/s390/code-stubs-s390.cc |
diff --git a/src/s390/code-stubs-s390.cc b/src/s390/code-stubs-s390.cc |
index 18281d1c87cdcbcca0e97c120ac658f803795618..32d665e0a7d4934f66f708bc0a612cc7468d61bf 100644 |
--- a/src/s390/code-stubs-s390.cc |
+++ b/src/s390/code-stubs-s390.cc |
@@ -1860,188 +1860,6 @@ void CallConstructStub::Generate(MacroAssembler* masm) { |
__ Jump(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); |
} |
-// Note: feedback_vector and slot are clobbered after the call. |
-static void IncrementCallCount(MacroAssembler* masm, Register feedback_vector, |
- Register slot, Register temp) { |
- const int count_offset = FixedArray::kHeaderSize + kPointerSize; |
- __ SmiToPtrArrayOffset(temp, slot); |
- __ AddP(feedback_vector, feedback_vector, temp); |
- __ LoadP(slot, FieldMemOperand(feedback_vector, count_offset)); |
- __ AddSmiLiteral(slot, slot, Smi::FromInt(1), temp); |
- __ StoreP(slot, FieldMemOperand(feedback_vector, count_offset), temp); |
-} |
- |
-void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) { |
- // r2 - number of arguments |
- // r3 - function |
- // r5 - slot id |
- // r4 - vector |
- // r6 - allocation site (loaded from vector[slot]) |
- __ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, r7); |
- __ CmpP(r3, r7); |
- __ bne(miss); |
- |
- // Increment the call count for monomorphic function calls. |
- IncrementCallCount(masm, r4, r5, r1); |
- |
- __ LoadRR(r4, r6); |
- __ LoadRR(r5, r3); |
- ArrayConstructorStub stub(masm->isolate()); |
- __ TailCallStub(&stub); |
-} |
- |
-void CallICStub::Generate(MacroAssembler* masm) { |
- // r2 - number of arguments |
- // r3 - function |
- // r5 - slot id (Smi) |
- // r4 - vector |
- Label extra_checks_or_miss, call, call_function, call_count_incremented; |
- |
- // The checks. First, does r3 match the recorded monomorphic target? |
- __ SmiToPtrArrayOffset(r8, r5); |
- __ AddP(r8, r4, r8); |
- __ LoadP(r6, FieldMemOperand(r8, FixedArray::kHeaderSize)); |
- |
- // We don't know that we have a weak cell. We might have a private symbol |
- // or an AllocationSite, but the memory is safe to examine. |
- // AllocationSite::kTransitionInfoOffset - contains a Smi or pointer to |
- // FixedArray. |
- // WeakCell::kValueOffset - contains a JSFunction or Smi(0) |
- // Symbol::kHashFieldSlot - if the low bit is 1, then the hash is not |
- // computed, meaning that it can't appear to be a pointer. If the low bit is |
- // 0, then hash is computed, but the 0 bit prevents the field from appearing |
- // to be a pointer. |
- STATIC_ASSERT(WeakCell::kSize >= kPointerSize); |
- STATIC_ASSERT(AllocationSite::kTransitionInfoOffset == |
- WeakCell::kValueOffset && |
- WeakCell::kValueOffset == Symbol::kHashFieldSlot); |
- |
- __ LoadP(r7, FieldMemOperand(r6, WeakCell::kValueOffset)); |
- __ CmpP(r3, r7); |
- __ bne(&extra_checks_or_miss, Label::kNear); |
- |
- // The compare above could have been a SMI/SMI comparison. Guard against this |
- // convincing us that we have a monomorphic JSFunction. |
- __ JumpIfSmi(r3, &extra_checks_or_miss); |
- |
- __ bind(&call_function); |
- |
- // Increment the call count for monomorphic function calls. |
- IncrementCallCount(masm, r4, r5, r1); |
- |
- __ Jump(masm->isolate()->builtins()->CallFunction(convert_mode(), |
- tail_call_mode()), |
- RelocInfo::CODE_TARGET); |
- |
- __ bind(&extra_checks_or_miss); |
- Label uninitialized, miss, not_allocation_site; |
- |
- __ CompareRoot(r6, Heap::kmegamorphic_symbolRootIndex); |
- __ beq(&call); |
- |
- // Verify that r6 contains an AllocationSite |
- __ LoadP(r7, FieldMemOperand(r6, HeapObject::kMapOffset)); |
- __ CompareRoot(r7, Heap::kAllocationSiteMapRootIndex); |
- __ bne(¬_allocation_site); |
- |
- // We have an allocation site. |
- HandleArrayCase(masm, &miss); |
- |
- __ bind(¬_allocation_site); |
- |
- // The following cases attempt to handle MISS cases without going to the |
- // runtime. |
- if (FLAG_trace_ic) { |
- __ b(&miss); |
- } |
- |
- __ CompareRoot(r6, Heap::kuninitialized_symbolRootIndex); |
- __ beq(&uninitialized); |
- |
- // We are going megamorphic. If the feedback is a JSFunction, it is fine |
- // to handle it here. More complex cases are dealt with in the runtime. |
- __ AssertNotSmi(r6); |
- __ CompareObjectType(r6, r7, r7, JS_FUNCTION_TYPE); |
- __ bne(&miss); |
- __ LoadRoot(ip, Heap::kmegamorphic_symbolRootIndex); |
- __ StoreP(ip, FieldMemOperand(r8, FixedArray::kHeaderSize), r0); |
- |
- __ bind(&call); |
- |
- // Increment the call count for megamorphic function calls. |
- IncrementCallCount(masm, r4, r5, r1); |
- |
- __ bind(&call_count_incremented); |
- __ Jump(masm->isolate()->builtins()->Call(convert_mode(), tail_call_mode()), |
- RelocInfo::CODE_TARGET); |
- |
- __ bind(&uninitialized); |
- |
- // We are going monomorphic, provided we actually have a JSFunction. |
- __ JumpIfSmi(r3, &miss); |
- |
- // Goto miss case if we do not have a function. |
- __ CompareObjectType(r3, r6, r6, JS_FUNCTION_TYPE); |
- __ bne(&miss); |
- |
- // Make sure the function is not the Array() function, which requires special |
- // behavior on MISS. |
- __ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, r6); |
- __ CmpP(r3, r6); |
- __ beq(&miss); |
- |
- // Make sure the function belongs to the same native context. |
- __ LoadP(r6, FieldMemOperand(r3, JSFunction::kContextOffset)); |
- __ LoadP(r6, ContextMemOperand(r6, Context::NATIVE_CONTEXT_INDEX)); |
- __ LoadP(ip, NativeContextMemOperand()); |
- __ CmpP(r6, ip); |
- __ bne(&miss); |
- |
- // Store the function. Use a stub since we need a frame for allocation. |
- // r4 - vector |
- // r5 - slot |
- // r3 - function |
- { |
- FrameScope scope(masm, StackFrame::INTERNAL); |
- CreateWeakCellStub create_stub(masm->isolate()); |
- __ SmiTag(r2); |
- __ Push(r2, r4, r5, cp, r3); |
- __ CallStub(&create_stub); |
- __ Pop(r4, r5, cp, r3); |
- __ Pop(r2); |
- __ SmiUntag(r2); |
- } |
- |
- __ b(&call_function); |
- |
- // We are here because tracing is on or we encountered a MISS case we can't |
- // handle here. |
- __ bind(&miss); |
- GenerateMiss(masm); |
- |
- __ b(&call_count_incremented); |
-} |
- |
-void CallICStub::GenerateMiss(MacroAssembler* masm) { |
- FrameScope scope(masm, StackFrame::INTERNAL); |
- |
- // Preserve the number of arguments as Smi. |
- __ SmiTag(r2); |
- |
- // Push the receiver and the function and feedback info. |
- __ Push(r2, r3, r4, r5); |
- |
- // Call the entry. |
- __ CallRuntime(Runtime::kCallIC_Miss); |
- |
- // Move result to r3 and exit the internal frame. |
- __ LoadRR(r3, r2); |
- |
- // Restore number of arguments. |
- __ Pop(r2); |
- __ SmiUntag(r2); |
-} |
- |
// StringCharCodeAtGenerator |
void StringCharCodeAtGenerator::GenerateFast(MacroAssembler* masm) { |
// If the receiver is a smi trigger the non-string case. |