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

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

Issue 2402133002: Field should not be initialized until after initializer returns (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | no next file » | 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/become.h" 10 #include "vm/become.h"
(...skipping 7858 matching lines...) Expand 10 before | Expand all | Expand 10 after
7869 if (value.IsError()) { 7869 if (value.IsError()) {
7870 SetStaticValue(Object::null_instance()); 7870 SetStaticValue(Object::null_instance());
7871 Exceptions::PropagateError(Error::Cast(value)); 7871 Exceptions::PropagateError(Error::Cast(value));
7872 UNREACHABLE(); 7872 UNREACHABLE();
7873 } 7873 }
7874 ASSERT(value.IsNull() || value.IsInstance()); 7874 ASSERT(value.IsNull() || value.IsInstance());
7875 SetStaticValue(value.IsNull() ? Instance::null_instance() 7875 SetStaticValue(value.IsNull() ? Instance::null_instance()
7876 : Instance::Cast(value)); 7876 : Instance::Cast(value));
7877 return; 7877 return;
7878 } else if (StaticValue() == Object::transition_sentinel().raw()) { 7878 } else if (StaticValue() == Object::transition_sentinel().raw()) {
7879 SetStaticValue(Object::null_instance());
7880 const Array& ctor_args = Array::Handle(Array::New(1)); 7879 const Array& ctor_args = Array::Handle(Array::New(1));
7881 const String& field_name = String::Handle(name()); 7880 const String& field_name = String::Handle(name());
7882 ctor_args.SetAt(0, field_name); 7881 ctor_args.SetAt(0, field_name);
7883 Exceptions::ThrowByType(Exceptions::kCyclicInitializationError, ctor_args); 7882 Exceptions::ThrowByType(Exceptions::kCyclicInitializationError, ctor_args);
7884 UNREACHABLE(); 7883 UNREACHABLE();
7885 return; 7884 return;
7886 } 7885 }
7887 UNREACHABLE(); 7886 UNREACHABLE();
7888 } 7887 }
7889 7888
(...skipping 15127 matching lines...) Expand 10 before | Expand all | Expand 10 after
23017 return UserTag::null(); 23016 return UserTag::null();
23018 } 23017 }
23019 23018
23020 23019
23021 const char* UserTag::ToCString() const { 23020 const char* UserTag::ToCString() const {
23022 const String& tag_label = String::Handle(label()); 23021 const String& tag_label = String::Handle(label());
23023 return tag_label.ToCString(); 23022 return tag_label.ToCString();
23024 } 23023 }
23025 23024
23026 } // namespace dart 23025 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698