Chromium Code Reviews| Index: src/ia32/code-stubs-ia32.cc |
| =================================================================== |
| --- src/ia32/code-stubs-ia32.cc (revision 8025) |
| +++ src/ia32/code-stubs-ia32.cc (working copy) |
| @@ -517,14 +517,14 @@ |
| } |
| -Handle<Code> GetTypeRecordingUnaryOpStub(int key, |
| - TRUnaryOpIC::TypeInfo type_info) { |
| - TypeRecordingUnaryOpStub stub(key, type_info); |
| +Handle<Code> GetUnaryOpStub(int key, |
|
Søren Thygesen Gjesse
2011/05/24 11:33:11
Indentation.
fschneider
2011/05/24 12:16:41
Done.
|
| + 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( |
| @@ -538,34 +538,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) { |
| __ pop(ecx); // Save return address. |
| __ push(eax); |
| // the argument is now on top. |
| @@ -580,15 +580,13 @@ |
| // Patch the caller to an appropriate specialized stub and return the |
| // operation result to the caller of the stub. |
| __ TailCallExternalReference( |
| - ExternalReference(IC_Utility(IC::kTypeRecordingUnaryOp_Patch), |
| - masm->isolate()), |
| - 4, |
| - 1); |
| + ExternalReference(IC_Utility(IC::kUnaryOp_Patch), |
| + masm->isolate()), 4, 1); |
| } |
| // 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); |
| @@ -602,7 +600,7 @@ |
| } |
| -void TypeRecordingUnaryOpStub::GenerateSmiStubSub(MacroAssembler* masm) { |
| +void UnaryOpStub::GenerateSmiStubSub(MacroAssembler* masm) { |
| Label non_smi, undo, slow; |
| GenerateSmiCodeSub(masm, &non_smi, &undo, &slow, |
| Label::kNear, Label::kNear, Label::kNear); |
| @@ -614,7 +612,7 @@ |
| } |
| -void TypeRecordingUnaryOpStub::GenerateSmiStubBitNot(MacroAssembler* masm) { |
| +void UnaryOpStub::GenerateSmiStubBitNot(MacroAssembler* masm) { |
| Label non_smi; |
| GenerateSmiCodeBitNot(masm, &non_smi); |
| __ bind(&non_smi); |
| @@ -622,7 +620,7 @@ |
| } |
| -void TypeRecordingUnaryOpStub::GenerateSmiCodeSub(MacroAssembler* masm, |
| +void UnaryOpStub::GenerateSmiCodeSub(MacroAssembler* masm, |
|
Søren Thygesen Gjesse
2011/05/24 11:33:11
Indentation.
fschneider
2011/05/24 12:16:41
Done.
|
| Label* non_smi, |
| Label* undo, |
| Label* slow, |
| @@ -646,7 +644,7 @@ |
| } |
| -void TypeRecordingUnaryOpStub::GenerateSmiCodeBitNot( |
| +void UnaryOpStub::GenerateSmiCodeBitNot( |
| MacroAssembler* masm, |
| Label* non_smi, |
| Label::Distance non_smi_near) { |
| @@ -661,13 +659,13 @@ |
| } |
| -void TypeRecordingUnaryOpStub::GenerateSmiCodeUndo(MacroAssembler* masm) { |
| +void UnaryOpStub::GenerateSmiCodeUndo(MacroAssembler* masm) { |
| __ mov(eax, Operand(edx)); |
| } |
| // 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); |
| @@ -681,7 +679,7 @@ |
| } |
| -void TypeRecordingUnaryOpStub::GenerateHeapNumberStubSub(MacroAssembler* masm) { |
| +void UnaryOpStub::GenerateHeapNumberStubSub(MacroAssembler* masm) { |
| Label non_smi, undo, slow, call_builtin; |
| GenerateSmiCodeSub(masm, &non_smi, &undo, &call_builtin, Label::kNear); |
| __ bind(&non_smi); |
| @@ -695,7 +693,7 @@ |
| } |
| -void TypeRecordingUnaryOpStub::GenerateHeapNumberStubBitNot( |
| +void UnaryOpStub::GenerateHeapNumberStubBitNot( |
| MacroAssembler* masm) { |
| Label non_smi, slow; |
| GenerateSmiCodeBitNot(masm, &non_smi, Label::kNear); |
| @@ -706,7 +704,7 @@ |
| } |
| -void TypeRecordingUnaryOpStub::GenerateHeapNumberCodeSub(MacroAssembler* masm, |
| +void UnaryOpStub::GenerateHeapNumberCodeSub(MacroAssembler* masm, |
|
Søren Thygesen Gjesse
2011/05/24 11:33:11
Indentation.
fschneider
2011/05/24 12:16:41
Done.
|
| Label* slow) { |
| __ mov(edx, FieldOperand(eax, HeapObject::kMapOffset)); |
| __ cmp(edx, masm->isolate()->factory()->heap_number_map()); |
| @@ -742,7 +740,7 @@ |
| } |
| -void TypeRecordingUnaryOpStub::GenerateHeapNumberCodeBitNot( |
| +void UnaryOpStub::GenerateHeapNumberCodeBitNot( |
|
Søren Thygesen Gjesse
2011/05/24 11:33:11
Move MacroAssembler* masm, up one line and full in
fschneider
2011/05/24 12:16:41
Done.
|
| MacroAssembler* masm, |
| Label* slow) { |
| __ mov(edx, FieldOperand(eax, HeapObject::kMapOffset)); |
| @@ -803,7 +801,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); |
| @@ -817,7 +815,7 @@ |
| } |
| -void TypeRecordingUnaryOpStub::GenerateGenericStubSub(MacroAssembler* masm) { |
| +void UnaryOpStub::GenerateGenericStubSub(MacroAssembler* masm) { |
| Label non_smi, undo, slow; |
| GenerateSmiCodeSub(masm, &non_smi, &undo, &slow, Label::kNear); |
| __ bind(&non_smi); |
| @@ -829,7 +827,7 @@ |
| } |
| -void TypeRecordingUnaryOpStub::GenerateGenericStubBitNot(MacroAssembler* masm) { |
| +void UnaryOpStub::GenerateGenericStubBitNot(MacroAssembler* masm) { |
| Label non_smi, slow; |
| GenerateSmiCodeBitNot(masm, &non_smi, Label::kNear); |
| __ bind(&non_smi); |
| @@ -839,7 +837,7 @@ |
| } |
| -void TypeRecordingUnaryOpStub::GenerateGenericCodeFallback( |
| +void UnaryOpStub::GenerateGenericCodeFallback( |
|
Søren Thygesen Gjesse
2011/05/24 11:33:11
Fits one line?
fschneider
2011/05/24 12:16:41
Done.
|
| MacroAssembler* masm) { |
| // Handle the slow case by jumping to the corresponding JavaScript builtin. |
| __ pop(ecx); // pop return address. |
| @@ -858,15 +856,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) { |
| __ pop(ecx); // Save return address. |
| __ push(edx); |
| __ push(eax); |
| @@ -882,7 +880,7 @@ |
| // Patch the caller to an appropriate specialized stub and return the |
| // operation result to the caller of the stub. |
| __ TailCallExternalReference( |
| - ExternalReference(IC_Utility(IC::kTypeRecordingBinaryOp_Patch), |
| + ExternalReference(IC_Utility(IC::kBinaryOp_Patch), |
| masm->isolate()), |
| 5, |
| 1); |
| @@ -891,7 +889,7 @@ |
| // Prepare for a type transition runtime call when the args are already on |
| // the stack, under the return address. |
| -void TypeRecordingBinaryOpStub::GenerateTypeTransitionWithSavedArgs( |
| +void BinaryOpStub::GenerateTypeTransitionWithSavedArgs( |
|
Søren Thygesen Gjesse
2011/05/24 11:33:11
Fits one line?
fschneider
2011/05/24 12:16:41
Done.
|
| MacroAssembler* masm) { |
| __ pop(ecx); // Save return address. |
| // Left and right arguments are already on top of the stack. |
| @@ -906,37 +904,37 @@ |
| // Patch the caller to an appropriate specialized stub and return the |
| // operation result to the caller of the stub. |
| __ TailCallExternalReference( |
| - ExternalReference(IC_Utility(IC::kTypeRecordingBinaryOp_Patch), |
| + ExternalReference(IC_Utility(IC::kBinaryOp_Patch), |
| masm->isolate()), |
| 5, |
| 1); |
| } |
| -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: |
| @@ -945,7 +943,7 @@ |
| } |
| -const char* TypeRecordingBinaryOpStub::GetName() { |
| +const char* BinaryOpStub::GetName() { |
| if (name_ != NULL) return name_; |
| const int kMaxNameLength = 100; |
| name_ = Isolate::Current()->bootstrapper()->AllocateAutoDeletedArray( |
| @@ -961,15 +959,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::GenerateSmiCode(MacroAssembler* masm, |
| +void BinaryOpStub::GenerateSmiCode(MacroAssembler* masm, |
|
Søren Thygesen Gjesse
2011/05/24 11:33:11
MacroAssembler* masm, on a separate line
fschneider
2011/05/24 12:16:41
Done.
|
| Label* slow, |
| SmiCodeGenerateHeapNumberResults allow_heapnumber_results) { |
| // 1. Move arguments into edx, eax except for DIV and MOD, which need the |
| @@ -1344,7 +1342,7 @@ |
| } |
| -void TypeRecordingBinaryOpStub::GenerateSmiStub(MacroAssembler* masm) { |
| +void BinaryOpStub::GenerateSmiStub(MacroAssembler* masm) { |
| Label call_runtime; |
| switch (op_) { |
| @@ -1366,8 +1364,8 @@ |
| UNREACHABLE(); |
| } |
| - if (result_type_ == TRBinaryOpIC::UNINITIALIZED || |
| - result_type_ == TRBinaryOpIC::SMI) { |
| + if (result_type_ == BinaryOpIC::UNINITIALIZED || |
| + result_type_ == BinaryOpIC::SMI) { |
| GenerateSmiCode(masm, &call_runtime, NO_HEAPNUMBER_RESULTS); |
| } else { |
| GenerateSmiCode(masm, &call_runtime, ALLOW_HEAPNUMBER_RESULTS); |
| @@ -1395,19 +1393,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. |
| @@ -1437,9 +1435,9 @@ |
| } |
| -void TypeRecordingBinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) { |
| +void BinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) { |
| Label call_runtime; |
| - ASSERT(operands_type_ == TRBinaryOpIC::INT32); |
| + ASSERT(operands_type_ == BinaryOpIC::INT32); |
| // Floating point case. |
| switch (op_) { |
| @@ -1461,7 +1459,7 @@ |
| default: UNREACHABLE(); |
| } |
| // Check result type if it is currently Int32. |
| - if (result_type_ <= TRBinaryOpIC::INT32) { |
| + if (result_type_ <= BinaryOpIC::INT32) { |
| __ cvttsd2si(ecx, Operand(xmm0)); |
| __ cvtsi2sd(xmm2, Operand(ecx)); |
| __ ucomisd(xmm0, xmm2); |
| @@ -1639,7 +1637,7 @@ |
| } |
| -void TypeRecordingBinaryOpStub::GenerateOddballStub(MacroAssembler* masm) { |
| +void BinaryOpStub::GenerateOddballStub(MacroAssembler* masm) { |
| if (op_ == Token::ADD) { |
| // Handle string addition here, because it is the only operation |
| // that does not do a ToNumber conversion on the operands. |
| @@ -1672,7 +1670,7 @@ |
| } |
| -void TypeRecordingBinaryOpStub::GenerateHeapNumberStub(MacroAssembler* masm) { |
| +void BinaryOpStub::GenerateHeapNumberStub(MacroAssembler* masm) { |
| Label call_runtime; |
| // Floating point case. |
| @@ -1853,7 +1851,7 @@ |
| } |
| -void TypeRecordingBinaryOpStub::GenerateGeneric(MacroAssembler* masm) { |
| +void BinaryOpStub::GenerateGeneric(MacroAssembler* masm) { |
| Label call_runtime; |
| Counters* counters = masm->isolate()->counters(); |
| @@ -2050,7 +2048,7 @@ |
| } |
| -void TypeRecordingBinaryOpStub::GenerateAddStrings(MacroAssembler* masm) { |
| +void BinaryOpStub::GenerateAddStrings(MacroAssembler* masm) { |
| ASSERT(op_ == Token::ADD); |
| Label left_not_string, call_runtime; |
| @@ -2084,7 +2082,7 @@ |
| } |
| -void TypeRecordingBinaryOpStub::GenerateHeapResultAllocation( |
| +void BinaryOpStub::GenerateHeapResultAllocation( |
| MacroAssembler* masm, |
| Label* alloc_failure) { |
| Label skip_allocation; |
| @@ -2126,7 +2124,7 @@ |
| } |
| -void TypeRecordingBinaryOpStub::GenerateRegisterArgsPush(MacroAssembler* masm) { |
| +void BinaryOpStub::GenerateRegisterArgsPush(MacroAssembler* masm) { |
| __ pop(ecx); |
| __ push(edx); |
| __ push(eax); |