OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/object_store.h" | 5 #include "vm/object_store.h" |
6 | 6 |
7 #include "vm/exceptions.h" | 7 #include "vm/exceptions.h" |
8 #include "vm/isolate.h" | 8 #include "vm/isolate.h" |
9 #include "vm/object.h" | 9 #include "vm/object.h" |
10 #include "vm/raw_object.h" | 10 #include "vm/raw_object.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 Isolate* isolate = Isolate::Current(); | 103 Isolate* isolate = Isolate::Current(); |
104 ASSERT(isolate != NULL && isolate->object_store() == this); | 104 ASSERT(isolate != NULL && isolate->object_store() == this); |
105 if (this->stack_overflow() != Instance::null() && | 105 if (this->stack_overflow() != Instance::null() && |
106 this->out_of_memory() != Instance::null()) { | 106 this->out_of_memory() != Instance::null()) { |
107 return true; | 107 return true; |
108 } | 108 } |
109 ASSERT(this->stack_overflow() == Instance::null()); | 109 ASSERT(this->stack_overflow() == Instance::null()); |
110 ASSERT(this->out_of_memory() == Instance::null()); | 110 ASSERT(this->out_of_memory() == Instance::null()); |
111 GrowableArray<const Object*> args; | 111 GrowableArray<const Object*> args; |
112 Object& result = Object::Handle(); | 112 Object& result = Object::Handle(); |
113 Instance& exception = Instance::Handle(); | |
114 | 113 |
115 result = Exceptions::Create(Exceptions::kStackOverflow, args); | 114 result = Exceptions::Create(Exceptions::kStackOverflow, args); |
116 if (result.IsError()) { | 115 if (result.IsError()) { |
117 return false; | 116 return false; |
118 } | 117 } |
119 exception ^= result.raw(); | 118 set_stack_overflow(Instance::Cast(result)); |
120 set_stack_overflow(exception); | |
121 | 119 |
122 result = Exceptions::Create(Exceptions::kOutOfMemory, args); | 120 result = Exceptions::Create(Exceptions::kOutOfMemory, args); |
123 if (result.IsError()) { | 121 if (result.IsError()) { |
124 return false; | 122 return false; |
125 } | 123 } |
126 exception ^= result.raw(); | 124 set_out_of_memory(Instance::Cast(result)); |
127 set_out_of_memory(exception); | |
128 return true; | 125 return true; |
129 } | 126 } |
130 | 127 |
131 | 128 |
132 void ObjectStore::InitKeywordTable() { | 129 void ObjectStore::InitKeywordTable() { |
133 // Set up the keywords symbol array so that we can access it while scanning. | 130 // Set up the keywords symbol array so that we can access it while scanning. |
134 Array& keywords = Array::Handle(keyword_symbols()); | 131 Array& keywords = Array::Handle(keyword_symbols()); |
135 ASSERT(keywords.IsNull()); | 132 ASSERT(keywords.IsNull()); |
136 keywords = Array::New(Token::numKeywords, Heap::kOld); | 133 keywords = Array::New(Token::numKeywords, Heap::kOld); |
137 ASSERT(!keywords.IsError() && !keywords.IsNull()); | 134 ASSERT(!keywords.IsError() && !keywords.IsNull()); |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 return kStringInterface; | 308 return kStringInterface; |
312 } else if (raw_type == list_interface()) { | 309 } else if (raw_type == list_interface()) { |
313 return kListInterface; | 310 return kListInterface; |
314 } else if (raw_type == byte_array_interface()) { | 311 } else if (raw_type == byte_array_interface()) { |
315 return kByteArrayInterface; | 312 return kByteArrayInterface; |
316 } | 313 } |
317 return kInvalidIndex; | 314 return kInvalidIndex; |
318 } | 315 } |
319 | 316 |
320 } // namespace dart | 317 } // namespace dart |
OLD | NEW |