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

Side by Side Diff: src/isolate.cc

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 1772 matching lines...) Expand 10 before | Expand all | Expand 10 after
1783 random_number_generator_(NULL), 1783 random_number_generator_(NULL),
1784 has_fatal_error_(false), 1784 has_fatal_error_(false),
1785 use_crankshaft_(true), 1785 use_crankshaft_(true),
1786 initialized_from_snapshot_(false), 1786 initialized_from_snapshot_(false),
1787 cpu_profiler_(NULL), 1787 cpu_profiler_(NULL),
1788 heap_profiler_(NULL), 1788 heap_profiler_(NULL),
1789 function_entry_hook_(NULL), 1789 function_entry_hook_(NULL),
1790 deferred_handles_head_(NULL), 1790 deferred_handles_head_(NULL),
1791 optimizing_compiler_thread_(NULL), 1791 optimizing_compiler_thread_(NULL),
1792 sweeper_thread_(NULL), 1792 sweeper_thread_(NULL),
1793 stress_deopt_count_(0) { 1793 stress_deopt_count_(0),
1794 allocation_profiler_(false) {
1794 id_ = NoBarrier_AtomicIncrement(&isolate_counter_, 1); 1795 id_ = NoBarrier_AtomicIncrement(&isolate_counter_, 1);
1795 TRACE_ISOLATE(constructor); 1796 TRACE_ISOLATE(constructor);
1796 1797
1797 memset(isolate_addresses_, 0, 1798 memset(isolate_addresses_, 0,
1798 sizeof(isolate_addresses_[0]) * (kIsolateAddressCount + 1)); 1799 sizeof(isolate_addresses_[0]) * (kIsolateAddressCount + 1));
1799 1800
1800 heap_.isolate_ = this; 1801 heap_.isolate_ = this;
1801 stack_guard_.isolate_ = this; 1802 stack_guard_.isolate_ = this;
1802 1803
1803 // ThreadManager is initialized early to support locking an isolate 1804 // ThreadManager is initialized early to support locking an isolate
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
2141 && CPU::SupportsCrankshaft(); 2142 && CPU::SupportsCrankshaft();
2142 2143
2143 if (function_entry_hook() != NULL) { 2144 if (function_entry_hook() != NULL) {
2144 // When function entry hooking is in effect, we have to create the code 2145 // When function entry hooking is in effect, we have to create the code
2145 // stubs from scratch to get entry hooks, rather than loading the previously 2146 // stubs from scratch to get entry hooks, rather than loading the previously
2146 // generated stubs from disk. 2147 // generated stubs from disk.
2147 // If this assert fires, the initialization path has regressed. 2148 // If this assert fires, the initialization path has regressed.
2148 ASSERT(des == NULL); 2149 ASSERT(des == NULL);
2149 } 2150 }
2150 2151
2152 if (is_allocation_profiler_enabled()) {
2153 ASSERT(des == NULL);
2154 }
2155
2151 // The initialization process does not handle memory exhaustion. 2156 // The initialization process does not handle memory exhaustion.
2152 DisallowAllocationFailure disallow_allocation_failure; 2157 DisallowAllocationFailure disallow_allocation_failure;
2153 2158
2154 InitializeLoggingAndCounters(); 2159 InitializeLoggingAndCounters();
2155 2160
2156 InitializeDebugger(); 2161 InitializeDebugger();
2157 2162
2158 memory_allocator_ = new MemoryAllocator(this); 2163 memory_allocator_ = new MemoryAllocator(this);
2159 code_range_ = new CodeRange(this); 2164 code_range_ = new CodeRange(this);
2160 2165
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
2516 2521
2517 #ifdef DEBUG 2522 #ifdef DEBUG
2518 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ 2523 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \
2519 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); 2524 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_);
2520 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) 2525 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET)
2521 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) 2526 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET)
2522 #undef ISOLATE_FIELD_OFFSET 2527 #undef ISOLATE_FIELD_OFFSET
2523 #endif 2528 #endif
2524 2529
2525 } } // namespace v8::internal 2530 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698