Index: src/arm/code-stubs-arm.cc |
=================================================================== |
--- src/arm/code-stubs-arm.cc (revision 8025) |
+++ src/arm/code-stubs-arm.cc (working copy) |
@@ -1707,14 +1707,13 @@ |
} |
-Handle<Code> GetTypeRecordingUnaryOpStub(int key, |
- TRUnaryOpIC::TypeInfo type_info) { |
- TypeRecordingUnaryOpStub stub(key, type_info); |
+Handle<Code> GetUnaryOpStub(int key, UnaryOpIC::TypeInfo type_info) { |
+ UnaryOpStub stub(key, type_info); |
return stub.GetCode(); |
} |
-const char* TypeRecordingUnaryOpStub::GetName() { |
+const char* UnaryOpStub::GetName() { |
if (name_ != NULL) return name_; |
const int kMaxNameLength = 100; |
name_ = Isolate::Current()->bootstrapper()->AllocateAutoDeletedArray( |
@@ -1728,34 +1727,34 @@ |
} |
OS::SNPrintF(Vector<char>(name_, kMaxNameLength), |
- "TypeRecordingUnaryOpStub_%s_%s_%s", |
+ "UnaryOpStub_%s_%s_%s", |
op_name, |
overwrite_name, |
- TRUnaryOpIC::GetName(operand_type_)); |
+ UnaryOpIC::GetName(operand_type_)); |
return name_; |
} |
// TODO(svenpanne): Use virtual functions instead of switch. |
-void TypeRecordingUnaryOpStub::Generate(MacroAssembler* masm) { |
+void UnaryOpStub::Generate(MacroAssembler* masm) { |
switch (operand_type_) { |
- case TRUnaryOpIC::UNINITIALIZED: |
+ case UnaryOpIC::UNINITIALIZED: |
GenerateTypeTransition(masm); |
break; |
- case TRUnaryOpIC::SMI: |
+ case UnaryOpIC::SMI: |
GenerateSmiStub(masm); |
break; |
- case TRUnaryOpIC::HEAP_NUMBER: |
+ case UnaryOpIC::HEAP_NUMBER: |
GenerateHeapNumberStub(masm); |
break; |
- case TRUnaryOpIC::GENERIC: |
+ case UnaryOpIC::GENERIC: |
GenerateGenericStub(masm); |
break; |
} |
} |
-void TypeRecordingUnaryOpStub::GenerateTypeTransition(MacroAssembler* masm) { |
+void UnaryOpStub::GenerateTypeTransition(MacroAssembler* masm) { |
// Prepare to push argument. |
__ mov(r3, Operand(r0)); |
@@ -1768,7 +1767,7 @@ |
__ Push(r3, r2, r1, r0); |
__ TailCallExternalReference( |
- ExternalReference(IC_Utility(IC::kTypeRecordingUnaryOp_Patch), |
+ ExternalReference(IC_Utility(IC::kUnaryOp_Patch), |
masm->isolate()), |
4, |
1); |
@@ -1776,7 +1775,7 @@ |
// TODO(svenpanne): Use virtual functions instead of switch. |
-void TypeRecordingUnaryOpStub::GenerateSmiStub(MacroAssembler* masm) { |
+void UnaryOpStub::GenerateSmiStub(MacroAssembler* masm) { |
switch (op_) { |
case Token::SUB: |
GenerateSmiStubSub(masm); |
@@ -1790,7 +1789,7 @@ |
} |
-void TypeRecordingUnaryOpStub::GenerateSmiStubSub(MacroAssembler* masm) { |
+void UnaryOpStub::GenerateSmiStubSub(MacroAssembler* masm) { |
Label non_smi, slow; |
GenerateSmiCodeSub(masm, &non_smi, &slow); |
__ bind(&non_smi); |
@@ -1799,7 +1798,7 @@ |
} |
-void TypeRecordingUnaryOpStub::GenerateSmiStubBitNot(MacroAssembler* masm) { |
+void UnaryOpStub::GenerateSmiStubBitNot(MacroAssembler* masm) { |
Label non_smi; |
GenerateSmiCodeBitNot(masm, &non_smi); |
__ bind(&non_smi); |
@@ -1807,9 +1806,9 @@ |
} |
-void TypeRecordingUnaryOpStub::GenerateSmiCodeSub(MacroAssembler* masm, |
- Label* non_smi, |
- Label* slow) { |
+void UnaryOpStub::GenerateSmiCodeSub(MacroAssembler* masm, |
+ Label* non_smi, |
+ Label* slow) { |
__ JumpIfNotSmi(r0, non_smi); |
// The result of negating zero or the smallest negative smi is not a smi. |
@@ -1822,8 +1821,8 @@ |
} |
-void TypeRecordingUnaryOpStub::GenerateSmiCodeBitNot(MacroAssembler* masm, |
- Label* non_smi) { |
+void UnaryOpStub::GenerateSmiCodeBitNot(MacroAssembler* masm, |
+ Label* non_smi) { |
__ JumpIfNotSmi(r0, non_smi); |
// Flip bits and revert inverted smi-tag. |
@@ -1834,7 +1833,7 @@ |
// TODO(svenpanne): Use virtual functions instead of switch. |
-void TypeRecordingUnaryOpStub::GenerateHeapNumberStub(MacroAssembler* masm) { |
+void UnaryOpStub::GenerateHeapNumberStub(MacroAssembler* masm) { |
switch (op_) { |
case Token::SUB: |
GenerateHeapNumberStubSub(masm); |
@@ -1848,7 +1847,7 @@ |
} |
-void TypeRecordingUnaryOpStub::GenerateHeapNumberStubSub(MacroAssembler* masm) { |
+void UnaryOpStub::GenerateHeapNumberStubSub(MacroAssembler* masm) { |
Label non_smi, slow, call_builtin; |
GenerateSmiCodeSub(masm, &non_smi, &call_builtin); |
__ bind(&non_smi); |
@@ -1860,8 +1859,7 @@ |
} |
-void TypeRecordingUnaryOpStub::GenerateHeapNumberStubBitNot( |
- MacroAssembler* masm) { |
+void UnaryOpStub::GenerateHeapNumberStubBitNot(MacroAssembler* masm) { |
Label non_smi, slow; |
GenerateSmiCodeBitNot(masm, &non_smi); |
__ bind(&non_smi); |
@@ -1870,8 +1868,8 @@ |
GenerateTypeTransition(masm); |
} |
-void TypeRecordingUnaryOpStub::GenerateHeapNumberCodeSub(MacroAssembler* masm, |
- Label* slow) { |
+void UnaryOpStub::GenerateHeapNumberCodeSub(MacroAssembler* masm, |
+ Label* slow) { |
EmitCheckForHeapNumber(masm, r0, r1, r6, slow); |
// r0 is a heap number. Get a new heap number in r1. |
if (mode_ == UNARY_OVERWRITE) { |
@@ -1903,7 +1901,7 @@ |
} |
-void TypeRecordingUnaryOpStub::GenerateHeapNumberCodeBitNot( |
+void UnaryOpStub::GenerateHeapNumberCodeBitNot( |
MacroAssembler* masm, Label* slow) { |
EmitCheckForHeapNumber(masm, r0, r1, r6, slow); |
// Convert the heap number is r0 to an untagged integer in r1. |
@@ -1954,7 +1952,7 @@ |
// TODO(svenpanne): Use virtual functions instead of switch. |
-void TypeRecordingUnaryOpStub::GenerateGenericStub(MacroAssembler* masm) { |
+void UnaryOpStub::GenerateGenericStub(MacroAssembler* masm) { |
switch (op_) { |
case Token::SUB: |
GenerateGenericStubSub(masm); |
@@ -1968,7 +1966,7 @@ |
} |
-void TypeRecordingUnaryOpStub::GenerateGenericStubSub(MacroAssembler* masm) { |
+void UnaryOpStub::GenerateGenericStubSub(MacroAssembler* masm) { |
Label non_smi, slow; |
GenerateSmiCodeSub(masm, &non_smi, &slow); |
__ bind(&non_smi); |
@@ -1978,7 +1976,7 @@ |
} |
-void TypeRecordingUnaryOpStub::GenerateGenericStubBitNot(MacroAssembler* masm) { |
+void UnaryOpStub::GenerateGenericStubBitNot(MacroAssembler* masm) { |
Label non_smi, slow; |
GenerateSmiCodeBitNot(masm, &non_smi); |
__ bind(&non_smi); |
@@ -1988,8 +1986,7 @@ |
} |
-void TypeRecordingUnaryOpStub::GenerateGenericCodeFallback( |
- MacroAssembler* masm) { |
+void UnaryOpStub::GenerateGenericCodeFallback(MacroAssembler* masm) { |
// Handle the slow case by jumping to the JavaScript builtin. |
__ push(r0); |
switch (op_) { |
@@ -2005,15 +2002,15 @@ |
} |
-Handle<Code> GetTypeRecordingBinaryOpStub(int key, |
- TRBinaryOpIC::TypeInfo type_info, |
- TRBinaryOpIC::TypeInfo result_type_info) { |
- TypeRecordingBinaryOpStub stub(key, type_info, result_type_info); |
+Handle<Code> GetBinaryOpStub(int key, |
+ BinaryOpIC::TypeInfo type_info, |
+ BinaryOpIC::TypeInfo result_type_info) { |
+ BinaryOpStub stub(key, type_info, result_type_info); |
return stub.GetCode(); |
} |
-void TypeRecordingBinaryOpStub::GenerateTypeTransition(MacroAssembler* masm) { |
+void BinaryOpStub::GenerateTypeTransition(MacroAssembler* masm) { |
Label get_result; |
__ Push(r1, r0); |
@@ -2024,43 +2021,43 @@ |
__ Push(r2, r1, r0); |
__ TailCallExternalReference( |
- ExternalReference(IC_Utility(IC::kTypeRecordingBinaryOp_Patch), |
+ ExternalReference(IC_Utility(IC::kBinaryOp_Patch), |
masm->isolate()), |
5, |
1); |
} |
-void TypeRecordingBinaryOpStub::GenerateTypeTransitionWithSavedArgs( |
+void BinaryOpStub::GenerateTypeTransitionWithSavedArgs( |
MacroAssembler* masm) { |
UNIMPLEMENTED(); |
} |
-void TypeRecordingBinaryOpStub::Generate(MacroAssembler* masm) { |
+void BinaryOpStub::Generate(MacroAssembler* masm) { |
switch (operands_type_) { |
- case TRBinaryOpIC::UNINITIALIZED: |
+ case BinaryOpIC::UNINITIALIZED: |
GenerateTypeTransition(masm); |
break; |
- case TRBinaryOpIC::SMI: |
+ case BinaryOpIC::SMI: |
GenerateSmiStub(masm); |
break; |
- case TRBinaryOpIC::INT32: |
+ case BinaryOpIC::INT32: |
GenerateInt32Stub(masm); |
break; |
- case TRBinaryOpIC::HEAP_NUMBER: |
+ case BinaryOpIC::HEAP_NUMBER: |
GenerateHeapNumberStub(masm); |
break; |
- case TRBinaryOpIC::ODDBALL: |
+ case BinaryOpIC::ODDBALL: |
GenerateOddballStub(masm); |
break; |
- case TRBinaryOpIC::BOTH_STRING: |
+ case BinaryOpIC::BOTH_STRING: |
GenerateBothStringStub(masm); |
break; |
- case TRBinaryOpIC::STRING: |
+ case BinaryOpIC::STRING: |
GenerateStringStub(masm); |
break; |
- case TRBinaryOpIC::GENERIC: |
+ case BinaryOpIC::GENERIC: |
GenerateGeneric(masm); |
break; |
default: |
@@ -2069,7 +2066,7 @@ |
} |
-const char* TypeRecordingBinaryOpStub::GetName() { |
+const char* BinaryOpStub::GetName() { |
if (name_ != NULL) return name_; |
const int kMaxNameLength = 100; |
name_ = Isolate::Current()->bootstrapper()->AllocateAutoDeletedArray( |
@@ -2085,16 +2082,15 @@ |
} |
OS::SNPrintF(Vector<char>(name_, kMaxNameLength), |
- "TypeRecordingBinaryOpStub_%s_%s_%s", |
+ "BinaryOpStub_%s_%s_%s", |
op_name, |
overwrite_name, |
- TRBinaryOpIC::GetName(operands_type_)); |
+ BinaryOpIC::GetName(operands_type_)); |
return name_; |
} |
-void TypeRecordingBinaryOpStub::GenerateSmiSmiOperation( |
- MacroAssembler* masm) { |
+void BinaryOpStub::GenerateSmiSmiOperation(MacroAssembler* masm) { |
Register left = r1; |
Register right = r0; |
Register scratch1 = r7; |
@@ -2219,10 +2215,10 @@ |
} |
-void TypeRecordingBinaryOpStub::GenerateFPOperation(MacroAssembler* masm, |
- bool smi_operands, |
- Label* not_numbers, |
- Label* gc_required) { |
+void BinaryOpStub::GenerateFPOperation(MacroAssembler* masm, |
+ bool smi_operands, |
+ Label* not_numbers, |
+ Label* gc_required) { |
Register left = r1; |
Register right = r0; |
Register scratch1 = r7; |
@@ -2433,7 +2429,8 @@ |
// generated. If the result is not a smi and heap number allocation is not |
// requested the code falls through. If number allocation is requested but a |
// heap number cannot be allocated the code jumps to the lable gc_required. |
-void TypeRecordingBinaryOpStub::GenerateSmiCode(MacroAssembler* masm, |
+void BinaryOpStub::GenerateSmiCode( |
+ MacroAssembler* masm, |
Label* use_runtime, |
Label* gc_required, |
SmiCodeGenerateHeapNumberResults allow_heapnumber_results) { |
@@ -2462,11 +2459,11 @@ |
} |
-void TypeRecordingBinaryOpStub::GenerateSmiStub(MacroAssembler* masm) { |
+void BinaryOpStub::GenerateSmiStub(MacroAssembler* masm) { |
Label not_smis, call_runtime; |
- if (result_type_ == TRBinaryOpIC::UNINITIALIZED || |
- result_type_ == TRBinaryOpIC::SMI) { |
+ if (result_type_ == BinaryOpIC::UNINITIALIZED || |
+ result_type_ == BinaryOpIC::SMI) { |
// Only allow smi results. |
GenerateSmiCode(masm, &call_runtime, NULL, NO_HEAPNUMBER_RESULTS); |
} else { |
@@ -2487,19 +2484,19 @@ |
} |
-void TypeRecordingBinaryOpStub::GenerateStringStub(MacroAssembler* masm) { |
- ASSERT(operands_type_ == TRBinaryOpIC::STRING); |
+void BinaryOpStub::GenerateStringStub(MacroAssembler* masm) { |
+ ASSERT(operands_type_ == BinaryOpIC::STRING); |
ASSERT(op_ == Token::ADD); |
// Try to add arguments as strings, otherwise, transition to the generic |
- // TRBinaryOpIC type. |
+ // BinaryOpIC type. |
GenerateAddStrings(masm); |
GenerateTypeTransition(masm); |
} |
-void TypeRecordingBinaryOpStub::GenerateBothStringStub(MacroAssembler* masm) { |
+void BinaryOpStub::GenerateBothStringStub(MacroAssembler* masm) { |
Label call_runtime; |
- ASSERT(operands_type_ == TRBinaryOpIC::BOTH_STRING); |
+ ASSERT(operands_type_ == BinaryOpIC::BOTH_STRING); |
ASSERT(op_ == Token::ADD); |
// If both arguments are strings, call the string add stub. |
// Otherwise, do a transition. |
@@ -2527,8 +2524,8 @@ |
} |
-void TypeRecordingBinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) { |
- ASSERT(operands_type_ == TRBinaryOpIC::INT32); |
+void BinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) { |
+ ASSERT(operands_type_ == BinaryOpIC::INT32); |
Register left = r1; |
Register right = r0; |
@@ -2625,7 +2622,7 @@ |
scratch1, |
scratch2); |
- if (result_type_ <= TRBinaryOpIC::INT32) { |
+ if (result_type_ <= BinaryOpIC::INT32) { |
// If the ne condition is set, result does |
// not fit in a 32-bit integer. |
__ b(ne, &transition); |
@@ -2652,8 +2649,8 @@ |
// DIV just falls through to allocating a heap number. |
} |
- if (result_type_ >= (op_ == Token::DIV) ? TRBinaryOpIC::HEAP_NUMBER |
- : TRBinaryOpIC::INT32) { |
+ if (result_type_ >= (op_ == Token::DIV) ? BinaryOpIC::HEAP_NUMBER |
+ : BinaryOpIC::INT32) { |
__ bind(&return_heap_number); |
// We are using vfp registers so r5 is available. |
heap_number_result = r5; |
@@ -2762,12 +2759,13 @@ |
// The non vfp3 code does not support this special case, so jump to |
// runtime if we don't support it. |
if (CpuFeatures::IsSupported(VFP3)) { |
- __ b(mi, |
- (result_type_ <= TRBinaryOpIC::INT32) ? &transition |
- : &return_heap_number); |
+ __ b(mi, (result_type_ <= BinaryOpIC::INT32) |
+ ? &transition |
+ : &return_heap_number); |
} else { |
- __ b(mi, (result_type_ <= TRBinaryOpIC::INT32) ? &transition |
- : &call_runtime); |
+ __ b(mi, (result_type_ <= BinaryOpIC::INT32) |
+ ? &transition |
+ : &call_runtime); |
} |
break; |
case Token::SHL: |
@@ -2837,7 +2835,7 @@ |
} |
-void TypeRecordingBinaryOpStub::GenerateOddballStub(MacroAssembler* masm) { |
+void BinaryOpStub::GenerateOddballStub(MacroAssembler* masm) { |
Label call_runtime; |
if (op_ == Token::ADD) { |
@@ -2870,7 +2868,7 @@ |
} |
-void TypeRecordingBinaryOpStub::GenerateHeapNumberStub(MacroAssembler* masm) { |
+void BinaryOpStub::GenerateHeapNumberStub(MacroAssembler* masm) { |
Label call_runtime; |
GenerateFPOperation(masm, false, &call_runtime, &call_runtime); |
@@ -2879,7 +2877,7 @@ |
} |
-void TypeRecordingBinaryOpStub::GenerateGeneric(MacroAssembler* masm) { |
+void BinaryOpStub::GenerateGeneric(MacroAssembler* masm) { |
Label call_runtime, call_string_add_or_runtime; |
GenerateSmiCode(masm, &call_runtime, &call_runtime, ALLOW_HEAPNUMBER_RESULTS); |
@@ -2896,7 +2894,7 @@ |
} |
-void TypeRecordingBinaryOpStub::GenerateAddStrings(MacroAssembler* masm) { |
+void BinaryOpStub::GenerateAddStrings(MacroAssembler* masm) { |
ASSERT(op_ == Token::ADD); |
Label left_not_string, call_runtime; |
@@ -2927,7 +2925,7 @@ |
} |
-void TypeRecordingBinaryOpStub::GenerateCallRuntime(MacroAssembler* masm) { |
+void BinaryOpStub::GenerateCallRuntime(MacroAssembler* masm) { |
GenerateRegisterArgsPush(masm); |
switch (op_) { |
case Token::ADD: |
@@ -2969,14 +2967,12 @@ |
} |
-void TypeRecordingBinaryOpStub::GenerateHeapResultAllocation( |
- MacroAssembler* masm, |
- Register result, |
- Register heap_number_map, |
- Register scratch1, |
- Register scratch2, |
- Label* gc_required) { |
- |
+void BinaryOpStub::GenerateHeapResultAllocation(MacroAssembler* masm, |
+ Register result, |
+ Register heap_number_map, |
+ Register scratch1, |
+ Register scratch2, |
+ Label* gc_required) { |
// Code below will scratch result if allocation fails. To keep both arguments |
// intact for the runtime call result cannot be one of these. |
ASSERT(!result.is(r0) && !result.is(r1)); |
@@ -3003,7 +2999,7 @@ |
} |
-void TypeRecordingBinaryOpStub::GenerateRegisterArgsPush(MacroAssembler* masm) { |
+void BinaryOpStub::GenerateRegisterArgsPush(MacroAssembler* masm) { |
__ Push(r1, r0); |
} |