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

Side by Side Diff: src/mips/assembler-mips.cc

Issue 239173004: MIPS: Serializer enable/disable flags need thread safety. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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
« no previous file with comments | « src/mips/assembler-mips.h ('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 28 matching lines...) Expand all
39 39
40 #include "mips/assembler-mips-inl.h" 40 #include "mips/assembler-mips-inl.h"
41 #include "serialize.h" 41 #include "serialize.h"
42 42
43 namespace v8 { 43 namespace v8 {
44 namespace internal { 44 namespace internal {
45 45
46 #ifdef DEBUG 46 #ifdef DEBUG
47 bool CpuFeatures::initialized_ = false; 47 bool CpuFeatures::initialized_ = false;
48 #endif 48 #endif
49 bool CpuFeatures::hint_creating_snapshot_ = false;
49 unsigned CpuFeatures::supported_ = 0; 50 unsigned CpuFeatures::supported_ = 0;
50 unsigned CpuFeatures::found_by_runtime_probing_only_ = 0; 51 unsigned CpuFeatures::found_by_runtime_probing_only_ = 0;
51 unsigned CpuFeatures::cross_compile_ = 0; 52 unsigned CpuFeatures::cross_compile_ = 0;
52 53
53 54
54 ExternalReference ExternalReference::cpu_features() { 55 ExternalReference ExternalReference::cpu_features() {
55 ASSERT(CpuFeatures::initialized_); 56 ASSERT(CpuFeatures::initialized_);
56 return ExternalReference(&CpuFeatures::supported_); 57 return ExternalReference(&CpuFeatures::supported_);
57 } 58 }
58 59
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 "f18", 96 "f18",
96 "f20", 97 "f20",
97 "f22", 98 "f22",
98 "f24", 99 "f24",
99 "f26" 100 "f26"
100 }; 101 };
101 return names[index]; 102 return names[index];
102 } 103 }
103 104
104 105
106 void CpuFeatures::SetHintCreatingSnapshot() {
107 hint_creating_snapshot_ = true;
108 }
109
110
111 void CpuFeatures::ProbeWithoutIsolate() {
112 Probe(hint_creating_snapshot_);
113 }
114
115
105 void CpuFeatures::Probe() { 116 void CpuFeatures::Probe() {
117 // The Serializer can only be queried after isolate initialization.
118 Probe(Serializer::enabled());
119 }
120
121
122 void CpuFeatures::Probe(bool serializer_enabled) {
106 unsigned standard_features = (OS::CpuFeaturesImpliedByPlatform() | 123 unsigned standard_features = (OS::CpuFeaturesImpliedByPlatform() |
107 CpuFeaturesImpliedByCompiler()); 124 CpuFeaturesImpliedByCompiler());
108 ASSERT(supported_ == 0 || 125 ASSERT(supported_ == 0 ||
109 (supported_ & standard_features) == standard_features); 126 (supported_ & standard_features) == standard_features);
110 #ifdef DEBUG 127 #ifdef DEBUG
111 initialized_ = true; 128 initialized_ = true;
112 #endif 129 #endif
113 130
114 // Get the features implied by the OS and the compiler settings. This is the 131 // Get the features implied by the OS and the compiler settings. This is the
115 // minimal set of features which is also allowed for generated code in the 132 // minimal set of features which is also allowed for generated code in the
116 // snapshot. 133 // snapshot.
117 supported_ |= standard_features; 134 supported_ |= standard_features;
118 135
119 if (Serializer::enabled()) { 136 if (serializer_enabled) {
120 // No probing for features if we might serialize (generate snapshot). 137 // No probing for features if we might serialize (generate snapshot).
121 return; 138 return;
122 } 139 }
123 140
124 // If the compiler is allowed to use fpu then we can use fpu too in our 141 // If the compiler is allowed to use fpu then we can use fpu too in our
125 // code generation. 142 // code generation.
126 #if !defined(__mips__) 143 #if !defined(__mips__)
127 // For the simulator build, use FPU. 144 // For the simulator build, use FPU.
128 supported_ |= static_cast<uint64_t>(1) << FPU; 145 supported_ |= static_cast<uint64_t>(1) << FPU;
129 #else 146 #else
(...skipping 1943 matching lines...) Expand 10 before | Expand all | Expand 10 after
2073 // Adjust code for new modes. 2090 // Adjust code for new modes.
2074 ASSERT(RelocInfo::IsDebugBreakSlot(rmode) 2091 ASSERT(RelocInfo::IsDebugBreakSlot(rmode)
2075 || RelocInfo::IsJSReturn(rmode) 2092 || RelocInfo::IsJSReturn(rmode)
2076 || RelocInfo::IsComment(rmode) 2093 || RelocInfo::IsComment(rmode)
2077 || RelocInfo::IsPosition(rmode)); 2094 || RelocInfo::IsPosition(rmode));
2078 // These modes do not need an entry in the constant pool. 2095 // These modes do not need an entry in the constant pool.
2079 } 2096 }
2080 if (!RelocInfo::IsNone(rinfo.rmode())) { 2097 if (!RelocInfo::IsNone(rinfo.rmode())) {
2081 // Don't record external references unless the heap will be serialized. 2098 // Don't record external references unless the heap will be serialized.
2082 if (rmode == RelocInfo::EXTERNAL_REFERENCE) { 2099 if (rmode == RelocInfo::EXTERNAL_REFERENCE) {
2083 #ifdef DEBUG
2084 if (!Serializer::enabled()) {
2085 Serializer::TooLateToEnableNow();
2086 }
2087 #endif
2088 if (!Serializer::enabled() && !emit_debug_code()) { 2100 if (!Serializer::enabled() && !emit_debug_code()) {
2089 return; 2101 return;
2090 } 2102 }
2091 } 2103 }
2092 ASSERT(buffer_space() >= kMaxRelocSize); // Too late to grow buffer here. 2104 ASSERT(buffer_space() >= kMaxRelocSize); // Too late to grow buffer here.
2093 if (rmode == RelocInfo::CODE_TARGET_WITH_ID) { 2105 if (rmode == RelocInfo::CODE_TARGET_WITH_ID) {
2094 RelocInfo reloc_info_with_ast_id(pc_, 2106 RelocInfo reloc_info_with_ast_id(pc_,
2095 rmode, 2107 rmode,
2096 RecordedAstId().ToInt(), 2108 RecordedAstId().ToInt(),
2097 NULL); 2109 NULL);
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
2343 void Assembler::PopulateConstantPool(ConstantPoolArray* constant_pool) { 2355 void Assembler::PopulateConstantPool(ConstantPoolArray* constant_pool) {
2344 // No out-of-line constant pool support. 2356 // No out-of-line constant pool support.
2345 ASSERT(!FLAG_enable_ool_constant_pool); 2357 ASSERT(!FLAG_enable_ool_constant_pool);
2346 return; 2358 return;
2347 } 2359 }
2348 2360
2349 2361
2350 } } // namespace v8::internal 2362 } } // namespace v8::internal
2351 2363
2352 #endif // V8_TARGET_ARCH_MIPS 2364 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/assembler-mips.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698