diff options
author | Michaël Zasso <targos@protonmail.com> | 2016-12-23 16:30:57 +0100 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2017-01-26 22:46:17 +0100 |
commit | 2739185b790e040c3b044c577327f5d44bffad4a (patch) | |
tree | 29a466999212f4c85958379d9d400eec8a185ba5 /deps/v8/src/ppc | |
parent | a67a04d7654faaa04c8da00e42981ebc9fd0911c (diff) | |
download | android-node-v8-2739185b790e040c3b044c577327f5d44bffad4a.tar.gz android-node-v8-2739185b790e040c3b044c577327f5d44bffad4a.tar.bz2 android-node-v8-2739185b790e040c3b044c577327f5d44bffad4a.zip |
deps: update V8 to 5.5.372.40
PR-URL: https://github.com/nodejs/node/pull/9618
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'deps/v8/src/ppc')
-rw-r--r-- | deps/v8/src/ppc/code-stubs-ppc.cc | 366 | ||||
-rw-r--r-- | deps/v8/src/ppc/interface-descriptors-ppc.cc | 26 | ||||
-rw-r--r-- | deps/v8/src/ppc/macro-assembler-ppc.cc | 8 | ||||
-rw-r--r-- | deps/v8/src/ppc/macro-assembler-ppc.h | 12 | ||||
-rw-r--r-- | deps/v8/src/ppc/simulator-ppc.cc | 20 | ||||
-rw-r--r-- | deps/v8/src/ppc/simulator-ppc.h | 16 |
6 files changed, 86 insertions, 362 deletions
diff --git a/deps/v8/src/ppc/code-stubs-ppc.cc b/deps/v8/src/ppc/code-stubs-ppc.cc index 6dd897b031..ce423ea53a 100644 --- a/deps/v8/src/ppc/code-stubs-ppc.cc +++ b/deps/v8/src/ppc/code-stubs-ppc.cc @@ -1719,7 +1719,6 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { // r5 : feedback vector // r6 : slot in feedback vector (Smi) Label initialize, done, miss, megamorphic, not_array_function; - Label done_initialize_count, done_increment_count; DCHECK_EQ(*TypeFeedbackVector::MegamorphicSentinel(masm->isolate()), masm->isolate()->heap()->megamorphic_symbol()); @@ -1742,7 +1741,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { Register weak_value = r10; __ LoadP(weak_value, FieldMemOperand(r8, WeakCell::kValueOffset)); __ cmp(r4, weak_value); - __ beq(&done_increment_count); + __ beq(&done); __ CompareRoot(r8, Heap::kmegamorphic_symbolRootIndex); __ beq(&done); __ LoadP(feedback_map, FieldMemOperand(r8, HeapObject::kMapOffset)); @@ -1765,7 +1764,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { __ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, r8); __ cmp(r4, r8); __ bne(&megamorphic); - __ b(&done_increment_count); + __ b(&done); __ bind(&miss); @@ -1795,32 +1794,22 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { // slot. CreateAllocationSiteStub create_stub(masm->isolate()); CallStubInRecordCallTarget(masm, &create_stub); - __ b(&done_initialize_count); + __ b(&done); __ bind(¬_array_function); CreateWeakCellStub weak_cell_stub(masm->isolate()); CallStubInRecordCallTarget(masm, &weak_cell_stub); - __ bind(&done_initialize_count); - // Initialize the call counter. - __ LoadSmiLiteral(r8, Smi::FromInt(1)); - __ SmiToPtrArrayOffset(r7, r6); - __ add(r7, r5, r7); - __ StoreP(r8, FieldMemOperand(r7, count_offset), r0); - __ b(&done); - - __ bind(&done_increment_count); + __ bind(&done); - // Increment the call count for monomorphic function calls. + // Increment the call count for all function calls. __ SmiToPtrArrayOffset(r8, r6); __ add(r8, r5, r8); __ LoadP(r7, FieldMemOperand(r8, count_offset)); __ AddSmiLiteral(r7, r7, Smi::FromInt(1), r0); __ StoreP(r7, FieldMemOperand(r8, count_offset), r0); - - __ bind(&done); } @@ -1872,6 +1861,16 @@ 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); + __ add(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) { // r4 - function @@ -1885,12 +1884,7 @@ void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) { __ mov(r3, Operand(arg_count())); // Increment the call count for monomorphic function calls. - const int count_offset = FixedArray::kHeaderSize + kPointerSize; - __ SmiToPtrArrayOffset(r8, r6); - __ add(r5, r5, r8); - __ LoadP(r6, FieldMemOperand(r5, count_offset)); - __ AddSmiLiteral(r6, r6, Smi::FromInt(1), r0); - __ StoreP(r6, FieldMemOperand(r5, count_offset), r0); + IncrementCallCount(masm, r5, r6, r0); __ mr(r5, r7); __ mr(r6, r4); @@ -1903,7 +1897,7 @@ void CallICStub::Generate(MacroAssembler* masm) { // r4 - function // r6 - slot id (Smi) // r5 - vector - Label extra_checks_or_miss, call, call_function; + Label extra_checks_or_miss, call, call_function, call_count_incremented; int argc = arg_count(); ParameterCount actual(argc); @@ -1934,13 +1928,11 @@ void CallICStub::Generate(MacroAssembler* masm) { // convincing us that we have a monomorphic JSFunction. __ JumpIfSmi(r4, &extra_checks_or_miss); + __ bind(&call_function); + // Increment the call count for monomorphic function calls. - const int count_offset = FixedArray::kHeaderSize + kPointerSize; - __ LoadP(r6, FieldMemOperand(r9, count_offset)); - __ AddSmiLiteral(r6, r6, Smi::FromInt(1), r0); - __ StoreP(r6, FieldMemOperand(r9, count_offset), r0); + IncrementCallCount(masm, r5, r6, r0); - __ bind(&call_function); __ mov(r3, Operand(argc)); __ Jump(masm->isolate()->builtins()->CallFunction(convert_mode(), tail_call_mode()), @@ -1980,6 +1972,11 @@ void CallICStub::Generate(MacroAssembler* masm) { __ StoreP(ip, FieldMemOperand(r9, FixedArray::kHeaderSize), r0); __ bind(&call); + + // Increment the call count for megamorphic function calls. + IncrementCallCount(masm, r5, r6, r0); + + __ bind(&call_count_incremented); __ mov(r3, Operand(argc)); __ Jump(masm->isolate()->builtins()->Call(convert_mode(), tail_call_mode()), RelocInfo::CODE_TARGET); @@ -2006,10 +2003,6 @@ void CallICStub::Generate(MacroAssembler* masm) { __ cmp(r7, ip); __ bne(&miss); - // Initialize the call counter. - __ LoadSmiLiteral(r8, Smi::FromInt(1)); - __ StoreP(r8, FieldMemOperand(r9, count_offset), r0); - // Store the function. Use a stub since we need a frame for allocation. // r5 - vector // r6 - slot @@ -2017,9 +2010,13 @@ void CallICStub::Generate(MacroAssembler* masm) { { FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); CreateWeakCellStub create_stub(masm->isolate()); + __ Push(r5); + __ Push(r6); __ Push(cp, r4); __ CallStub(&create_stub); __ Pop(cp, r4); + __ Pop(r6); + __ Pop(r5); } __ b(&call_function); @@ -2029,7 +2026,7 @@ void CallICStub::Generate(MacroAssembler* masm) { __ bind(&miss); GenerateMiss(masm); - __ b(&call); + __ b(&call_count_incremented); } @@ -2211,290 +2208,6 @@ void StringHelper::GenerateCopyCharacters(MacroAssembler* masm, Register dest, } -void SubStringStub::Generate(MacroAssembler* masm) { - Label runtime; - - // Stack frame on entry. - // lr: return address - // sp[0]: to - // sp[4]: from - // sp[8]: string - - // This stub is called from the native-call %_SubString(...), so - // nothing can be assumed about the arguments. It is tested that: - // "string" is a sequential string, - // both "from" and "to" are smis, and - // 0 <= from <= to <= string.length. - // If any of these assumptions fail, we call the runtime system. - - const int kToOffset = 0 * kPointerSize; - const int kFromOffset = 1 * kPointerSize; - const int kStringOffset = 2 * kPointerSize; - - __ LoadP(r5, MemOperand(sp, kToOffset)); - __ LoadP(r6, MemOperand(sp, kFromOffset)); - - // If either to or from had the smi tag bit set, then fail to generic runtime - __ JumpIfNotSmi(r5, &runtime); - __ JumpIfNotSmi(r6, &runtime); - __ SmiUntag(r5); - __ SmiUntag(r6, SetRC); - // Both r5 and r6 are untagged integers. - - // We want to bailout to runtime here if From is negative. - __ blt(&runtime, cr0); // From < 0. - - __ cmpl(r6, r5); - __ bgt(&runtime); // Fail if from > to. - __ sub(r5, r5, r6); - - // Make sure first argument is a string. - __ LoadP(r3, MemOperand(sp, kStringOffset)); - __ JumpIfSmi(r3, &runtime); - Condition is_string = masm->IsObjectStringType(r3, r4); - __ b(NegateCondition(is_string), &runtime, cr0); - - Label single_char; - __ cmpi(r5, Operand(1)); - __ b(eq, &single_char); - - // Short-cut for the case of trivial substring. - Label return_r3; - // r3: original string - // r5: result string length - __ LoadP(r7, FieldMemOperand(r3, String::kLengthOffset)); - __ SmiUntag(r0, r7); - __ cmpl(r5, r0); - // Return original string. - __ beq(&return_r3); - // Longer than original string's length or negative: unsafe arguments. - __ bgt(&runtime); - // Shorter than original string's length: an actual substring. - - // Deal with different string types: update the index if necessary - // and put the underlying string into r8. - // r3: original string - // r4: instance type - // r5: length - // r6: from index (untagged) - Label underlying_unpacked, sliced_string, seq_or_external_string; - // If the string is not indirect, it can only be sequential or external. - STATIC_ASSERT(kIsIndirectStringMask == (kSlicedStringTag & kConsStringTag)); - STATIC_ASSERT(kIsIndirectStringMask != 0); - __ andi(r0, r4, Operand(kIsIndirectStringMask)); - __ beq(&seq_or_external_string, cr0); - - __ andi(r0, r4, Operand(kSlicedNotConsMask)); - __ bne(&sliced_string, cr0); - // Cons string. Check whether it is flat, then fetch first part. - __ LoadP(r8, FieldMemOperand(r3, ConsString::kSecondOffset)); - __ CompareRoot(r8, Heap::kempty_stringRootIndex); - __ bne(&runtime); - __ LoadP(r8, FieldMemOperand(r3, ConsString::kFirstOffset)); - // Update instance type. - __ LoadP(r4, FieldMemOperand(r8, HeapObject::kMapOffset)); - __ lbz(r4, FieldMemOperand(r4, Map::kInstanceTypeOffset)); - __ b(&underlying_unpacked); - - __ bind(&sliced_string); - // Sliced string. Fetch parent and correct start index by offset. - __ LoadP(r8, FieldMemOperand(r3, SlicedString::kParentOffset)); - __ LoadP(r7, FieldMemOperand(r3, SlicedString::kOffsetOffset)); - __ SmiUntag(r4, r7); - __ add(r6, r6, r4); // Add offset to index. - // Update instance type. - __ LoadP(r4, FieldMemOperand(r8, HeapObject::kMapOffset)); - __ lbz(r4, FieldMemOperand(r4, Map::kInstanceTypeOffset)); - __ b(&underlying_unpacked); - - __ bind(&seq_or_external_string); - // Sequential or external string. Just move string to the expected register. - __ mr(r8, r3); - - __ bind(&underlying_unpacked); - - if (FLAG_string_slices) { - Label copy_routine; - // r8: underlying subject string - // r4: instance type of underlying subject string - // r5: length - // r6: adjusted start index (untagged) - __ cmpi(r5, Operand(SlicedString::kMinLength)); - // Short slice. Copy instead of slicing. - __ blt(©_routine); - // Allocate new sliced string. At this point we do not reload the instance - // type including the string encoding because we simply rely on the info - // provided by the original string. It does not matter if the original - // string's encoding is wrong because we always have to recheck encoding of - // the newly created string's parent anyways due to externalized strings. - Label two_byte_slice, set_slice_header; - STATIC_ASSERT((kStringEncodingMask & kOneByteStringTag) != 0); - STATIC_ASSERT((kStringEncodingMask & kTwoByteStringTag) == 0); - __ andi(r0, r4, Operand(kStringEncodingMask)); - __ beq(&two_byte_slice, cr0); - __ AllocateOneByteSlicedString(r3, r5, r9, r10, &runtime); - __ b(&set_slice_header); - __ bind(&two_byte_slice); - __ AllocateTwoByteSlicedString(r3, r5, r9, r10, &runtime); - __ bind(&set_slice_header); - __ SmiTag(r6); - __ StoreP(r8, FieldMemOperand(r3, SlicedString::kParentOffset), r0); - __ StoreP(r6, FieldMemOperand(r3, SlicedString::kOffsetOffset), r0); - __ b(&return_r3); - - __ bind(©_routine); - } - - // r8: underlying subject string - // r4: instance type of underlying subject string - // r5: length - // r6: adjusted start index (untagged) - Label two_byte_sequential, sequential_string, allocate_result; - STATIC_ASSERT(kExternalStringTag != 0); - STATIC_ASSERT(kSeqStringTag == 0); - __ andi(r0, r4, Operand(kExternalStringTag)); - __ beq(&sequential_string, cr0); - - // Handle external string. - // Rule out short external strings. - STATIC_ASSERT(kShortExternalStringTag != 0); - __ andi(r0, r4, Operand(kShortExternalStringTag)); - __ bne(&runtime, cr0); - __ LoadP(r8, FieldMemOperand(r8, ExternalString::kResourceDataOffset)); - // r8 already points to the first character of underlying string. - __ b(&allocate_result); - - __ bind(&sequential_string); - // Locate first character of underlying subject string. - STATIC_ASSERT(SeqTwoByteString::kHeaderSize == SeqOneByteString::kHeaderSize); - __ addi(r8, r8, Operand(SeqOneByteString::kHeaderSize - kHeapObjectTag)); - - __ bind(&allocate_result); - // Sequential acii string. Allocate the result. - STATIC_ASSERT((kOneByteStringTag & kStringEncodingMask) != 0); - __ andi(r0, r4, Operand(kStringEncodingMask)); - __ beq(&two_byte_sequential, cr0); - - // Allocate and copy the resulting one-byte string. - __ AllocateOneByteString(r3, r5, r7, r9, r10, &runtime); - - // Locate first character of substring to copy. - __ add(r8, r8, r6); - // Locate first character of result. - __ addi(r4, r3, Operand(SeqOneByteString::kHeaderSize - kHeapObjectTag)); - - // r3: result string - // r4: first character of result string - // r5: result string length - // r8: first character of substring to copy - STATIC_ASSERT((SeqOneByteString::kHeaderSize & kObjectAlignmentMask) == 0); - StringHelper::GenerateCopyCharacters(masm, r4, r8, r5, r6, - String::ONE_BYTE_ENCODING); - __ b(&return_r3); - - // Allocate and copy the resulting two-byte string. - __ bind(&two_byte_sequential); - __ AllocateTwoByteString(r3, r5, r7, r9, r10, &runtime); - - // Locate first character of substring to copy. - __ ShiftLeftImm(r4, r6, Operand(1)); - __ add(r8, r8, r4); - // Locate first character of result. - __ addi(r4, r3, Operand(SeqTwoByteString::kHeaderSize - kHeapObjectTag)); - - // r3: result string. - // r4: first character of result. - // r5: result length. - // r8: first character of substring to copy. - STATIC_ASSERT((SeqTwoByteString::kHeaderSize & kObjectAlignmentMask) == 0); - StringHelper::GenerateCopyCharacters(masm, r4, r8, r5, r6, - String::TWO_BYTE_ENCODING); - - __ bind(&return_r3); - Counters* counters = isolate()->counters(); - __ IncrementCounter(counters->sub_string_native(), 1, r6, r7); - __ Drop(3); - __ Ret(); - - // Just jump to runtime to create the sub string. - __ bind(&runtime); - __ TailCallRuntime(Runtime::kSubString); - - __ bind(&single_char); - // r3: original string - // r4: instance type - // r5: length - // r6: from index (untagged) - __ SmiTag(r6, r6); - StringCharAtGenerator generator(r3, r6, r5, r3, &runtime, &runtime, &runtime, - RECEIVER_IS_STRING); - generator.GenerateFast(masm); - __ Drop(3); - __ Ret(); - generator.SkipSlow(masm, &runtime); -} - -void ToStringStub::Generate(MacroAssembler* masm) { - // The ToString stub takes one argument in r3. - Label is_number; - __ JumpIfSmi(r3, &is_number); - - __ CompareObjectType(r3, r4, r4, FIRST_NONSTRING_TYPE); - // r3: receiver - // r4: receiver instance type - __ Ret(lt); - - Label not_heap_number; - __ cmpi(r4, Operand(HEAP_NUMBER_TYPE)); - __ bne(¬_heap_number); - __ bind(&is_number); - NumberToStringStub stub(isolate()); - __ TailCallStub(&stub); - __ bind(¬_heap_number); - - Label not_oddball; - __ cmpi(r4, Operand(ODDBALL_TYPE)); - __ bne(¬_oddball); - __ LoadP(r3, FieldMemOperand(r3, Oddball::kToStringOffset)); - __ Ret(); - __ bind(¬_oddball); - - __ push(r3); // Push argument. - __ TailCallRuntime(Runtime::kToString); -} - - -void ToNameStub::Generate(MacroAssembler* masm) { - // The ToName stub takes one argument in r3. - Label is_number; - __ JumpIfSmi(r3, &is_number); - - STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE); - __ CompareObjectType(r3, r4, r4, LAST_NAME_TYPE); - // r3: receiver - // r4: receiver instance type - __ Ret(le); - - Label not_heap_number; - __ cmpi(r4, Operand(HEAP_NUMBER_TYPE)); - __ bne(¬_heap_number); - __ bind(&is_number); - NumberToStringStub stub(isolate()); - __ TailCallStub(&stub); - __ bind(¬_heap_number); - - Label not_oddball; - __ cmpi(r4, Operand(ODDBALL_TYPE)); - __ bne(¬_oddball); - __ LoadP(r3, FieldMemOperand(r3, Oddball::kToStringOffset)); - __ Ret(); - __ bind(¬_oddball); - - __ push(r3); // Push argument. - __ TailCallRuntime(Runtime::kToName); -} - - void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, Register left, Register right, @@ -3407,19 +3120,6 @@ void RecordWriteStub::CheckNeedsToInformIncrementalMarker( Label need_incremental; Label need_incremental_pop_scratch; - DCHECK((~Page::kPageAlignmentMask & 0xffff) == 0); - __ lis(r0, Operand((~Page::kPageAlignmentMask >> 16))); - __ and_(regs_.scratch0(), regs_.object(), r0); - __ LoadP( - regs_.scratch1(), - MemOperand(regs_.scratch0(), MemoryChunk::kWriteBarrierCounterOffset)); - __ subi(regs_.scratch1(), regs_.scratch1(), Operand(1)); - __ StoreP( - regs_.scratch1(), - MemOperand(regs_.scratch0(), MemoryChunk::kWriteBarrierCounterOffset)); - __ cmpi(regs_.scratch1(), Operand::Zero()); // PPC, we could do better here - __ blt(&need_incremental); - // Let's look at the color of the object: If it is not black we don't have // to inform the incremental marker. __ JumpIfBlack(regs_.object(), regs_.scratch0(), regs_.scratch1(), &on_black); @@ -3854,7 +3554,7 @@ static void HandlePolymorphicStoreCase(MacroAssembler* masm, Register feedback, __ LoadP(receiver_map, MemOperand(pointer_reg, kPointerSize * 2)); // Load the map into the correct register. - DCHECK(feedback.is(VectorStoreTransitionDescriptor::MapRegister())); + DCHECK(feedback.is(StoreTransitionDescriptor::MapRegister())); __ mr(feedback, too_far); __ addi(ip, receiver_map, Operand(Code::kHeaderSize - kHeapObjectTag)); @@ -4581,7 +4281,7 @@ void FastNewRestParameterStub::Generate(MacroAssembler* masm) { // Fall back to %AllocateInNewSpace (if not too big). Label too_big_for_new_space; __ bind(&allocate); - __ Cmpi(r10, Operand(Page::kMaxRegularHeapObjectSize), r0); + __ Cmpi(r10, Operand(kMaxRegularHeapObjectSize), r0); __ bgt(&too_big_for_new_space); { FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); @@ -4972,7 +4672,7 @@ void FastNewStrictArgumentsStub::Generate(MacroAssembler* masm) { // Fall back to %AllocateInNewSpace (if not too big). Label too_big_for_new_space; __ bind(&allocate); - __ Cmpi(r10, Operand(Page::kMaxRegularHeapObjectSize), r0); + __ Cmpi(r10, Operand(kMaxRegularHeapObjectSize), r0); __ bgt(&too_big_for_new_space); { FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); diff --git a/deps/v8/src/ppc/interface-descriptors-ppc.cc b/deps/v8/src/ppc/interface-descriptors-ppc.cc index bc188f4be1..3ff0fde047 100644 --- a/deps/v8/src/ppc/interface-descriptors-ppc.cc +++ b/deps/v8/src/ppc/interface-descriptors-ppc.cc @@ -40,13 +40,9 @@ const Register StoreDescriptor::SlotRegister() { return r7; } const Register StoreWithVectorDescriptor::VectorRegister() { return r6; } -const Register VectorStoreTransitionDescriptor::SlotRegister() { return r7; } -const Register VectorStoreTransitionDescriptor::VectorRegister() { return r6; } -const Register VectorStoreTransitionDescriptor::MapRegister() { return r8; } - - -const Register StoreTransitionDescriptor::MapRegister() { return r6; } - +const Register StoreTransitionDescriptor::SlotRegister() { return r7; } +const Register StoreTransitionDescriptor::VectorRegister() { return r6; } +const Register StoreTransitionDescriptor::MapRegister() { return r8; } const Register StoreGlobalViaContextDescriptor::SlotRegister() { return r5; } const Register StoreGlobalViaContextDescriptor::ValueRegister() { return r3; } @@ -355,7 +351,7 @@ void ArgumentAdaptorDescriptor::InitializePlatformSpecific( data->InitializePlatformSpecific(arraysize(registers), registers); } -void ApiCallbackDescriptorBase::InitializePlatformSpecific( +void ApiCallbackDescriptor::InitializePlatformSpecific( CallInterfaceDescriptorData* data) { Register registers[] = { r3, // callee @@ -390,7 +386,19 @@ void InterpreterPushArgsAndConstructDescriptor::InitializePlatformSpecific( r3, // argument count (not including receiver) r6, // new target r4, // constructor to call - r5 // address of the first argument + r5, // allocation site feedback if available, undefined otherwise + r7 // address of the first argument + }; + data->InitializePlatformSpecific(arraysize(registers), registers); +} + +void InterpreterPushArgsAndConstructArrayDescriptor::InitializePlatformSpecific( + CallInterfaceDescriptorData* data) { + Register registers[] = { + r3, // argument count (not including receiver) + r4, // target to call checked to be Array function + r5, // allocation site feedback if available, undefined otherwise + r6 // address of the first argument }; data->InitializePlatformSpecific(arraysize(registers), registers); } diff --git a/deps/v8/src/ppc/macro-assembler-ppc.cc b/deps/v8/src/ppc/macro-assembler-ppc.cc index 4e39d967af..9b5f80ebe9 100644 --- a/deps/v8/src/ppc/macro-assembler-ppc.cc +++ b/deps/v8/src/ppc/macro-assembler-ppc.cc @@ -282,9 +282,7 @@ void MacroAssembler::StoreRoot(Register source, Heap::RootListIndex index, void MacroAssembler::InNewSpace(Register object, Register scratch, Condition cond, Label* branch) { DCHECK(cond == eq || cond == ne); - const int mask = - (1 << MemoryChunk::IN_FROM_SPACE) | (1 << MemoryChunk::IN_TO_SPACE); - CheckPageFlag(object, scratch, mask, cond, branch); + CheckPageFlag(object, scratch, MemoryChunk::kIsInNewSpaceMask, cond, branch); } @@ -1814,7 +1812,7 @@ void MacroAssembler::LoadFromNumberDictionary(Label* miss, Register elements, void MacroAssembler::Allocate(int object_size, Register result, Register scratch1, Register scratch2, Label* gc_required, AllocationFlags flags) { - DCHECK(object_size <= Page::kMaxRegularHeapObjectSize); + DCHECK(object_size <= kMaxRegularHeapObjectSize); DCHECK((flags & ALLOCATION_FOLDED) == 0); if (!FLAG_inline_new) { if (emit_debug_code()) { @@ -2070,7 +2068,7 @@ void MacroAssembler::FastAllocate(Register object_size, Register result, void MacroAssembler::FastAllocate(int object_size, Register result, Register scratch1, Register scratch2, AllocationFlags flags) { - DCHECK(object_size <= Page::kMaxRegularHeapObjectSize); + DCHECK(object_size <= kMaxRegularHeapObjectSize); DCHECK(!AreAliased(result, scratch1, scratch2, ip)); // Make object size into bytes. diff --git a/deps/v8/src/ppc/macro-assembler-ppc.h b/deps/v8/src/ppc/macro-assembler-ppc.h index cf9d4b5719..ba4d277688 100644 --- a/deps/v8/src/ppc/macro-assembler-ppc.h +++ b/deps/v8/src/ppc/macro-assembler-ppc.h @@ -140,6 +140,18 @@ class MacroAssembler : public Assembler { void Ret() { blr(); } void Ret(Condition cond, CRegister cr = cr7) { bclr(cond, cr); } + // Emit code that loads |parameter_index|'th parameter from the stack to + // the register according to the CallInterfaceDescriptor definition. + // |sp_to_caller_sp_offset_in_words| specifies the number of words pushed + // below the caller's sp. + template <class Descriptor> + void LoadParameterFromStack( + Register reg, typename Descriptor::ParameterIndices parameter_index, + int sp_to_ra_offset_in_words = 0) { + DCHECK(Descriptor::kPassLastArgsOnStack); + UNIMPLEMENTED(); + } + // Emit code to discard a non-negative number of pointer-sized elements // from the stack, clobbering only the sp register. void Drop(int count); diff --git a/deps/v8/src/ppc/simulator-ppc.cc b/deps/v8/src/ppc/simulator-ppc.cc index 2816a87751..84fbb399b3 100644 --- a/deps/v8/src/ppc/simulator-ppc.cc +++ b/deps/v8/src/ppc/simulator-ppc.cc @@ -658,9 +658,8 @@ void Simulator::set_last_debugger_input(char* input) { last_debugger_input_ = input; } - -void Simulator::FlushICache(base::HashMap* i_cache, void* start_addr, - size_t size) { +void Simulator::FlushICache(base::CustomMatcherHashMap* i_cache, + void* start_addr, size_t size) { intptr_t start = reinterpret_cast<intptr_t>(start_addr); int intra_line = (start & CachePage::kLineMask); start -= intra_line; @@ -680,8 +679,8 @@ void Simulator::FlushICache(base::HashMap* i_cache, void* start_addr, } } - -CachePage* Simulator::GetCachePage(base::HashMap* i_cache, void* page) { +CachePage* Simulator::GetCachePage(base::CustomMatcherHashMap* i_cache, + void* page) { base::HashMap::Entry* entry = i_cache->LookupOrInsert(page, ICacheHash(page)); if (entry->value == NULL) { CachePage* new_page = new CachePage(); @@ -692,7 +691,8 @@ CachePage* Simulator::GetCachePage(base::HashMap* i_cache, void* page) { // Flush from start up to and not including start + size. -void Simulator::FlushOnePage(base::HashMap* i_cache, intptr_t start, int size) { +void Simulator::FlushOnePage(base::CustomMatcherHashMap* i_cache, + intptr_t start, int size) { DCHECK(size <= CachePage::kPageSize); DCHECK(AllOnOnePage(start, size - 1)); DCHECK((start & CachePage::kLineMask) == 0); @@ -704,7 +704,8 @@ void Simulator::FlushOnePage(base::HashMap* i_cache, intptr_t start, int size) { memset(valid_bytemap, CachePage::LINE_INVALID, size >> CachePage::kLineShift); } -void Simulator::CheckICache(base::HashMap* i_cache, Instruction* instr) { +void Simulator::CheckICache(base::CustomMatcherHashMap* i_cache, + Instruction* instr) { intptr_t address = reinterpret_cast<intptr_t>(instr); void* page = reinterpret_cast<void*>(address & (~CachePage::kPageMask)); void* line = reinterpret_cast<void*>(address & (~CachePage::kLineMask)); @@ -737,7 +738,7 @@ void Simulator::Initialize(Isolate* isolate) { Simulator::Simulator(Isolate* isolate) : isolate_(isolate) { i_cache_ = isolate_->simulator_i_cache(); if (i_cache_ == NULL) { - i_cache_ = new base::HashMap(&ICacheMatch); + i_cache_ = new base::CustomMatcherHashMap(&ICacheMatch); isolate_->set_simulator_i_cache(i_cache_); } Initialize(isolate); @@ -872,7 +873,8 @@ class Redirection { // static -void Simulator::TearDown(base::HashMap* i_cache, Redirection* first) { +void Simulator::TearDown(base::CustomMatcherHashMap* i_cache, + Redirection* first) { Redirection::DeleteChain(first); if (i_cache != nullptr) { for (base::HashMap::Entry* entry = i_cache->Start(); entry != nullptr; diff --git a/deps/v8/src/ppc/simulator-ppc.h b/deps/v8/src/ppc/simulator-ppc.h index d3163e8a50..d061545099 100644 --- a/deps/v8/src/ppc/simulator-ppc.h +++ b/deps/v8/src/ppc/simulator-ppc.h @@ -217,7 +217,7 @@ class Simulator { // Call on program start. static void Initialize(Isolate* isolate); - static void TearDown(base::HashMap* i_cache, Redirection* first); + static void TearDown(base::CustomMatcherHashMap* i_cache, Redirection* first); // V8 generally calls into generated JS code with 5 parameters and into // generated RegExp code with 7 parameters. This is a convenience function, @@ -239,7 +239,8 @@ class Simulator { char* last_debugger_input() { return last_debugger_input_; } // ICache checking. - static void FlushICache(base::HashMap* i_cache, void* start, size_t size); + static void FlushICache(base::CustomMatcherHashMap* i_cache, void* start, + size_t size); // Returns true if pc register contains one of the 'special_values' defined // below (bad_lr, end_sim_pc). @@ -329,9 +330,12 @@ class Simulator { void ExecuteInstruction(Instruction* instr); // ICache. - static void CheckICache(base::HashMap* i_cache, Instruction* instr); - static void FlushOnePage(base::HashMap* i_cache, intptr_t start, int size); - static CachePage* GetCachePage(base::HashMap* i_cache, void* page); + static void CheckICache(base::CustomMatcherHashMap* i_cache, + Instruction* instr); + static void FlushOnePage(base::CustomMatcherHashMap* i_cache, intptr_t start, + int size); + static CachePage* GetCachePage(base::CustomMatcherHashMap* i_cache, + void* page); // Runtime call support. static void* RedirectExternalReference( @@ -369,7 +373,7 @@ class Simulator { char* last_debugger_input_; // Icache simulation - base::HashMap* i_cache_; + base::CustomMatcherHashMap* i_cache_; // Registered breakpoints. Instruction* break_pc_; |