OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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" |
11 #include "vm/visitor.h" | 11 #include "vm/visitor.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 108 |
109 bool ObjectStore::PreallocateObjects() { | 109 bool ObjectStore::PreallocateObjects() { |
110 Isolate* isolate = Isolate::Current(); | 110 Isolate* isolate = Isolate::Current(); |
111 ASSERT(isolate != NULL && isolate->object_store() == this); | 111 ASSERT(isolate != NULL && isolate->object_store() == this); |
112 if (this->stack_overflow() != Instance::null() && | 112 if (this->stack_overflow() != Instance::null() && |
113 this->out_of_memory() != Instance::null()) { | 113 this->out_of_memory() != Instance::null()) { |
114 return true; | 114 return true; |
115 } | 115 } |
116 ASSERT(this->stack_overflow() == Instance::null()); | 116 ASSERT(this->stack_overflow() == Instance::null()); |
117 ASSERT(this->out_of_memory() == Instance::null()); | 117 ASSERT(this->out_of_memory() == Instance::null()); |
| 118 // TODO(regis): Reenable this code for arm and mips when possible. |
| 119 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) |
118 Object& result = Object::Handle(); | 120 Object& result = Object::Handle(); |
119 | 121 |
120 result = Exceptions::Create(Exceptions::kStackOverflow, | 122 result = Exceptions::Create(Exceptions::kStackOverflow, |
121 Object::empty_array()); | 123 Object::empty_array()); |
122 if (result.IsError()) { | 124 if (result.IsError()) { |
123 return false; | 125 return false; |
124 } | 126 } |
125 set_stack_overflow(Instance::Cast(result)); | 127 set_stack_overflow(Instance::Cast(result)); |
126 | 128 |
127 result = Exceptions::Create(Exceptions::kOutOfMemory, Object::empty_array()); | 129 result = Exceptions::Create(Exceptions::kOutOfMemory, Object::empty_array()); |
128 if (result.IsError()) { | 130 if (result.IsError()) { |
129 return false; | 131 return false; |
130 } | 132 } |
131 set_out_of_memory(Instance::Cast(result)); | 133 set_out_of_memory(Instance::Cast(result)); |
| 134 #endif |
132 return true; | 135 return true; |
133 } | 136 } |
134 | 137 |
135 | 138 |
136 void ObjectStore::InitKeywordTable() { | 139 void ObjectStore::InitKeywordTable() { |
137 // Set up the keywords symbol array so that we can access it while scanning. | 140 // Set up the keywords symbol array so that we can access it while scanning. |
138 Array& keywords = Array::Handle(keyword_symbols()); | 141 Array& keywords = Array::Handle(keyword_symbols()); |
139 ASSERT(keywords.IsNull()); | 142 ASSERT(keywords.IsNull()); |
140 keywords = Array::New(Token::numKeywords, Heap::kOld); | 143 keywords = Array::New(Token::numKeywords, Heap::kOld); |
141 ASSERT(!keywords.IsError() && !keywords.IsNull()); | 144 ASSERT(!keywords.IsError() && !keywords.IsNull()); |
142 set_keyword_symbols(keywords); | 145 set_keyword_symbols(keywords); |
143 } | 146 } |
144 | 147 |
145 } // namespace dart | 148 } // namespace dart |
OLD | NEW |