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

Side by Side Diff: src/isolate.h

Issue 59373003: AllocationProfiler: introduce allocation_profiler flag in V8 api. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month 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
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1125 int id() const { return static_cast<int>(id_); } 1125 int id() const { return static_cast<int>(id_); }
1126 1126
1127 HStatistics* GetHStatistics(); 1127 HStatistics* GetHStatistics();
1128 HTracer* GetHTracer(); 1128 HTracer* GetHTracer();
1129 1129
1130 FunctionEntryHook function_entry_hook() { return function_entry_hook_; } 1130 FunctionEntryHook function_entry_hook() { return function_entry_hook_; }
1131 void set_function_entry_hook(FunctionEntryHook function_entry_hook) { 1131 void set_function_entry_hook(FunctionEntryHook function_entry_hook) {
1132 function_entry_hook_ = function_entry_hook; 1132 function_entry_hook_ = function_entry_hook;
1133 } 1133 }
1134 1134
1135 bool enable_allocation_profiler() {
1136 ASSERT(!IsInitialized() || !initialized_from_snapshot());
1137 // Fallback for release version.
1138 if (IsInitialized() && initialized_from_snapshot())
1139 return false;
1140 allocation_profiler_ = true;
1141 return true;
1142 }
1143
1144 bool is_allocation_profiler_enabled() const {
1145 return allocation_profiler_ || FLAG_enable_allocation_profiler;
1146 }
1147
1135 void* stress_deopt_count_address() { return &stress_deopt_count_; } 1148 void* stress_deopt_count_address() { return &stress_deopt_count_; }
1136 1149
1137 inline RandomNumberGenerator* random_number_generator(); 1150 inline RandomNumberGenerator* random_number_generator();
1138 1151
1139 // Given an address occupied by a live code object, return that object. 1152 // Given an address occupied by a live code object, return that object.
1140 Object* FindCodeObject(Address a); 1153 Object* FindCodeObject(Address a);
1141 1154
1142 private: 1155 private:
1143 Isolate(); 1156 Isolate();
1144 1157
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
1366 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) 1379 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET)
1367 #undef ISOLATE_FIELD_OFFSET 1380 #undef ISOLATE_FIELD_OFFSET
1368 #endif 1381 #endif
1369 1382
1370 DeferredHandles* deferred_handles_head_; 1383 DeferredHandles* deferred_handles_head_;
1371 OptimizingCompilerThread* optimizing_compiler_thread_; 1384 OptimizingCompilerThread* optimizing_compiler_thread_;
1372 SweeperThread** sweeper_thread_; 1385 SweeperThread** sweeper_thread_;
1373 1386
1374 // Counts deopt points if deopt_every_n_times is enabled. 1387 // Counts deopt points if deopt_every_n_times is enabled.
1375 unsigned int stress_deopt_count_; 1388 unsigned int stress_deopt_count_;
1389 bool allocation_profiler_;
1376 1390
1377 friend class ExecutionAccess; 1391 friend class ExecutionAccess;
1378 friend class HandleScopeImplementer; 1392 friend class HandleScopeImplementer;
1379 friend class IsolateInitializer; 1393 friend class IsolateInitializer;
1380 friend class OptimizingCompilerThread; 1394 friend class OptimizingCompilerThread;
1381 friend class SweeperThread; 1395 friend class SweeperThread;
1382 friend class ThreadManager; 1396 friend class ThreadManager;
1383 friend class Simulator; 1397 friend class Simulator;
1384 friend class StackGuard; 1398 friend class StackGuard;
1385 friend class ThreadId; 1399 friend class ThreadId;
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
1504 1518
1505 // Mark the native context with out of memory. 1519 // Mark the native context with out of memory.
1506 inline void Context::mark_out_of_memory() { 1520 inline void Context::mark_out_of_memory() {
1507 native_context()->set_out_of_memory(GetIsolate()->heap()->true_value()); 1521 native_context()->set_out_of_memory(GetIsolate()->heap()->true_value());
1508 } 1522 }
1509 1523
1510 1524
1511 } } // namespace v8::internal 1525 } } // namespace v8::internal
1512 1526
1513 #endif // V8_ISOLATE_H_ 1527 #endif // V8_ISOLATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698