OLD | NEW |
---|---|
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 10187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
10198 // trashed registers. | 10198 // trashed registers. |
10199 void IntegerConvert(MacroAssembler* masm, | 10199 void IntegerConvert(MacroAssembler* masm, |
10200 Register source, | 10200 Register source, |
10201 TypeInfo type_info, | 10201 TypeInfo type_info, |
10202 bool use_sse3, | 10202 bool use_sse3, |
10203 Label* conversion_failure) { | 10203 Label* conversion_failure) { |
10204 ASSERT(!source.is(ecx) && !source.is(edi) && !source.is(ebx)); | 10204 ASSERT(!source.is(ecx) && !source.is(edi) && !source.is(ebx)); |
10205 Label done, right_exponent, normal_exponent; | 10205 Label done, right_exponent, normal_exponent; |
10206 Register scratch = ebx; | 10206 Register scratch = ebx; |
10207 Register scratch2 = edi; | 10207 Register scratch2 = edi; |
10208 if (type_info.IsInteger32() && CpuFeatures::IsEnabled(SSE2)) { | |
10209 if (FLAG_debug_code) { | |
10210 // Do some testing to see that the type info is correct. | |
William Hesse
2010/05/10 11:08:43
This comment should be a TODO, or it should actual
Lasse Reichstein
2010/05/10 11:20:44
Removed (I meant to but forgot, well spotted).
| |
10211 } | |
10212 CpuFeatures::Scope scope(SSE2); | |
10213 __ cvttsd2si(ecx, FieldOperand(source, HeapNumber::kValueOffset)); | |
10214 return; | |
10215 } | |
10208 if (!type_info.IsInteger32() || !use_sse3) { | 10216 if (!type_info.IsInteger32() || !use_sse3) { |
10209 // Get exponent word. | 10217 // Get exponent word. |
10210 __ mov(scratch, FieldOperand(source, HeapNumber::kExponentOffset)); | 10218 __ mov(scratch, FieldOperand(source, HeapNumber::kExponentOffset)); |
10211 // Get exponent alone in scratch2. | 10219 // Get exponent alone in scratch2. |
10212 __ mov(scratch2, scratch); | 10220 __ mov(scratch2, scratch); |
10213 __ and_(scratch2, HeapNumber::kExponentMask); | 10221 __ and_(scratch2, HeapNumber::kExponentMask); |
10214 } | 10222 } |
10215 if (use_sse3) { | 10223 if (use_sse3) { |
10216 CpuFeatures::Scope scope(SSE3); | 10224 CpuFeatures::Scope scope(SSE3); |
10217 if (!type_info.IsInteger32()) { | 10225 if (!type_info.IsInteger32()) { |
(...skipping 2980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
13198 | 13206 |
13199 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) | 13207 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) |
13200 // tagged as a small integer. | 13208 // tagged as a small integer. |
13201 __ bind(&runtime); | 13209 __ bind(&runtime); |
13202 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); | 13210 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); |
13203 } | 13211 } |
13204 | 13212 |
13205 #undef __ | 13213 #undef __ |
13206 | 13214 |
13207 } } // namespace v8::internal | 13215 } } // namespace v8::internal |
OLD | NEW |