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

Unified Diff: runtime/vm/object_store.cc

Issue 12320103: Fix for bug 6767 - Limit stack trace collection for stack overflow exceptions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/object_store.h ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object_store.cc
===================================================================
--- runtime/vm/object_store.cc (revision 19067)
+++ runtime/vm/object_store.cc (working copy)
@@ -87,6 +87,7 @@
empty_context_(Context::null()),
stack_overflow_(Instance::null()),
out_of_memory_(Instance::null()),
+ preallocated_stack_trace_(Stacktrace::null()),
keyword_symbols_(Array::null()),
receive_port_create_function_(Function::null()),
lookup_receive_port_function_(Function::null()),
@@ -114,12 +115,14 @@
bool ObjectStore::PreallocateObjects() {
Isolate* isolate = Isolate::Current();
ASSERT(isolate != NULL && isolate->object_store() == this);
- if (this->stack_overflow() != Instance::null() &&
- this->out_of_memory() != Instance::null()) {
+ if (this->stack_overflow() != Instance::null()) {
+ ASSERT(this->out_of_memory() != Instance::null());
+ ASSERT(this->preallocated_stack_trace() != Stacktrace::null());
return true;
}
ASSERT(this->stack_overflow() == Instance::null());
ASSERT(this->out_of_memory() == Instance::null());
+ ASSERT(this->preallocated_stack_trace() == Stacktrace::null());
// TODO(regis): Reenable this code for arm and mips when possible.
#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
Object& result = Object::Handle();
@@ -136,6 +139,17 @@
return false;
}
set_out_of_memory(Instance::Cast(result));
+ const Array& func_array = Array::Handle(
+ isolate,
+ Array::New(Stacktrace::kPreallocatedStackdepth, Heap::kOld));
+ const Array& code_array = Array::Handle(
+ isolate,
+ Array::New(Stacktrace::kPreallocatedStackdepth, Heap::kOld));
+ const Array& pc_offset_array = Array::Handle(
+ isolate,
+ Array::New(Stacktrace::kPreallocatedStackdepth, Heap::kOld));
+ result = Stacktrace::New(func_array, code_array, pc_offset_array);
+ set_preallocated_stack_trace(Stacktrace::Cast(result));
#endif
return true;
}
« no previous file with comments | « runtime/vm/object_store.h ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698