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

Side by Side Diff: src/mips/simulator-mips.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/mips/codegen-mips.cc ('k') | src/mips64/codegen-mips64.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_MIPS 10 #if V8_TARGET_ARCH_MIPS
(...skipping 2354 matching lines...) Expand 10 before | Expand all | Expand 10 after
2365 case ABS_D: 2365 case ABS_D:
2366 set_fpu_register_double(fd_reg(), fabs(fs)); 2366 set_fpu_register_double(fd_reg(), fabs(fs));
2367 break; 2367 break;
2368 case MOV_D: 2368 case MOV_D:
2369 set_fpu_register_double(fd_reg(), fs); 2369 set_fpu_register_double(fd_reg(), fs);
2370 break; 2370 break;
2371 case NEG_D: 2371 case NEG_D:
2372 set_fpu_register_double(fd_reg(), -fs); 2372 set_fpu_register_double(fd_reg(), -fs);
2373 break; 2373 break;
2374 case SQRT_D: 2374 case SQRT_D:
2375 set_fpu_register_double(fd_reg(), fast_sqrt(fs)); 2375 lazily_initialize_fast_sqrt(isolate_);
2376 set_fpu_register_double(fd_reg(), fast_sqrt(fs, isolate_));
2376 break; 2377 break;
2377 case RSQRT_D: { 2378 case RSQRT_D: {
2378 DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)); 2379 DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6));
2379 double result = 1.0 / fast_sqrt(fs); 2380 lazily_initialize_fast_sqrt(isolate_);
2381 double result = 1.0 / fast_sqrt(fs, isolate_);
2380 set_fpu_register_double(fd_reg(), result); 2382 set_fpu_register_double(fd_reg(), result);
2381 break; 2383 break;
2382 } 2384 }
2383 case RECIP_D: { 2385 case RECIP_D: {
2384 DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)); 2386 DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6));
2385 double result = 1.0 / fs; 2387 double result = 1.0 / fs;
2386 set_fpu_register_double(fd_reg(), result); 2388 set_fpu_register_double(fd_reg(), result);
2387 break; 2389 break;
2388 } 2390 }
2389 case C_UN_D: 2391 case C_UN_D:
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
2768 case ABS_S: 2770 case ABS_S:
2769 set_fpu_register_float(fd_reg(), fabs(fs)); 2771 set_fpu_register_float(fd_reg(), fabs(fs));
2770 break; 2772 break;
2771 case MOV_S: 2773 case MOV_S:
2772 set_fpu_register_float(fd_reg(), fs); 2774 set_fpu_register_float(fd_reg(), fs);
2773 break; 2775 break;
2774 case NEG_S: 2776 case NEG_S:
2775 set_fpu_register_float(fd_reg(), -fs); 2777 set_fpu_register_float(fd_reg(), -fs);
2776 break; 2778 break;
2777 case SQRT_S: 2779 case SQRT_S:
2778 set_fpu_register_float(fd_reg(), fast_sqrt(fs)); 2780 lazily_initialize_fast_sqrt(isolate_);
2781 set_fpu_register_float(fd_reg(), fast_sqrt(fs, isolate_));
2779 break; 2782 break;
2780 case RSQRT_S: { 2783 case RSQRT_S: {
2781 DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)); 2784 DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6));
2782 float result = 1.0 / fast_sqrt(fs); 2785 lazily_initialize_fast_sqrt(isolate_);
2786 float result = 1.0 / fast_sqrt(fs, isolate_);
2783 set_fpu_register_float(fd_reg(), result); 2787 set_fpu_register_float(fd_reg(), result);
2784 break; 2788 break;
2785 } 2789 }
2786 case RECIP_S: { 2790 case RECIP_S: {
2787 DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)); 2791 DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6));
2788 float result = 1.0 / fs; 2792 float result = 1.0 / fs;
2789 set_fpu_register_float(fd_reg(), result); 2793 set_fpu_register_float(fd_reg(), result);
2790 break; 2794 break;
2791 } 2795 }
2792 case C_F_D: 2796 case C_F_D:
(...skipping 1638 matching lines...) Expand 10 before | Expand all | Expand 10 after
4431 4435
4432 4436
4433 #undef UNSUPPORTED 4437 #undef UNSUPPORTED
4434 4438
4435 } // namespace internal 4439 } // namespace internal
4436 } // namespace v8 4440 } // namespace v8
4437 4441
4438 #endif // USE_SIMULATOR 4442 #endif // USE_SIMULATOR
4439 4443
4440 #endif // V8_TARGET_ARCH_MIPS 4444 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/codegen-mips.cc ('k') | src/mips64/codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698