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

Unified Diff: runtime/vm/object_store.cc

Issue 8823001: Use preallocated StackOverflowException (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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') | no next file » | 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 2103)
+++ runtime/vm/object_store.cc (working copy)
@@ -4,6 +4,7 @@
#include "vm/object_store.h"
+#include "vm/exceptions.h"
#include "vm/isolate.h"
#include "vm/object.h"
#include "vm/raw_object.h"
@@ -48,7 +49,9 @@
registered_libraries_(Library::null()),
pending_classes_(Array::null()),
sticky_error_(String::null()),
- empty_context_(Context::null()) {
+ empty_context_(Context::null()),
+ stack_overflow_(Instance::null()),
+ preallocate_objects_called_(false) {
}
@@ -69,6 +72,19 @@
}
+void ObjectStore::PreallocateObjects() {
+ if (preallocate_objects_called_) {
+ return;
+ }
+ preallocate_objects_called_ = true;
+
+ GrowableArray<const Object*> args;
+ const Instance& exception =
+ Instance::Handle(Exceptions::Create(Exceptions::kStackOverflow, args));
siva 2011/12/06 20:44:05 Since this runs dart code there is a possibility t
turnidge 2011/12/06 22:51:09 Added LongJump around the call. The error is prop
+ set_stack_overflow(exception);
+}
+
+
RawClass* ObjectStore::GetClass(int index) {
switch (index) {
case kObjectClass: return object_class_;
« no previous file with comments | « runtime/vm/object_store.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698