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

Side by Side Diff: src/codegen.cc

Issue 6895014: Avoid hidden TLS access in CpuProfiler::is_profiling(). (Closed)
Patch Set: Created 9 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
« no previous file with comments | « no previous file | src/compiler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 } 169 }
170 #endif // ENABLE_DISASSEMBLER 170 #endif // ENABLE_DISASSEMBLER
171 } 171 }
172 172
173 #ifdef ENABLE_LOGGING_AND_PROFILING 173 #ifdef ENABLE_LOGGING_AND_PROFILING
174 174
175 static Vector<const char> kRegexp = CStrVector("regexp"); 175 static Vector<const char> kRegexp = CStrVector("regexp");
176 176
177 bool CodeGenerator::ShouldGenerateLog(Expression* type) { 177 bool CodeGenerator::ShouldGenerateLog(Expression* type) {
178 ASSERT(type != NULL); 178 ASSERT(type != NULL);
179 if (!LOGGER->is_logging() && !CpuProfiler::is_profiling()) return false; 179 Isolate* isolate = Isolate::Current();
180 if (!isolate->logger()->is_logging() && !CpuProfiler::is_profiling(isolate)) {
181 return false;
182 }
180 Handle<String> name = Handle<String>::cast(type->AsLiteral()->handle()); 183 Handle<String> name = Handle<String>::cast(type->AsLiteral()->handle());
181 if (FLAG_log_regexp) { 184 if (FLAG_log_regexp) {
182 if (name->IsEqualTo(kRegexp)) 185 if (name->IsEqualTo(kRegexp))
183 return true; 186 return true;
184 } 187 }
185 return false; 188 return false;
186 } 189 }
187 190
188 #endif 191 #endif
189 192
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 int result = save_doubles_ ? 1 : 0; 246 int result = save_doubles_ ? 1 : 0;
244 #ifdef _WIN64 247 #ifdef _WIN64
245 return result | ((result_size_ == 1) ? 0 : 2); 248 return result | ((result_size_ == 1) ? 0 : 2);
246 #else 249 #else
247 return result; 250 return result;
248 #endif 251 #endif
249 } 252 }
250 253
251 254
252 } } // namespace v8::internal 255 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698