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

Side by Side Diff: src/ia32/stub-cache-ia32.cc

Issue 27197013: Tweak Math.log on ia32/x64 (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: addressed comments Created 7 years, 2 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
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/x64/lithium-codegen-x64.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 861 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 __ pop(value_reg); 872 __ pop(value_reg);
873 } 873 }
874 __ SmiTag(value_reg); 874 __ SmiTag(value_reg);
875 __ jmp(&do_store); 875 __ jmp(&do_store);
876 876
877 __ bind(&heap_number); 877 __ bind(&heap_number);
878 __ CheckMap(value_reg, masm->isolate()->factory()->heap_number_map(), 878 __ CheckMap(value_reg, masm->isolate()->factory()->heap_number_map(),
879 miss_label, DONT_DO_SMI_CHECK); 879 miss_label, DONT_DO_SMI_CHECK);
880 if (CpuFeatures::IsSupported(SSE2)) { 880 if (CpuFeatures::IsSupported(SSE2)) {
881 CpuFeatureScope use_sse2(masm, SSE2); 881 CpuFeatureScope use_sse2(masm, SSE2);
882 __ movdbl(xmm0, FieldOperand(value_reg, HeapNumber::kValueOffset)); 882 __ movsd(xmm0, FieldOperand(value_reg, HeapNumber::kValueOffset));
883 } else { 883 } else {
884 __ fld_d(FieldOperand(value_reg, HeapNumber::kValueOffset)); 884 __ fld_d(FieldOperand(value_reg, HeapNumber::kValueOffset));
885 } 885 }
886 886
887 __ bind(&do_store); 887 __ bind(&do_store);
888 if (CpuFeatures::IsSupported(SSE2)) { 888 if (CpuFeatures::IsSupported(SSE2)) {
889 CpuFeatureScope use_sse2(masm, SSE2); 889 CpuFeatureScope use_sse2(masm, SSE2);
890 __ movdbl(FieldOperand(storage_reg, HeapNumber::kValueOffset), xmm0); 890 __ movsd(FieldOperand(storage_reg, HeapNumber::kValueOffset), xmm0);
891 } else { 891 } else {
892 __ fstp_d(FieldOperand(storage_reg, HeapNumber::kValueOffset)); 892 __ fstp_d(FieldOperand(storage_reg, HeapNumber::kValueOffset));
893 } 893 }
894 } 894 }
895 895
896 // Stub never generated for non-global objects that require access 896 // Stub never generated for non-global objects that require access
897 // checks. 897 // checks.
898 ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded()); 898 ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded());
899 899
900 // Perform map transition for the receiver if necessary. 900 // Perform map transition for the receiver if necessary.
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 __ fild_s(Operand(esp, 0)); 1050 __ fild_s(Operand(esp, 0));
1051 __ pop(value_reg); 1051 __ pop(value_reg);
1052 } 1052 }
1053 __ SmiTag(value_reg); 1053 __ SmiTag(value_reg);
1054 __ jmp(&do_store); 1054 __ jmp(&do_store);
1055 __ bind(&heap_number); 1055 __ bind(&heap_number);
1056 __ CheckMap(value_reg, masm->isolate()->factory()->heap_number_map(), 1056 __ CheckMap(value_reg, masm->isolate()->factory()->heap_number_map(),
1057 miss_label, DONT_DO_SMI_CHECK); 1057 miss_label, DONT_DO_SMI_CHECK);
1058 if (CpuFeatures::IsSupported(SSE2)) { 1058 if (CpuFeatures::IsSupported(SSE2)) {
1059 CpuFeatureScope use_sse2(masm, SSE2); 1059 CpuFeatureScope use_sse2(masm, SSE2);
1060 __ movdbl(xmm0, FieldOperand(value_reg, HeapNumber::kValueOffset)); 1060 __ movsd(xmm0, FieldOperand(value_reg, HeapNumber::kValueOffset));
1061 } else { 1061 } else {
1062 __ fld_d(FieldOperand(value_reg, HeapNumber::kValueOffset)); 1062 __ fld_d(FieldOperand(value_reg, HeapNumber::kValueOffset));
1063 } 1063 }
1064 __ bind(&do_store); 1064 __ bind(&do_store);
1065 if (CpuFeatures::IsSupported(SSE2)) { 1065 if (CpuFeatures::IsSupported(SSE2)) {
1066 CpuFeatureScope use_sse2(masm, SSE2); 1066 CpuFeatureScope use_sse2(masm, SSE2);
1067 __ movdbl(FieldOperand(scratch1, HeapNumber::kValueOffset), xmm0); 1067 __ movsd(FieldOperand(scratch1, HeapNumber::kValueOffset), xmm0);
1068 } else { 1068 } else {
1069 __ fstp_d(FieldOperand(scratch1, HeapNumber::kValueOffset)); 1069 __ fstp_d(FieldOperand(scratch1, HeapNumber::kValueOffset));
1070 } 1070 }
1071 // Return the value (register eax). 1071 // Return the value (register eax).
1072 ASSERT(value_reg.is(eax)); 1072 ASSERT(value_reg.is(eax));
1073 __ ret(0); 1073 __ ret(0);
1074 return; 1074 return;
1075 } 1075 }
1076 1076
1077 ASSERT(!FLAG_track_double_fields || !representation.IsDouble()); 1077 ASSERT(!FLAG_track_double_fields || !representation.IsDouble());
(...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after
2390 __ mov(eax, Operand(esp, 1 * kPointerSize)); 2390 __ mov(eax, Operand(esp, 1 * kPointerSize));
2391 2391
2392 // Check if the argument is a smi. 2392 // Check if the argument is a smi.
2393 Label smi; 2393 Label smi;
2394 STATIC_ASSERT(kSmiTag == 0); 2394 STATIC_ASSERT(kSmiTag == 0);
2395 __ JumpIfSmi(eax, &smi); 2395 __ JumpIfSmi(eax, &smi);
2396 2396
2397 // Check if the argument is a heap number and load its value into xmm0. 2397 // Check if the argument is a heap number and load its value into xmm0.
2398 Label slow; 2398 Label slow;
2399 __ CheckMap(eax, factory()->heap_number_map(), &slow, DONT_DO_SMI_CHECK); 2399 __ CheckMap(eax, factory()->heap_number_map(), &slow, DONT_DO_SMI_CHECK);
2400 __ movdbl(xmm0, FieldOperand(eax, HeapNumber::kValueOffset)); 2400 __ movsd(xmm0, FieldOperand(eax, HeapNumber::kValueOffset));
2401 2401
2402 // Check if the argument is strictly positive. Note this also 2402 // Check if the argument is strictly positive. Note this also
2403 // discards NaN. 2403 // discards NaN.
2404 __ xorpd(xmm1, xmm1); 2404 __ xorpd(xmm1, xmm1);
2405 __ ucomisd(xmm0, xmm1); 2405 __ ucomisd(xmm0, xmm1);
2406 __ j(below_equal, &slow); 2406 __ j(below_equal, &slow);
2407 2407
2408 // Do a truncating conversion. 2408 // Do a truncating conversion.
2409 __ cvttsd2si(eax, Operand(xmm0)); 2409 __ cvttsd2si(eax, Operand(xmm0));
2410 2410
(...skipping 29 matching lines...) Expand all
2440 // xmm2 = 0...0 2440 // xmm2 = 0...0
2441 __ cmpltsd(xmm2, xmm0); 2441 __ cmpltsd(xmm2, xmm0);
2442 2442
2443 // Subtract 1 if the argument was less than the tentative result. 2443 // Subtract 1 if the argument was less than the tentative result.
2444 __ LoadPowerOf2(xmm1, ebx, 0); 2444 __ LoadPowerOf2(xmm1, ebx, 0);
2445 __ andpd(xmm1, xmm2); 2445 __ andpd(xmm1, xmm2);
2446 __ subsd(xmm0, xmm1); 2446 __ subsd(xmm0, xmm1);
2447 2447
2448 // Return a new heap number. 2448 // Return a new heap number.
2449 __ AllocateHeapNumber(eax, ebx, edx, &slow); 2449 __ AllocateHeapNumber(eax, ebx, edx, &slow);
2450 __ movdbl(FieldOperand(eax, HeapNumber::kValueOffset), xmm0); 2450 __ movsd(FieldOperand(eax, HeapNumber::kValueOffset), xmm0);
2451 __ ret(2 * kPointerSize); 2451 __ ret(2 * kPointerSize);
2452 2452
2453 // Return the argument (when it's an already round heap number). 2453 // Return the argument (when it's an already round heap number).
2454 __ bind(&already_round); 2454 __ bind(&already_round);
2455 __ mov(eax, Operand(esp, 1 * kPointerSize)); 2455 __ mov(eax, Operand(esp, 1 * kPointerSize));
2456 __ ret(2 * kPointerSize); 2456 __ ret(2 * kPointerSize);
2457 2457
2458 // Tail call the full function. We do not have to patch the receiver 2458 // Tail call the full function. We do not have to patch the receiver
2459 // because the function makes no use of it. 2459 // because the function makes no use of it.
2460 __ bind(&slow); 2460 __ bind(&slow);
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
3267 // ----------------------------------- 3267 // -----------------------------------
3268 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); 3268 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric);
3269 } 3269 }
3270 3270
3271 3271
3272 #undef __ 3272 #undef __
3273 3273
3274 } } // namespace v8::internal 3274 } } // namespace v8::internal
3275 3275
3276 #endif // V8_TARGET_ARCH_IA32 3276 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698