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

Side by Side Diff: src/top.cc

Issue 7575013: Merge r8833 "Minimize malloc heap allocation on process startup" to 3.2. (Closed) Base URL: http://v8.googlecode.com/svn/branches/3.2/
Patch Set: '' Created 9 years, 4 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/spaces.cc ('k') | src/version.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 29 matching lines...) Expand all
40 40
41 41
42 // TODO(isolates): move to isolate.cc. This stuff is kept here to 42 // TODO(isolates): move to isolate.cc. This stuff is kept here to
43 // simplify merging. 43 // simplify merging.
44 44
45 namespace v8 { 45 namespace v8 {
46 namespace internal { 46 namespace internal {
47 47
48 ThreadLocalTop::ThreadLocalTop() { 48 ThreadLocalTop::ThreadLocalTop() {
49 InitializeInternal(); 49 InitializeInternal();
50 // This flag may be set using v8::V8::IgnoreOutOfMemoryException()
51 // before an isolate is initialized. The initialize methods below do
52 // not touch it to preserve its value.
53 ignore_out_of_memory_ = false;
50 } 54 }
51 55
52 56
53 void ThreadLocalTop::InitializeInternal() { 57 void ThreadLocalTop::InitializeInternal() {
54 c_entry_fp_ = 0; 58 c_entry_fp_ = 0;
55 handler_ = 0; 59 handler_ = 0;
56 #ifdef USE_SIMULATOR 60 #ifdef USE_SIMULATOR
57 simulator_ = NULL; 61 simulator_ = NULL;
58 #endif 62 #endif
59 #ifdef ENABLE_LOGGING_AND_PROFILING 63 #ifdef ENABLE_LOGGING_AND_PROFILING
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 allocator = new HeapStringAllocator(); 324 allocator = new HeapStringAllocator();
321 } else { 325 } else {
322 allocator = preallocated_message_space_; 326 allocator = preallocated_message_space_;
323 } 327 }
324 328
325 StringStream::ClearMentionedObjectCache(); 329 StringStream::ClearMentionedObjectCache();
326 StringStream accumulator(allocator); 330 StringStream accumulator(allocator);
327 incomplete_message_ = &accumulator; 331 incomplete_message_ = &accumulator;
328 PrintStack(&accumulator); 332 PrintStack(&accumulator);
329 accumulator.OutputToStdOut(); 333 accumulator.OutputToStdOut();
334 InitializeLoggingAndCounters();
330 accumulator.Log(); 335 accumulator.Log();
331 incomplete_message_ = NULL; 336 incomplete_message_ = NULL;
332 stack_trace_nesting_level_ = 0; 337 stack_trace_nesting_level_ = 0;
333 if (preallocated_message_space_ == NULL) { 338 if (preallocated_message_space_ == NULL) {
334 // Remove the HeapStringAllocator created above. 339 // Remove the HeapStringAllocator created above.
335 delete allocator; 340 delete allocator;
336 } 341 }
337 } else if (stack_trace_nesting_level_ == 1) { 342 } else if (stack_trace_nesting_level_ == 1) {
338 stack_trace_nesting_level_++; 343 stack_trace_nesting_level_++;
339 OS::PrintError( 344 OS::PrintError(
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 thread_local_top()->simulator_ = Simulator::current(this); 974 thread_local_top()->simulator_ = Simulator::current(this);
970 #endif 975 #endif
971 #endif 976 #endif
972 if (RuntimeProfiler::IsEnabled() && current_vm_state() == JS) { 977 if (RuntimeProfiler::IsEnabled() && current_vm_state() == JS) {
973 RuntimeProfiler::IsolateEnteredJS(this); 978 RuntimeProfiler::IsolateEnteredJS(this);
974 } 979 }
975 return from + sizeof(ThreadLocalTop); 980 return from + sizeof(ThreadLocalTop);
976 } 981 }
977 982
978 } } // namespace v8::internal 983 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/spaces.cc ('k') | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698