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

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

Issue 8428004: MIPS: Cleanup: use JumpIf[Not]Smi() whenever we can (Closed)
Patch Set: Fixed typo, rebased to r9884 Created 9 years, 1 month 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
« no previous file with comments | « src/mips/builtins-mips.cc ('k') | src/mips/full-codegen-mips.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 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1149 static void EmitSmiNonsmiComparison(MacroAssembler* masm, 1149 static void EmitSmiNonsmiComparison(MacroAssembler* masm,
1150 Register lhs, 1150 Register lhs,
1151 Register rhs, 1151 Register rhs,
1152 Label* both_loaded_as_doubles, 1152 Label* both_loaded_as_doubles,
1153 Label* slow, 1153 Label* slow,
1154 bool strict) { 1154 bool strict) {
1155 ASSERT((lhs.is(a0) && rhs.is(a1)) || 1155 ASSERT((lhs.is(a0) && rhs.is(a1)) ||
1156 (lhs.is(a1) && rhs.is(a0))); 1156 (lhs.is(a1) && rhs.is(a0)));
1157 1157
1158 Label lhs_is_smi; 1158 Label lhs_is_smi;
1159 __ And(t0, lhs, Operand(kSmiTagMask)); 1159 __ JumpIfSmi(lhs, &lhs_is_smi);
1160 __ Branch(&lhs_is_smi, eq, t0, Operand(zero_reg));
1161 // Rhs is a Smi. 1160 // Rhs is a Smi.
1162 // Check whether the non-smi is a heap number. 1161 // Check whether the non-smi is a heap number.
1163 __ GetObjectType(lhs, t4, t4); 1162 __ GetObjectType(lhs, t4, t4);
1164 if (strict) { 1163 if (strict) {
1165 // If lhs was not a number and rhs was a Smi then strict equality cannot 1164 // If lhs was not a number and rhs was a Smi then strict equality cannot
1166 // succeed. Return non-equal (lhs is already not zero). 1165 // succeed. Return non-equal (lhs is already not zero).
1167 __ mov(v0, lhs); 1166 __ mov(v0, lhs);
1168 __ Ret(ne, t4, Operand(HEAP_NUMBER_TYPE)); 1167 __ Ret(ne, t4, Operand(HEAP_NUMBER_TYPE));
1169 } else { 1168 } else {
1170 // Smi compared non-strictly with a non-Smi non-heap-number. Call 1169 // Smi compared non-strictly with a non-Smi non-heap-number. Call
(...skipping 3534 matching lines...) Expand 10 before | Expand all | Expand 10 after
4705 // Get the length of the string to r3. 4704 // Get the length of the string to r3.
4706 __ lw(a3, FieldMemOperand(subject, String::kLengthOffset)); 4705 __ lw(a3, FieldMemOperand(subject, String::kLengthOffset));
4707 4706
4708 // a2: Number of capture registers 4707 // a2: Number of capture registers
4709 // a3: Length of subject string as a smi 4708 // a3: Length of subject string as a smi
4710 // subject: Subject string 4709 // subject: Subject string
4711 // regexp_data: RegExp data (FixedArray) 4710 // regexp_data: RegExp data (FixedArray)
4712 // Check that the third argument is a positive smi less than the subject 4711 // Check that the third argument is a positive smi less than the subject
4713 // string length. A negative value will be greater (unsigned comparison). 4712 // string length. A negative value will be greater (unsigned comparison).
4714 __ lw(a0, MemOperand(sp, kPreviousIndexOffset)); 4713 __ lw(a0, MemOperand(sp, kPreviousIndexOffset));
4715 __ And(at, a0, Operand(kSmiTagMask)); 4714 __ JumpIfNotSmi(a0, &runtime);
4716 __ Branch(&runtime, ne, at, Operand(zero_reg));
4717 __ Branch(&runtime, ls, a3, Operand(a0)); 4715 __ Branch(&runtime, ls, a3, Operand(a0));
4718 4716
4719 // a2: Number of capture registers 4717 // a2: Number of capture registers
4720 // subject: Subject string 4718 // subject: Subject string
4721 // regexp_data: RegExp data (FixedArray) 4719 // regexp_data: RegExp data (FixedArray)
4722 // Check that the fourth object is a JSArray object. 4720 // Check that the fourth object is a JSArray object.
4723 __ lw(a0, MemOperand(sp, kLastMatchInfoOffset)); 4721 __ lw(a0, MemOperand(sp, kLastMatchInfoOffset));
4724 __ JumpIfSmi(a0, &runtime); 4722 __ JumpIfSmi(a0, &runtime);
4725 __ GetObjectType(a0, a1, a1); 4723 __ GetObjectType(a0, a1, a1);
4726 __ Branch(&runtime, ne, a1, Operand(JS_ARRAY_TYPE)); 4724 __ Branch(&runtime, ne, a1, Operand(JS_ARRAY_TYPE));
(...skipping 2742 matching lines...) Expand 10 before | Expand all | Expand 10 after
7469 7467
7470 // Fall through when we need to inform the incremental marker. 7468 // Fall through when we need to inform the incremental marker.
7471 } 7469 }
7472 7470
7473 7471
7474 #undef __ 7472 #undef __
7475 7473
7476 } } // namespace v8::internal 7474 } } // namespace v8::internal
7477 7475
7478 #endif // V8_TARGET_ARCH_MIPS 7476 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/builtins-mips.cc ('k') | src/mips/full-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698