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

Side by Side Diff: src/x64/assembler-x64.h

Issue 12391033: Make sure that on x86 we don't generate SSE2 code in the snapshot. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: New method CpuFeatures::IsSafeForSnapshot(). Created 7 years, 9 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 | Annotate | Revision Log
« src/isolate.cc ('K') | « src/mips/builtins-mips.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 if (f == SAHF && !FLAG_enable_sahf) return false; 467 if (f == SAHF && !FLAG_enable_sahf) return false;
468 return (supported_ & (static_cast<uint64_t>(1) << f)) != 0; 468 return (supported_ & (static_cast<uint64_t>(1) << f)) != 0;
469 } 469 }
470 470
471 static bool IsFoundByRuntimeProbingOnly(CpuFeature f) { 471 static bool IsFoundByRuntimeProbingOnly(CpuFeature f) {
472 ASSERT(initialized_); 472 ASSERT(initialized_);
473 return (found_by_runtime_probing_only_ & 473 return (found_by_runtime_probing_only_ &
474 (static_cast<uint64_t>(1) << f)) != 0; 474 (static_cast<uint64_t>(1) << f)) != 0;
475 } 475 }
476 476
477 static bool IsSafeForSnapshot(CpuFeature f) {
478 return (IsSupported(f) &&
479 (!Serializer::enabled() || !IsFoundByRuntimeProbingOnly(f)));
480 }
481
477 private: 482 private:
478 // Safe defaults include SSE2 and CMOV for X64. It is always available, if 483 // Safe defaults include SSE2 and CMOV for X64. It is always available, if
479 // anyone checks, but they shouldn't need to check. 484 // anyone checks, but they shouldn't need to check.
480 // The required user mode extensions in X64 are (from AMD64 ABI Table A.1): 485 // The required user mode extensions in X64 are (from AMD64 ABI Table A.1):
481 // fpu, tsc, cx8, cmov, mmx, sse, sse2, fxsr, syscall 486 // fpu, tsc, cx8, cmov, mmx, sse, sse2, fxsr, syscall
482 static const uint64_t kDefaultCpuFeatures = (1 << SSE2 | 1 << CMOV); 487 static const uint64_t kDefaultCpuFeatures = (1 << SSE2 | 1 << CMOV);
483 488
484 #ifdef DEBUG 489 #ifdef DEBUG
485 static bool initialized_; 490 static bool initialized_;
486 #endif 491 #endif
(...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1626 private: 1631 private:
1627 Assembler* assembler_; 1632 Assembler* assembler_;
1628 #ifdef DEBUG 1633 #ifdef DEBUG
1629 int space_before_; 1634 int space_before_;
1630 #endif 1635 #endif
1631 }; 1636 };
1632 1637
1633 } } // namespace v8::internal 1638 } } // namespace v8::internal
1634 1639
1635 #endif // V8_X64_ASSEMBLER_X64_H_ 1640 #endif // V8_X64_ASSEMBLER_X64_H_
OLDNEW
« src/isolate.cc ('K') | « src/mips/builtins-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698