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

Side by Side Diff: src/mips64/simulator-mips64.cc

Issue 1473683004: Lazily initialize fast_sqrt() and pass an Isolate parameter to it (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years 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/mips64/codegen-mips64.cc ('k') | src/ppc/codegen-ppc.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <limits.h> 5 #include <limits.h>
6 #include <stdarg.h> 6 #include <stdarg.h>
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include <cmath> 8 #include <cmath>
9 9
10 #if V8_TARGET_ARCH_MIPS64 10 #if V8_TARGET_ARCH_MIPS64
(...skipping 2241 matching lines...) Expand 10 before | Expand all | Expand 10 after
2252 case ABS_S: 2252 case ABS_S:
2253 set_fpu_register_float(fd_reg(), fabs(fs)); 2253 set_fpu_register_float(fd_reg(), fabs(fs));
2254 break; 2254 break;
2255 case MOV_S: 2255 case MOV_S:
2256 set_fpu_register_float(fd_reg(), fs); 2256 set_fpu_register_float(fd_reg(), fs);
2257 break; 2257 break;
2258 case NEG_S: 2258 case NEG_S:
2259 set_fpu_register_float(fd_reg(), -fs); 2259 set_fpu_register_float(fd_reg(), -fs);
2260 break; 2260 break;
2261 case SQRT_S: 2261 case SQRT_S:
2262 set_fpu_register_float(fd_reg(), fast_sqrt(fs)); 2262 lazily_initialize_fast_sqrt(isolate_);
2263 set_fpu_register_float(fd_reg(), fast_sqrt(fs, isolate_));
2263 break; 2264 break;
2264 case RSQRT_S: { 2265 case RSQRT_S: {
2265 float result = 1.0 / fast_sqrt(fs); 2266 lazily_initialize_fast_sqrt(isolate_);
2267 float result = 1.0 / fast_sqrt(fs, isolate_);
2266 set_fpu_register_float(fd_reg(), result); 2268 set_fpu_register_float(fd_reg(), result);
2267 break; 2269 break;
2268 } 2270 }
2269 case RECIP_S: { 2271 case RECIP_S: {
2270 float result = 1.0 / fs; 2272 float result = 1.0 / fs;
2271 set_fpu_register_float(fd_reg(), result); 2273 set_fpu_register_float(fd_reg(), result);
2272 break; 2274 break;
2273 } 2275 }
2274 case C_F_D: 2276 case C_F_D:
2275 set_fcsr_bit(fcsr_cc, false); 2277 set_fcsr_bit(fcsr_cc, false);
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
2757 case ABS_D: 2759 case ABS_D:
2758 set_fpu_register_double(fd_reg(), fabs(fs)); 2760 set_fpu_register_double(fd_reg(), fabs(fs));
2759 break; 2761 break;
2760 case MOV_D: 2762 case MOV_D:
2761 set_fpu_register_double(fd_reg(), fs); 2763 set_fpu_register_double(fd_reg(), fs);
2762 break; 2764 break;
2763 case NEG_D: 2765 case NEG_D:
2764 set_fpu_register_double(fd_reg(), -fs); 2766 set_fpu_register_double(fd_reg(), -fs);
2765 break; 2767 break;
2766 case SQRT_D: 2768 case SQRT_D:
2767 set_fpu_register_double(fd_reg(), fast_sqrt(fs)); 2769 lazily_initialize_fast_sqrt(isolate_);
2770 set_fpu_register_double(fd_reg(), fast_sqrt(fs, isolate_));
2768 break; 2771 break;
2769 case RSQRT_D: { 2772 case RSQRT_D: {
2770 double result = 1.0 / fast_sqrt(fs); 2773 lazily_initialize_fast_sqrt(isolate_);
2774 double result = 1.0 / fast_sqrt(fs, isolate_);
2771 set_fpu_register_double(fd_reg(), result); 2775 set_fpu_register_double(fd_reg(), result);
2772 break; 2776 break;
2773 } 2777 }
2774 case RECIP_D: { 2778 case RECIP_D: {
2775 double result = 1.0 / fs; 2779 double result = 1.0 / fs;
2776 set_fpu_register_double(fd_reg(), result); 2780 set_fpu_register_double(fd_reg(), result);
2777 break; 2781 break;
2778 } 2782 }
2779 case C_UN_D: 2783 case C_UN_D:
2780 set_fcsr_bit(fcsr_cc, std::isnan(fs) || std::isnan(ft)); 2784 set_fcsr_bit(fcsr_cc, std::isnan(fs) || std::isnan(ft));
(...skipping 1787 matching lines...) Expand 10 before | Expand all | Expand 10 after
4568 } 4572 }
4569 4573
4570 4574
4571 #undef UNSUPPORTED 4575 #undef UNSUPPORTED
4572 } // namespace internal 4576 } // namespace internal
4573 } // namespace v8 4577 } // namespace v8
4574 4578
4575 #endif // USE_SIMULATOR 4579 #endif // USE_SIMULATOR
4576 4580
4577 #endif // V8_TARGET_ARCH_MIPS64 4581 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips64/codegen-mips64.cc ('k') | src/ppc/codegen-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698