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

Side by Side Diff: runtime/vm/object.cc

Issue 1753053003: When a catch is unreachable, use the canonical empty array instead of null as its type array. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/code_descriptors.cc ('k') | runtime/vm/precompiler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 11648 matching lines...) Expand 10 before | Expand all | Expand 10 after
11659 11659
11660 bool ExceptionHandlers::HasCatchAll(intptr_t try_index) const { 11660 bool ExceptionHandlers::HasCatchAll(intptr_t try_index) const {
11661 ASSERT((try_index >= 0) && (try_index < num_entries())); 11661 ASSERT((try_index >= 0) && (try_index < num_entries()));
11662 return raw_ptr()->data()[try_index].has_catch_all; 11662 return raw_ptr()->data()[try_index].has_catch_all;
11663 } 11663 }
11664 11664
11665 11665
11666 void ExceptionHandlers::SetHandledTypes(intptr_t try_index, 11666 void ExceptionHandlers::SetHandledTypes(intptr_t try_index,
11667 const Array& handled_types) const { 11667 const Array& handled_types) const {
11668 ASSERT((try_index >= 0) && (try_index < num_entries())); 11668 ASSERT((try_index >= 0) && (try_index < num_entries()));
11669 ASSERT(!handled_types.IsNull());
11669 const Array& handled_types_data = 11670 const Array& handled_types_data =
11670 Array::Handle(raw_ptr()->handled_types_data_); 11671 Array::Handle(raw_ptr()->handled_types_data_);
11671 handled_types_data.SetAt(try_index, handled_types); 11672 handled_types_data.SetAt(try_index, handled_types);
11672 } 11673 }
11673 11674
11674 11675
11675 RawArray* ExceptionHandlers::GetHandledTypes(intptr_t try_index) const { 11676 RawArray* ExceptionHandlers::GetHandledTypes(intptr_t try_index) const {
11676 ASSERT((try_index >= 0) && (try_index < num_entries())); 11677 ASSERT((try_index >= 0) && (try_index < num_entries()));
11677 Array& array = Array::Handle(raw_ptr()->handled_types_data_); 11678 Array& array = Array::Handle(raw_ptr()->handled_types_data_);
11678 array ^= array.At(try_index); 11679 array ^= array.At(try_index);
(...skipping 10021 matching lines...) Expand 10 before | Expand all | Expand 10 after
21700 return UserTag::null(); 21701 return UserTag::null();
21701 } 21702 }
21702 21703
21703 21704
21704 const char* UserTag::ToCString() const { 21705 const char* UserTag::ToCString() const {
21705 const String& tag_label = String::Handle(label()); 21706 const String& tag_label = String::Handle(label());
21706 return tag_label.ToCString(); 21707 return tag_label.ToCString();
21707 } 21708 }
21708 21709
21709 } // namespace dart 21710 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/code_descriptors.cc ('k') | runtime/vm/precompiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698