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

Side by Side Diff: runtime/vm/cpu_mips.h

Issue 120723003: Refactors CPU feature detection. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 #ifndef VM_CPU_MIPS_H_
6 #define VM_CPU_MIPS_H_
7
8 #include "vm/allocation.h"
9
10 namespace dart {
11
12 // TargetCPUFeatures gives CPU features for the architecture that we are
13 // generating code for. HostCPUFeatures gives the CPU features for the
14 // architecture that we are actually running on. When the architectures
15 // are the same, TargetCPUFeatures will query HostCPUFeatures. When they are
16 // different (i.e. we are running in a simulator), HostCPUFeatures will
17 // additionally mock the options needed for the target architecture so that
18 // they may be altered for testing.
19
20 class HostCPUFeatures: public AllStatic {
21 public:
22 static void InitOnce();
23 static char* hardware() {
24 DEBUG_ASSERT(initialized_);
25 return hardware_;
26 }
27
28 private:
29 static char* hardware_;
30 #if defined(DEBUG)
31 static bool initialized_;
32 #endif
33 };
34
35 class TargetCPUFeatures : public AllStatic {
36 public:
37 static void InitOnce() { HostCPUFeatures::InitOnce(); }
38 static bool double_truncate_round_supported() { return false; }
39 };
40
41 } // namespace dart
42
43 #endif // VM_CPU_MIPS_H_
OLDNEW
« no previous file with comments | « runtime/vm/cpu_ia32.cc ('k') | runtime/vm/cpu_mips.cc » ('j') | runtime/vm/cpuinfo_linux.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698