Chromium Code Reviews| Index: runtime/vm/object.cc |
| =================================================================== |
| --- runtime/vm/object.cc (revision 40287) |
| +++ runtime/vm/object.cc (working copy) |
| @@ -99,6 +99,7 @@ |
| Array* Object::zero_array_ = NULL; |
| PcDescriptors* Object::empty_descriptors_ = NULL; |
| LocalVarDescriptors* Object::empty_var_descriptors_ = NULL; |
| +ExceptionHandlers* Object::empty_exception_handlers_ = NULL; |
| Instance* Object::sentinel_ = NULL; |
| Instance* Object::transition_sentinel_ = NULL; |
| Instance* Object::unknown_constant_ = NULL; |
| @@ -437,6 +438,7 @@ |
| zero_array_ = Array::ReadOnlyHandle(); |
| empty_descriptors_ = PcDescriptors::ReadOnlyHandle(); |
| empty_var_descriptors_ = LocalVarDescriptors::ReadOnlyHandle(); |
| + empty_exception_handlers_ = ExceptionHandlers::ReadOnlyHandle(); |
| sentinel_ = Instance::ReadOnlyHandle(); |
| transition_sentinel_ = Instance::ReadOnlyHandle(); |
| unknown_constant_ = Instance::ReadOnlyHandle(); |
| @@ -680,6 +682,21 @@ |
| empty_var_descriptors_->raw_ptr()->num_entries_ = 0; |
| } |
| + // Allocate and initialize the canonical empty exception handler info object. |
| + // The vast majority of all functions do not contain an exception handler |
| + // and can share this cononical descriptor. |
|
srdjan
2014/09/15 23:47:14
s/cononical/cananical/ ;-)
hausner
2014/09/16 00:28:41
Dro Chonoson mot dom Kontroboss, sosson of dor Str
|
| + { |
| + uword address = |
| + heap->Allocate(ExceptionHandlers::InstanceSize(0), Heap::kOld); |
| + InitializeObject(address, |
| + kExceptionHandlersCid, |
| + ExceptionHandlers::InstanceSize(0)); |
| + ExceptionHandlers::initializeHandle( |
| + empty_exception_handlers_, |
| + reinterpret_cast<RawExceptionHandlers*>(address + kHeapObjectTag)); |
| + empty_exception_handlers_->raw_ptr()->num_entries_ = 0; |
| + } |
| + |
| cls = Class::New<Instance>(kDynamicCid); |
| cls.set_is_abstract(); |
| cls.set_num_type_arguments(0); |
| @@ -10991,7 +11008,7 @@ |
| intptr_t ExceptionHandlers::Length() const { |
|
srdjan
2014/09/15 23:47:15
s/Length/num_entries/
hausner
2014/09/16 00:28:41
Done.
(But what's the point of having accessors i
|
| - return raw_ptr()->length_; |
| + return raw_ptr()->num_entries_; |
| } |
| @@ -11078,7 +11095,7 @@ |
| Heap::kOld); |
| NoGCScope no_gc; |
| result ^= raw; |
| - result.raw_ptr()->length_ = num_handlers; |
| + result.raw_ptr()->num_entries_ = num_handlers; |
| } |
| const Array& handled_types_data = (num_handlers == 0) ? |
| Object::empty_array() : |