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

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

Issue 6756033: ARM: Add optimization for constant RHS in DoMulI (try 2) (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 8 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 | « no previous file | src/arm/lithium-codegen-arm.cc » ('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 3427 matching lines...) Expand 10 before | Expand all | Expand 10 after
3438 __ b(ne, &return_heap_number); 3438 __ b(ne, &return_heap_number);
3439 __ bind(&not_zero); 3439 __ bind(&not_zero);
3440 3440
3441 // Tag the result and return. 3441 // Tag the result and return.
3442 __ SmiTag(r0, scratch1); 3442 __ SmiTag(r0, scratch1);
3443 __ Ret(); 3443 __ Ret();
3444 } else { 3444 } else {
3445 // DIV just falls through to allocating a heap number. 3445 // DIV just falls through to allocating a heap number.
3446 } 3446 }
3447 3447
3448 __ bind(&return_heap_number);
3449 // Return a heap number, or fall through to type transition or runtime
3450 // call if we can't.
3448 if (result_type_ >= (op_ == Token::DIV) ? TRBinaryOpIC::HEAP_NUMBER 3451 if (result_type_ >= (op_ == Token::DIV) ? TRBinaryOpIC::HEAP_NUMBER
3449 : TRBinaryOpIC::INT32) { 3452 : TRBinaryOpIC::INT32) {
3450 __ bind(&return_heap_number);
3451 // We are using vfp registers so r5 is available. 3453 // We are using vfp registers so r5 is available.
3452 heap_number_result = r5; 3454 heap_number_result = r5;
3453 GenerateHeapResultAllocation(masm, 3455 GenerateHeapResultAllocation(masm,
3454 heap_number_result, 3456 heap_number_result,
3455 heap_number_map, 3457 heap_number_map,
3456 scratch1, 3458 scratch1,
3457 scratch2, 3459 scratch2,
3458 &call_runtime); 3460 &call_runtime);
3459 __ sub(r0, heap_number_result, Operand(kHeapObjectTag)); 3461 __ sub(r0, heap_number_result, Operand(kHeapObjectTag));
3460 __ vstr(d5, r0, HeapNumber::kValueOffset); 3462 __ vstr(d5, r0, HeapNumber::kValueOffset);
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
3603 __ TailCallStub(&stub); 3605 __ TailCallStub(&stub);
3604 } 3606 }
3605 3607
3606 break; 3608 break;
3607 } 3609 }
3608 3610
3609 default: 3611 default:
3610 UNREACHABLE(); 3612 UNREACHABLE();
3611 } 3613 }
3612 3614
3613 if (transition.is_linked()) { 3615 // We never expect DIV to yield an integer result, so we always generate
3616 // type transition code for DIV operations expecting an integer result: the
3617 // code will fall through to this type transition.
3618 if (transition.is_linked() ||
3619 ((op_ == Token::DIV) && (result_type_ <= TRBinaryOpIC::INT32))) {
3614 __ bind(&transition); 3620 __ bind(&transition);
3615 GenerateTypeTransition(masm); 3621 GenerateTypeTransition(masm);
3616 } 3622 }
3617 3623
3618 __ bind(&call_runtime); 3624 __ bind(&call_runtime);
3619 GenerateCallRuntime(masm); 3625 GenerateCallRuntime(masm);
3620 } 3626 }
3621 3627
3622 3628
3623 void TypeRecordingBinaryOpStub::GenerateOddballStub(MacroAssembler* masm) { 3629 void TypeRecordingBinaryOpStub::GenerateOddballStub(MacroAssembler* masm) {
(...skipping 3284 matching lines...) Expand 10 before | Expand all | Expand 10 after
6908 __ str(pc, MemOperand(sp, 0)); 6914 __ str(pc, MemOperand(sp, 0));
6909 __ Jump(target); // Call the C++ function. 6915 __ Jump(target); // Call the C++ function.
6910 } 6916 }
6911 6917
6912 6918
6913 #undef __ 6919 #undef __
6914 6920
6915 } } // namespace v8::internal 6921 } } // namespace v8::internal
6916 6922
6917 #endif // V8_TARGET_ARCH_ARM 6923 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698