Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: src/arm/code-stubs-arm.cc

Issue 6744006: Add binary-op stub variant to handle oddball objects more efficiently. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/code-stubs-arm.h ('k') | src/ia32/code-stubs-ia32.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2866 matching lines...) Expand 10 before | Expand all | Expand 10 after
2877 break; 2877 break;
2878 case TRBinaryOpIC::SMI: 2878 case TRBinaryOpIC::SMI:
2879 GenerateSmiStub(masm); 2879 GenerateSmiStub(masm);
2880 break; 2880 break;
2881 case TRBinaryOpIC::INT32: 2881 case TRBinaryOpIC::INT32:
2882 GenerateInt32Stub(masm); 2882 GenerateInt32Stub(masm);
2883 break; 2883 break;
2884 case TRBinaryOpIC::HEAP_NUMBER: 2884 case TRBinaryOpIC::HEAP_NUMBER:
2885 GenerateHeapNumberStub(masm); 2885 GenerateHeapNumberStub(masm);
2886 break; 2886 break;
2887 case TRBinaryOpIC::ODDBALL:
2888 GenerateOddballStub(masm);
2889 break;
2887 case TRBinaryOpIC::STRING: 2890 case TRBinaryOpIC::STRING:
2888 GenerateStringStub(masm); 2891 GenerateStringStub(masm);
2889 break; 2892 break;
2890 case TRBinaryOpIC::GENERIC: 2893 case TRBinaryOpIC::GENERIC:
2891 GenerateGeneric(masm); 2894 GenerateGeneric(masm);
2892 break; 2895 break;
2893 default: 2896 default:
2894 UNREACHABLE(); 2897 UNREACHABLE();
2895 } 2898 }
2896 } 2899 }
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
3599 if (transition.is_linked()) { 3602 if (transition.is_linked()) {
3600 __ bind(&transition); 3603 __ bind(&transition);
3601 GenerateTypeTransition(masm); 3604 GenerateTypeTransition(masm);
3602 } 3605 }
3603 3606
3604 __ bind(&call_runtime); 3607 __ bind(&call_runtime);
3605 GenerateCallRuntime(masm); 3608 GenerateCallRuntime(masm);
3606 } 3609 }
3607 3610
3608 3611
3612 void TypeRecordingBinaryOpStub::GenerateOddballStub(MacroAssembler* masm) {
3613 Label call_runtime;
3614
3615 if (op_ == Token::ADD) {
3616 // Handle string addition here, because it is the only operation
3617 // that does not do a ToNumber conversion on the operands.
3618 GenerateAddStrings(masm);
3619 }
3620
3621 // Convert oddball arguments to numbers.
3622 Label check, done;
3623 __ CompareRoot(r1, Heap::kUndefinedValueRootIndex);
3624 __ b(ne, &check);
3625 if (Token::IsBitOp(op_)) {
3626 __ mov(r1, Operand(Smi::FromInt(0)));
3627 } else {
3628 __ LoadRoot(r1, Heap::kNanValueRootIndex);
3629 }
3630 __ jmp(&done);
3631 __ bind(&check);
3632 __ CompareRoot(r0, Heap::kUndefinedValueRootIndex);
3633 __ b(ne, &done);
3634 if (Token::IsBitOp(op_)) {
3635 __ mov(r0, Operand(Smi::FromInt(0)));
3636 } else {
3637 __ LoadRoot(r0, Heap::kNanValueRootIndex);
3638 }
3639 __ bind(&done);
3640
3641 GenerateHeapNumberStub(masm);
3642 }
3643
3644
3609 void TypeRecordingBinaryOpStub::GenerateHeapNumberStub(MacroAssembler* masm) { 3645 void TypeRecordingBinaryOpStub::GenerateHeapNumberStub(MacroAssembler* masm) {
3610 Label call_runtime; 3646 Label call_runtime;
3611 ASSERT(operands_type_ == TRBinaryOpIC::HEAP_NUMBER); 3647 ASSERT(operands_type_ == TRBinaryOpIC::HEAP_NUMBER);
3612 3648
3613 GenerateFPOperation(masm, false, &call_runtime, &call_runtime); 3649 GenerateFPOperation(masm, false, &call_runtime, &call_runtime);
3614 3650
3615 __ bind(&call_runtime); 3651 __ bind(&call_runtime);
3616 GenerateCallRuntime(masm); 3652 GenerateCallRuntime(masm);
3617 } 3653 }
3618 3654
(...skipping 3244 matching lines...) Expand 10 before | Expand all | Expand 10 after
6863 __ str(pc, MemOperand(sp, 0)); 6899 __ str(pc, MemOperand(sp, 0));
6864 __ Jump(target); // Call the C++ function. 6900 __ Jump(target); // Call the C++ function.
6865 } 6901 }
6866 6902
6867 6903
6868 #undef __ 6904 #undef __
6869 6905
6870 } } // namespace v8::internal 6906 } } // namespace v8::internal
6871 6907
6872 #endif // V8_TARGET_ARCH_ARM 6908 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.h ('k') | src/ia32/code-stubs-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698