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

Unified Diff: src/x64/assembler-x64.h

Issue 285233010: Decouple CpuFeatures from serializer state. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/v8globals.h ('k') | src/x64/assembler-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/assembler-x64.h
diff --git a/src/x64/assembler-x64.h b/src/x64/assembler-x64.h
index 9d421ef6c11c10d4f76c386816615b938f44d7f2..d844d92599640fe6940318c56f379213e23ae98a 100644
--- a/src/x64/assembler-x64.h
+++ b/src/x64/assembler-x64.h
@@ -437,73 +437,6 @@ class Operand BASE_EMBEDDED {
};
-// CpuFeatures keeps track of which features are supported by the target CPU.
-// Supported features must be enabled by a CpuFeatureScope before use.
-// Example:
-// if (assembler->IsSupported(SSE3)) {
-// CpuFeatureScope fscope(assembler, SSE3);
-// // Generate SSE3 floating point code.
-// } else {
-// // Generate standard SSE2 floating point code.
-// }
-class CpuFeatures : public AllStatic {
- public:
- // Detect features of the target CPU. Set safe defaults if the serializer
- // is enabled (snapshots must be portable).
- static void Probe(bool serializer_enabled);
-
- // Check whether a feature is supported by the target CPU.
- static bool IsSupported(CpuFeature f) {
- if (Check(f, cross_compile_)) return true;
- ASSERT(initialized_);
- if (f == SSE3 && !FLAG_enable_sse3) return false;
- if (f == SSE4_1 && !FLAG_enable_sse4_1) return false;
- if (f == SAHF && !FLAG_enable_sahf) return false;
- return Check(f, supported_);
- }
-
- static bool IsSafeForSnapshot(Isolate* isolate, CpuFeature f) {
- return Check(f, cross_compile_) ||
- (IsSupported(f) &&
- !(Serializer::enabled(isolate) &&
- Check(f, found_by_runtime_probing_only_)));
- }
-
- static bool VerifyCrossCompiling() {
- return cross_compile_ == 0;
- }
-
- static bool VerifyCrossCompiling(CpuFeature f) {
- uint64_t mask = flag2set(f);
- return cross_compile_ == 0 ||
- (cross_compile_ & mask) == mask;
- }
-
- static bool SupportsCrankshaft() { return true; }
-
- private:
- static bool Check(CpuFeature f, uint64_t set) {
- return (set & flag2set(f)) != 0;
- }
-
- static uint64_t flag2set(CpuFeature f) {
- return static_cast<uint64_t>(1) << f;
- }
-
-#ifdef DEBUG
- static bool initialized_;
-#endif
- static uint64_t supported_;
- static uint64_t found_by_runtime_probing_only_;
-
- static uint64_t cross_compile_;
-
- friend class ExternalReference;
- friend class PlatformFeatureScope;
- DISALLOW_COPY_AND_ASSIGN(CpuFeatures);
-};
-
-
#define ASSEMBLER_INSTRUCTION_LIST(V) \
V(add) \
V(and) \
« no previous file with comments | « src/v8globals.h ('k') | src/x64/assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698