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

Side by Side Diff: src/heap.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 | « src/cpu-profiler.cc ('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 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 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 1340
1341 if (logging_and_profiling_mode == LOGGING_AND_PROFILING_ENABLED) { 1341 if (logging_and_profiling_mode == LOGGING_AND_PROFILING_ENABLED) {
1342 #if defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING) 1342 #if defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING)
1343 // Update NewSpace stats if necessary. 1343 // Update NewSpace stats if necessary.
1344 RecordCopiedObject(heap, target); 1344 RecordCopiedObject(heap, target);
1345 #endif 1345 #endif
1346 HEAP_PROFILE(heap, ObjectMoveEvent(source->address(), target->address())); 1346 HEAP_PROFILE(heap, ObjectMoveEvent(source->address(), target->address()));
1347 #if defined(ENABLE_LOGGING_AND_PROFILING) 1347 #if defined(ENABLE_LOGGING_AND_PROFILING)
1348 Isolate* isolate = heap->isolate(); 1348 Isolate* isolate = heap->isolate();
1349 if (isolate->logger()->is_logging() || 1349 if (isolate->logger()->is_logging() ||
1350 isolate->cpu_profiler()->is_profiling()) { 1350 CpuProfiler::is_profiling(isolate)) {
1351 if (target->IsSharedFunctionInfo()) { 1351 if (target->IsSharedFunctionInfo()) {
1352 PROFILE(isolate, SharedFunctionInfoMoveEvent( 1352 PROFILE(isolate, SharedFunctionInfoMoveEvent(
1353 source->address(), target->address())); 1353 source->address(), target->address()));
1354 } 1354 }
1355 } 1355 }
1356 #endif 1356 #endif
1357 } 1357 }
1358 1358
1359 return target; 1359 return target;
1360 } 1360 }
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
1515 scavenging_visitors_table_mode_ = LOGGING_AND_PROFILING_DISABLED; 1515 scavenging_visitors_table_mode_ = LOGGING_AND_PROFILING_DISABLED;
1516 } 1516 }
1517 1517
1518 1518
1519 void Heap::SwitchScavengingVisitorsTableIfProfilingWasEnabled() { 1519 void Heap::SwitchScavengingVisitorsTableIfProfilingWasEnabled() {
1520 if (scavenging_visitors_table_mode_ == LOGGING_AND_PROFILING_ENABLED) { 1520 if (scavenging_visitors_table_mode_ == LOGGING_AND_PROFILING_ENABLED) {
1521 // Table was already updated by some isolate. 1521 // Table was already updated by some isolate.
1522 return; 1522 return;
1523 } 1523 }
1524 1524
1525 if (isolate()->logger()->is_logging() || 1525 if (isolate()->logger()->is_logging() |
1526 isolate()->cpu_profiler()->is_profiling() || 1526 CpuProfiler::is_profiling(isolate()) ||
1527 (isolate()->heap_profiler() != NULL && 1527 (isolate()->heap_profiler() != NULL &&
1528 isolate()->heap_profiler()->is_profiling())) { 1528 isolate()->heap_profiler()->is_profiling())) {
1529 // If one of the isolates is doing scavenge at this moment of time 1529 // If one of the isolates is doing scavenge at this moment of time
1530 // it might see this table in an inconsitent state when 1530 // it might see this table in an inconsitent state when
1531 // some of the callbacks point to 1531 // some of the callbacks point to
1532 // ScavengingVisitor<LOGGING_AND_PROFILING_ENABLED> and others 1532 // ScavengingVisitor<LOGGING_AND_PROFILING_ENABLED> and others
1533 // to ScavengingVisitor<LOGGING_AND_PROFILING_DISABLED>. 1533 // to ScavengingVisitor<LOGGING_AND_PROFILING_DISABLED>.
1534 // However this does not lead to any bugs as such isolate does not have 1534 // However this does not lead to any bugs as such isolate does not have
1535 // profiling enabled and any isolate with enabled profiling is guaranteed 1535 // profiling enabled and any isolate with enabled profiling is guaranteed
1536 // to see the table in the consistent state. 1536 // to see the table in the consistent state.
(...skipping 4318 matching lines...) Expand 10 before | Expand all | Expand 10 after
5855 } 5855 }
5856 5856
5857 5857
5858 void ExternalStringTable::TearDown() { 5858 void ExternalStringTable::TearDown() {
5859 new_space_strings_.Free(); 5859 new_space_strings_.Free();
5860 old_space_strings_.Free(); 5860 old_space_strings_.Free();
5861 } 5861 }
5862 5862
5863 5863
5864 } } // namespace v8::internal 5864 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/cpu-profiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698