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

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

Issue 6755009: ARM: Check for minus zero when converting binary operation result to smi (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 | test/mjsunit/regress/regress-1278.js » ('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 3408 matching lines...) Expand 10 before | Expand all | Expand 10 after
3419 // If the ne condition is set, result does 3419 // If the ne condition is set, result does
3420 // not fit in a 32-bit integer. 3420 // not fit in a 32-bit integer.
3421 __ b(ne, &transition); 3421 __ b(ne, &transition);
3422 } 3422 }
3423 3423
3424 // Check if the result fits in a smi. 3424 // Check if the result fits in a smi.
3425 __ vmov(scratch1, single_scratch); 3425 __ vmov(scratch1, single_scratch);
3426 __ add(scratch2, scratch1, Operand(0x40000000), SetCC); 3426 __ add(scratch2, scratch1, Operand(0x40000000), SetCC);
3427 // If not try to return a heap number. 3427 // If not try to return a heap number.
3428 __ b(mi, &return_heap_number); 3428 __ b(mi, &return_heap_number);
3429 // Check for minus zero. Return heap number for minus zero.
3430 Label not_zero;
3431 __ cmp(scratch1, Operand(0));
3432 __ b(ne, &not_zero);
3433 __ vmov(scratch2, d5.high());
3434 __ tst(scratch2, Operand(HeapNumber::kSignMask));
3435 __ b(ne, &return_heap_number);
3436 __ bind(&not_zero);
3437
3429 // Tag the result and return. 3438 // Tag the result and return.
3430 __ SmiTag(r0, scratch1); 3439 __ SmiTag(r0, scratch1);
3431 __ Ret(); 3440 __ Ret();
3441 } else {
3442 // DIV just falls through to allocating a heap number.
3432 } 3443 }
3433 3444
3434 if (result_type_ >= (op_ == Token::DIV) ? TRBinaryOpIC::HEAP_NUMBER 3445 if (result_type_ >= (op_ == Token::DIV) ? TRBinaryOpIC::HEAP_NUMBER
3435 : TRBinaryOpIC::INT32) { 3446 : TRBinaryOpIC::INT32) {
3436 __ bind(&return_heap_number); 3447 __ bind(&return_heap_number);
3437 // We are using vfp registers so r5 is available. 3448 // We are using vfp registers so r5 is available.
3438 heap_number_result = r5; 3449 heap_number_result = r5;
3439 GenerateHeapResultAllocation(masm, 3450 GenerateHeapResultAllocation(masm,
3440 heap_number_result, 3451 heap_number_result,
3441 heap_number_map, 3452 heap_number_map,
(...skipping 3421 matching lines...) Expand 10 before | Expand all | Expand 10 after
6863 __ str(pc, MemOperand(sp, 0)); 6874 __ str(pc, MemOperand(sp, 0));
6864 __ Jump(target); // Call the C++ function. 6875 __ Jump(target); // Call the C++ function.
6865 } 6876 }
6866 6877
6867 6878
6868 #undef __ 6879 #undef __
6869 6880
6870 } } // namespace v8::internal 6881 } } // namespace v8::internal
6871 6882
6872 #endif // V8_TARGET_ARCH_ARM 6883 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-1278.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698