Commit 790c9221 authored by Martyn Capewell's avatar Martyn Capewell Committed by Commit Bot

[arm][arm64] Delete unused code from the macro assembler

Most of these functions have become unusued due to Crankshaft's removal, so
delete them.

Bug: 
Change-Id: If4724c78a0b5c7b6179b22eb4068acd95dfdd29e
Reviewed-on: https://chromium-review.googlesource.com/571011Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Martyn Capewell <martyn.capewell@arm.com>
Cr-Commit-Position: refs/heads/master@{#46699}
parent 0a3a52c5
......@@ -2355,47 +2355,6 @@ void TurboAssembler::TruncateDoubleToIDelayed(Zone* zone, Register result,
bind(&done);
}
void MacroAssembler::TruncateHeapNumberToI(Register result,
Register object) {
Label done;
LowDwVfpRegister double_scratch = kScratchDoubleReg;
DCHECK(!result.is(object));
vldr(double_scratch,
MemOperand(object, HeapNumber::kValueOffset - kHeapObjectTag));
TryInlineTruncateDoubleToI(result, double_scratch, &done);
// If we fell through then inline version didn't succeed - call stub instead.
push(lr);
DoubleToIStub stub(isolate(),
object,
result,
HeapNumber::kValueOffset - kHeapObjectTag,
true,
true);
CallStub(&stub);
pop(lr);
bind(&done);
}
void MacroAssembler::TruncateNumberToI(Register object,
Register result,
Register heap_number_map,
Register scratch1,
Label* not_number) {
Label done;
DCHECK(!result.is(object));
UntagAndJumpIfSmi(result, object, &done);
JumpIfNotHeapNumber(object, heap_number_map, scratch1, not_number);
TruncateHeapNumberToI(result, object);
bind(&done);
}
void MacroAssembler::GetLeastBitsFromSmi(Register dst,
Register src,
int num_least_bits) {
......@@ -2483,16 +2442,6 @@ void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin,
Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
}
void MacroAssembler::SetCounter(StatsCounter* counter, int value,
Register scratch1, Register scratch2) {
if (FLAG_native_code_counters && counter->Enabled()) {
mov(scratch1, Operand(value));
mov(scratch2, Operand(ExternalReference(counter)));
str(scratch1, MemOperand(scratch2));
}
}
void MacroAssembler::IncrementCounter(StatsCounter* counter, int value,
Register scratch1, Register scratch2) {
DCHECK(value > 0);
......@@ -2897,19 +2846,6 @@ void MacroAssembler::AllocateJSValue(Register result, Register constructor,
STATIC_ASSERT(JSValue::kSize == 4 * kPointerSize);
}
void MacroAssembler::InitializeFieldsWithFiller(Register current_address,
Register end_address,
Register filler) {
Label loop, entry;
b(&entry);
bind(&loop);
str(filler, MemOperand(current_address, kPointerSize, PostIndex));
bind(&entry);
cmp(current_address, end_address);
b(lo, &loop);
}
void MacroAssembler::CheckFor32DRegs(Register scratch) {
mov(scratch, Operand(ExternalReference::cpu_features()));
ldr(scratch, MemOperand(scratch));
......@@ -3112,53 +3048,6 @@ int TurboAssembler::CalculateStackPassedWords(int num_reg_arguments,
return stack_passed_words;
}
void MacroAssembler::EmitSeqStringSetCharCheck(Register string,
Register index,
Register value,
uint32_t encoding_mask) {
Label is_object;
SmiTst(string);
Check(ne, kNonObject);
{
UseScratchRegisterScope temps(this);
Register scratch = temps.Acquire();
ldr(scratch, FieldMemOperand(string, HeapObject::kMapOffset));
ldrb(scratch, FieldMemOperand(scratch, Map::kInstanceTypeOffset));
and_(scratch, scratch,
Operand(kStringRepresentationMask | kStringEncodingMask));
cmp(scratch, Operand(encoding_mask));
Check(eq, kUnexpectedStringType);
}
// The index is assumed to be untagged coming in, tag it to compare with the
// string length without using a temp register, it is restored at the end of
// this function.
Label index_tag_ok, index_tag_bad;
TrySmiTag(index, index, &index_tag_bad);
b(&index_tag_ok);
bind(&index_tag_bad);
Abort(kIndexIsTooLarge);
bind(&index_tag_ok);
{
UseScratchRegisterScope temps(this);
Register scratch = temps.Acquire();
ldr(scratch, FieldMemOperand(string, String::kLengthOffset));
cmp(index, scratch);
Check(lt, kIndexIsTooLarge);
}
cmp(index, Operand(Smi::kZero));
Check(ge, kIndexIsNegative);
SmiUntag(index, index);
}
void TurboAssembler::PrepareCallCFunction(int num_reg_arguments,
int num_double_arguments) {
int frame_alignment = ActivationFrameAlignment();
......@@ -3355,26 +3244,6 @@ void MacroAssembler::ClampUint8(Register output_reg, Register input_reg) {
}
void MacroAssembler::ClampDoubleToUint8(Register result_reg,
DwVfpRegister input_reg,
LowDwVfpRegister double_scratch) {
Label done;
// Handle inputs >= 255 (including +infinity).
Vmov(double_scratch, Double(255.0), result_reg);
mov(result_reg, Operand(255));
VFPCompareAndSetFlags(input_reg, double_scratch);
b(ge, &done);
// For inputs < 255 (including negative) vcvt_u32_f64 with round-to-nearest
// rounding mode will provide the correct result.
vcvt_u32_f64(double_scratch.low(), input_reg, kFPSCRRounding);
vmov(result_reg, double_scratch.low());
bind(&done);
}
void MacroAssembler::LoadInstanceDescriptors(Register map,
Register descriptors) {
ldr(descriptors, FieldMemOperand(map, Map::kDescriptorsOffset));
......@@ -3469,52 +3338,6 @@ void MacroAssembler::CheckEnumCache(Label* call_runtime) {
b(ne, &next);
}
void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver_reg,
Register scratch,
Label* no_memento_found) {
Label map_check;
Label top_check;
ExternalReference new_space_allocation_top_adr =
ExternalReference::new_space_allocation_top_address(isolate());
const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag;
const int kMementoLastWordOffset =
kMementoMapOffset + AllocationMemento::kSize - kPointerSize;
// Bail out if the object is not in new space.
JumpIfNotInNewSpace(receiver_reg, scratch, no_memento_found);
UseScratchRegisterScope temps(this);
Register new_space_top = temps.Acquire();
mov(new_space_top, Operand(new_space_allocation_top_adr));
ldr(new_space_top, MemOperand(new_space_top));
// If the object is in new space, we need to check whether it is on the same
// page as the current top.
add(scratch, receiver_reg, Operand(kMementoLastWordOffset));
eor(scratch, scratch, Operand(new_space_top));
tst(scratch, Operand(~Page::kPageAlignmentMask));
b(eq, &top_check);
// The object is on a different page than allocation top. Bail out if the
// object sits on the page boundary as no memento can follow and we cannot
// touch the memory following it.
add(scratch, receiver_reg, Operand(kMementoLastWordOffset));
eor(scratch, scratch, Operand(receiver_reg));
tst(scratch, Operand(~Page::kPageAlignmentMask));
b(ne, no_memento_found);
// Continue with the actual map check.
jmp(&map_check);
// If top is on the same page as the current object, we need to check whether
// we are below top.
bind(&top_check);
cmp(scratch, new_space_top);
b(ge, no_memento_found);
// Memento map check.
bind(&map_check);
ldr(scratch, MemOperand(receiver_reg, kMementoMapOffset));
cmp(scratch, Operand(isolate()->factory()->allocation_memento_map()));
}
Register GetRegisterThatIsNotOneOf(Register reg1,
Register reg2,
Register reg3,
......@@ -3612,29 +3435,6 @@ void CodePatcher::EmitCondition(Condition cond) {
masm_.emit(instr);
}
void MacroAssembler::TruncatingDiv(Register result,
Register dividend,
int32_t divisor) {
DCHECK(!dividend.is(result));
base::MagicNumbersForDivision<uint32_t> mag =
base::SignedDivisionByConstant(bit_cast<uint32_t>(divisor));
UseScratchRegisterScope temps(this);
Register scratch = temps.Acquire();
mov(scratch, Operand(mag.multiplier));
bool neg = (mag.multiplier & (1U << 31)) != 0;
if (divisor > 0 && neg) {
smmla(result, dividend, scratch, dividend);
} else {
smmul(result, dividend, scratch);
if (divisor < 0 && !neg && mag.multiplier > 0) {
sub(result, result, Operand(dividend));
}
}
if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift));
add(result, result, Operand(dividend, LSR, 31));
}
} // namespace internal
} // namespace v8
......
......@@ -905,12 +905,6 @@ class MacroAssembler : public TurboAssembler {
Register scratch1, Register scratch2,
Label* gc_required);
// Initialize fields with filler values. Fields starting at |current_address|
// not including |end_address| are overwritten with the value in |filler|. At
// the end the loop, |current_address| takes the value of |end_address|.
void InitializeFieldsWithFiller(Register current_address,
Register end_address, Register filler);
// ---------------------------------------------------------------------------
// Support functions.
......@@ -1038,21 +1032,6 @@ class MacroAssembler : public TurboAssembler {
Label* done,
Label* exact);
// Performs a truncating conversion of a heap number as used by
// the JS bitwise operations. See ECMA-262 9.5: ToInt32. 'result' and 'input'
// must be different registers. Exits with 'result' holding the answer.
void TruncateHeapNumberToI(Register result, Register object);
// Converts the smi or heap number in object to an int32 using the rules
// for ToInt32 as described in ECMAScript 9.5.: the value is truncated
// and brought into the range -2^31 .. +2^31 - 1. 'result' and 'input' must be
// different registers.
void TruncateNumberToI(Register object,
Register result,
Register heap_number_map,
Register scratch1,
Label* not_int32);
// Check whether d16-d31 are available on the CPU. The result is given by the
// Z condition flag: Z==0 if d16-d31 available, Z==1 otherwise.
void CheckFor32DRegs(Register scratch);
......@@ -1108,17 +1087,9 @@ class MacroAssembler : public TurboAssembler {
void JumpToExternalReference(const ExternalReference& builtin,
bool builtin_exit_frame = false);
// Emit code for a truncating division by a constant. The dividend register is
// unchanged and a scratch register needs to be available. Dividend and result
// must be different.
void TruncatingDiv(Register result, Register dividend, int32_t divisor);
// ---------------------------------------------------------------------------
// StatsCounter support
void SetCounter(StatsCounter* counter, int value,
Register scratch1, Register scratch2);
void IncrementCounter(StatsCounter* counter, int value,
Register scratch1, Register scratch2);
void DecrementCounter(StatsCounter* counter, int value,
......@@ -1240,19 +1211,8 @@ class MacroAssembler : public TurboAssembler {
void JumpIfNotUniqueNameInstanceType(Register reg, Label* not_unique_name);
void EmitSeqStringSetCharCheck(Register string,
Register index,
Register value,
uint32_t encoding_mask);
void ClampUint8(Register output_reg, Register input_reg);
void ClampDoubleToUint8(Register result_reg,
DwVfpRegister input_reg,
LowDwVfpRegister double_scratch);
void LoadInstanceDescriptors(Register map, Register descriptors);
void EnumLength(Register dst, Register map);
void NumberOfOwnDescriptors(Register dst, Register map);
......@@ -1287,16 +1247,6 @@ class MacroAssembler : public TurboAssembler {
// in r0. Assumes that any other register can be used as a scratch.
void CheckEnumCache(Label* call_runtime);
// AllocationMemento support. Arrays may have an associated
// AllocationMemento object that can be checked for in order to pretransition
// to another type.
// On entry, receiver_reg should point to the array object.
// scratch_reg gets clobbered.
// If allocation info is present, condition flags are set to eq.
void TestJSArrayForAllocationMemento(Register receiver_reg,
Register scratch_reg,
Label* no_memento_found);
private:
// Helper functions for generating invokes.
void InvokePrologue(const ParameterCount& expected,
......
This diff is collapsed.
......@@ -1146,8 +1146,7 @@ class TurboAssembler : public Assembler {
inline void Mrs(const Register& rt, SystemRegister sysreg);
// Generates function and stub prologue code.
void StubPrologue(StackFrame::Type type, int frame_slots);
// Generates function prologue code.
void Prologue(bool code_pre_aging);
// Code ageing support functions.
......@@ -1731,15 +1730,11 @@ class MacroAssembler : public TurboAssembler {
void StoreRoot(Register source,
Heap::RootListIndex index);
// Load both TrueValue and FalseValue roots.
void LoadTrueFalseRoots(Register true_root, Register false_root);
static int SafepointRegisterStackIndex(int reg_code);
void LoadInstanceDescriptors(Register map,
Register descriptors);
void EnumLengthUntagged(Register dst, Register map);
void EnumLengthSmi(Register dst, Register map);
void NumberOfOwnDescriptors(Register dst, Register map);
void LoadAccessor(Register dst, Register holder, int accessor_index,
AccessorComponent accessor);
......@@ -1814,40 +1809,6 @@ class MacroAssembler : public TurboAssembler {
void JumpIfNotHeapNumber(Register object, Label* on_not_heap_number,
SmiCheckType smi_check_type = DONT_DO_SMI_CHECK);
// Sets the vs flag if the input is -0.0.
void TestForMinusZero(DoubleRegister input);
// Jump to label if the input double register contains -0.0.
void JumpIfMinusZero(DoubleRegister input, Label* on_negative_zero);
// Jump to label if the input integer register contains the double precision
// floating point representation of -0.0.
void JumpIfMinusZero(Register input, Label* on_negative_zero);
// Saturate a signed 32-bit integer in input to an unsigned 8-bit integer in
// output.
void ClampInt32ToUint8(Register in_out);
void ClampInt32ToUint8(Register output, Register input);
// Saturate a double in input to an unsigned 8-bit integer in output.
void ClampDoubleToUint8(Register output,
DoubleRegister input,
DoubleRegister dbl_scratch);
// Try to represent a double as a signed 32-bit int.
// This succeeds if the result compares equal to the input, so inputs of -0.0
// are represented as 0 and handled as a success.
//
// On output the Z flag is set if the operation was successful.
void TryRepresentDoubleAsInt32(Register as_int, VRegister value,
VRegister scratch_d,
Label* on_successful_conversion = NULL,
Label* on_failed_conversion = NULL) {
DCHECK(as_int.Is32Bits());
TryRepresentDoubleAsInt(as_int, value, scratch_d, on_successful_conversion,
on_failed_conversion);
}
// Try to represent a double as a signed 64-bit int.
// This succeeds if the result compares equal to the input, so inputs of -0.0
// are represented as 0 and handled as a success.
......@@ -1862,14 +1823,6 @@ class MacroAssembler : public TurboAssembler {
on_failed_conversion);
}
// ---- Object Utilities ----
// Initialize fields with filler values. Fields starting at |current_address|
// not including |end_address| are overwritten with the value in |filler|. At
// the end the loop, |current_address| takes the value of |end_address|.
void InitializeFieldsWithFiller(Register current_address,
Register end_address, Register filler);
// ---- String Utilities ----
// Checks if both instance types are sequential one-byte strings and jumps to
......@@ -1958,23 +1911,6 @@ class MacroAssembler : public TurboAssembler {
InvokeFlag flag,
const CallWrapper& call_wrapper);
// ---- Floating point helpers ----
// Performs a truncating conversion of a heap number as used by
// the JS bitwise operations. See ECMA-262 9.5: ToInt32. 'result' and 'input'
// must be different registers. Exits with 'result' holding the answer.
void TruncateHeapNumberToI(Register result, Register object);
// Converts the smi or heap number in object to an int32 using the rules
// for ToInt32 as described in ECMAScript 9.5.: the value is truncated
// and brought into the range -2^31 .. +2^31 - 1. 'result' and 'input' must be
// different registers.
void TruncateNumberToI(Register object,
Register result,
Register heap_number_map,
Label* not_int32);
// ---- Code generation helpers ----
// Frame restart support
......@@ -2117,10 +2053,6 @@ class MacroAssembler : public TurboAssembler {
// miss label if the weak cell was cleared.
void LoadWeakValue(Register value, Handle<WeakCell> cell, Label* miss);
// Test the bitfield of the heap object map with mask and set the condition
// flags. The object register is preserved.
void TestMapBitfield(Register object, uint64_t mask);
// Load the elements kind field from a map, and return it in the result
// register.
void LoadElementsKindFromMap(Register result, Register map);
......@@ -2170,12 +2102,6 @@ class MacroAssembler : public TurboAssembler {
// ---------------------------------------------------------------------------
// Inline caching support.
void EmitSeqStringSetCharCheck(Register string,
Register index,
SeqStringSetCharCheckIndexType index_type,
Register scratch,
uint32_t encoding_mask);
// Hash the interger value in 'key' register.
// It uses the same algorithm as ComputeIntegerHash in utils.h.
void GetNumberHash(Register key, Register scratch);
......@@ -2194,17 +2120,6 @@ class MacroAssembler : public TurboAssembler {
Register scratch2, Register scratch3, Register scratch4,
Label* call_runtime);
// AllocationMemento support. Arrays may have an associated
// AllocationMemento object that can be checked for in order to pretransition
// to another type.
// On entry, receiver should point to the array object.
// If allocation info is present, the Z flag is set (so that the eq
// condition will pass).
void TestJSArrayForAllocationMemento(Register receiver,
Register scratch1,
Register scratch2,
Label* no_memento_found);
// The stack pointer has to switch between csp and jssp when setting up and
// destroying the exit frame. Hence preserving/restoring the registers is
// slightly more complicated than simple push/pop operations.
......@@ -2265,15 +2180,9 @@ class MacroAssembler : public TurboAssembler {
LoadNativeContextSlot(Context::GLOBAL_PROXY_INDEX, dst);
}
// Emit code for a truncating division by a constant. The dividend register is
// unchanged. Dividend and result must be different.
void TruncatingDiv(Register result, Register dividend, int32_t divisor);
// ---------------------------------------------------------------------------
// StatsCounter support
void SetCounter(StatsCounter* counter, int value, Register scratch1,
Register scratch2);
void IncrementCounter(StatsCounter* counter, int value, Register scratch1,
Register scratch2);
void DecrementCounter(StatsCounter* counter, int value, Register scratch1,
......@@ -2301,9 +2210,6 @@ class MacroAssembler : public TurboAssembler {
void PushSafepointRegisters();
void PopSafepointRegisters();
void PushSafepointRegistersAndDoubles();
void PopSafepointRegistersAndDoubles();
// Store value in register src in the safepoint stack slot for register dst.
void StoreToSafepointRegisterSlot(Register src, Register dst);
......@@ -2426,7 +2332,6 @@ class MacroAssembler : public TurboAssembler {
// ---------------------------------------------------------------------------
// Debugging.
void AssertRegisterIsClear(Register reg, BailoutReason reason);
void AssertRegisterIsRoot(
Register reg,
Heap::RootListIndex index,
......@@ -2438,13 +2343,6 @@ class MacroAssembler : public TurboAssembler {
// If emit_debug_code() is false, this emits no code.
void AssertHasValidColor(const Register& reg);
// Abort if 'object' register doesn't point to a string object.
//
// If emit_debug_code() is false, this emits no code.
void AssertIsString(const Register& object);
void CheckRegisterIsClear(Register reg, BailoutReason reason);
void LoadNativeContextSlot(int index, Register dst);
// Load the initial map from the global function. The registers function and
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment