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

Unified Diff: src/assembler.cc

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/assembler.h ('k') | src/code-stubs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/assembler.cc
diff --git a/src/assembler.cc b/src/assembler.cc
index 38604538b5894cf841abd6faf1dc941da351e410..103ca139f523a7f2becd3a066ab570b157f19fd8 100644
--- a/src/assembler.cc
+++ b/src/assembler.cc
@@ -123,7 +123,8 @@ AssemblerBase::AssemblerBase(Isolate* isolate, void* buffer, int buffer_size)
jit_cookie_(0),
enabled_cpu_features_(0),
emit_debug_code_(FLAG_debug_code),
- predictable_code_size_(false) {
+ predictable_code_size_(false),
+ serializer_enabled_(Serializer::enabled(isolate)) {
if (FLAG_mask_constants_with_cookie && isolate != NULL) {
jit_cookie_ = isolate->random_number_generator()->NextInt();
}
@@ -191,7 +192,7 @@ PredictableCodeSizeScope::~PredictableCodeSizeScope() {
#ifdef DEBUG
CpuFeatureScope::CpuFeatureScope(AssemblerBase* assembler, CpuFeature f)
: assembler_(assembler) {
- ASSERT(CpuFeatures::IsSafeForSnapshot(assembler_->isolate(), f));
+ ASSERT(CpuFeatures::IsSupported(f));
old_enabled_ = assembler_->enabled_cpu_features();
uint64_t mask = static_cast<uint64_t>(1) << f;
// TODO(svenpanne) This special case below doesn't belong here!
@@ -211,23 +212,9 @@ CpuFeatureScope::~CpuFeatureScope() {
#endif
-// -----------------------------------------------------------------------------
-// Implementation of PlatformFeatureScope
-
-PlatformFeatureScope::PlatformFeatureScope(Isolate* isolate, CpuFeature f)
- : isolate_(isolate), old_cross_compile_(CpuFeatures::cross_compile_) {
- // CpuFeatures is a global singleton, therefore this is only safe in
- // single threaded code.
- ASSERT(Serializer::enabled(isolate));
- uint64_t mask = static_cast<uint64_t>(1) << f;
- CpuFeatures::cross_compile_ |= mask;
- USE(isolate_);
-}
-
-
-PlatformFeatureScope::~PlatformFeatureScope() {
- CpuFeatures::cross_compile_ = old_cross_compile_;
-}
+bool CpuFeatures::initialized_ = false;
+unsigned CpuFeatures::supported_ = 0;
+unsigned CpuFeatures::cache_line_size_ = 0;
// -----------------------------------------------------------------------------
@@ -1438,6 +1425,12 @@ ExternalReference ExternalReference::ForDeoptEntry(Address entry) {
}
+ExternalReference ExternalReference::cpu_features() {
+ ASSERT(CpuFeatures::initialized_);
+ return ExternalReference(&CpuFeatures::supported_);
+}
+
+
double power_helper(double x, double y) {
int y_int = static_cast<int>(y);
if (y == y_int) {
« no previous file with comments | « src/assembler.h ('k') | src/code-stubs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698