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

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

Issue 295863002: Write barrier audit, part 1 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/object.h ('k') | 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/cpu.h" 10 #include "vm/cpu.h"
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 cls = Class::NewStringClass(kTwoByteStringCid); 670 cls = Class::NewStringClass(kTwoByteStringCid);
671 isolate->object_store()->set_two_byte_string_class(cls); 671 isolate->object_store()->set_two_byte_string_class(cls);
672 672
673 // Allocate and initialize the empty_array instance. 673 // Allocate and initialize the empty_array instance.
674 { 674 {
675 uword address = heap->Allocate(Array::InstanceSize(0), Heap::kOld); 675 uword address = heap->Allocate(Array::InstanceSize(0), Heap::kOld);
676 InitializeObject(address, kArrayCid, Array::InstanceSize(0)); 676 InitializeObject(address, kArrayCid, Array::InstanceSize(0));
677 Array::initializeHandle( 677 Array::initializeHandle(
678 empty_array_, 678 empty_array_,
679 reinterpret_cast<RawArray*>(address + kHeapObjectTag)); 679 reinterpret_cast<RawArray*>(address + kHeapObjectTag));
680 empty_array_->raw_ptr()->length_ = Smi::New(0); 680 empty_array_->StoreSmi(&empty_array_->raw_ptr()->length_, Smi::New(0));
681 } 681 }
682 682
683 // Allocate and initialize the zero_array instance. 683 // Allocate and initialize the zero_array instance.
684 { 684 {
685 uword address = heap->Allocate(Array::InstanceSize(1), Heap::kOld); 685 uword address = heap->Allocate(Array::InstanceSize(1), Heap::kOld);
686 InitializeObject(address, kArrayCid, Array::InstanceSize(1)); 686 InitializeObject(address, kArrayCid, Array::InstanceSize(1));
687 Array::initializeHandle( 687 Array::initializeHandle(
688 zero_array_, 688 zero_array_,
689 reinterpret_cast<RawArray*>(address + kHeapObjectTag)); 689 reinterpret_cast<RawArray*>(address + kHeapObjectTag));
690 zero_array_->raw_ptr()->length_ = Smi::New(1); 690 zero_array_->StoreSmi(&zero_array_->raw_ptr()->length_, Smi::New(1));
691 zero_array_->raw_ptr()->data()[0] = Smi::New(0); 691 zero_array_->StorePointer(&zero_array_->raw_ptr()->data()[0],
692 static_cast<RawObject*>(Smi::New(0)));
692 } 693 }
693 694
694 // Allocate and initialize the empty_descriptors instance. 695 // Allocate and initialize the empty_descriptors instance.
695 { 696 {
696 uword address = heap->Allocate( 697 uword address = heap->Allocate(
697 PcDescriptors::InstanceSize(0, RawPcDescriptors::kCompressedRecSize), 698 PcDescriptors::InstanceSize(0, RawPcDescriptors::kCompressedRecSize),
698 Heap::kOld); 699 Heap::kOld);
699 InitializeObject(address, kPcDescriptorsCid, 700 InitializeObject(address, kPcDescriptorsCid,
700 PcDescriptors::InstanceSize(0, RawPcDescriptors::kCompressedRecSize)); 701 PcDescriptors::InstanceSize(0, RawPcDescriptors::kCompressedRecSize));
701 PcDescriptors::initializeHandle( 702 PcDescriptors::initializeHandle(
702 empty_descriptors_, 703 empty_descriptors_,
703 reinterpret_cast<RawPcDescriptors*>(address + kHeapObjectTag)); 704 reinterpret_cast<RawPcDescriptors*>(address + kHeapObjectTag));
704 empty_descriptors_->raw_ptr()->length_ = 0; 705 empty_descriptors_->StoreNonPointer(&empty_descriptors_->raw_ptr()->length_,
706 0);
705 } 707 }
706 708
707 // Allocate and initialize the canonical empty variable descriptor object. 709 // Allocate and initialize the canonical empty variable descriptor object.
708 { 710 {
709 uword address = 711 uword address =
710 heap->Allocate(LocalVarDescriptors::InstanceSize(0), Heap::kOld); 712 heap->Allocate(LocalVarDescriptors::InstanceSize(0), Heap::kOld);
711 InitializeObject(address, 713 InitializeObject(address,
712 kLocalVarDescriptorsCid, 714 kLocalVarDescriptorsCid,
713 LocalVarDescriptors::InstanceSize(0)); 715 LocalVarDescriptors::InstanceSize(0));
714 LocalVarDescriptors::initializeHandle( 716 LocalVarDescriptors::initializeHandle(
(...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after
1887 "super classes", 1889 "super classes",
1888 String::Handle(cls.Name()).ToCString()); 1890 String::Handle(cls.Name()).ToCString());
1889 UNREACHABLE(); 1891 UNREACHABLE();
1890 } 1892 }
1891 1893
1892 1894
1893 void Class::set_num_type_arguments(intptr_t value) const { 1895 void Class::set_num_type_arguments(intptr_t value) const {
1894 if (!Utils::IsInt(16, value)) { 1896 if (!Utils::IsInt(16, value)) {
1895 ReportTooManyTypeArguments(*this); 1897 ReportTooManyTypeArguments(*this);
1896 } 1898 }
1897 raw_ptr()->num_type_arguments_ = value; 1899 StoreNonPointer(&raw_ptr()->num_type_arguments_, value);
1898 } 1900 }
1899 1901
1900 1902
1901 void Class::set_num_own_type_arguments(intptr_t value) const { 1903 void Class::set_num_own_type_arguments(intptr_t value) const {
1902 if (!Utils::IsInt(16, value)) { 1904 if (!Utils::IsInt(16, value)) {
1903 ReportTooManyTypeArguments(*this); 1905 ReportTooManyTypeArguments(*this);
1904 } 1906 }
1905 raw_ptr()->num_own_type_arguments_ = value; 1907 StoreNonPointer(&raw_ptr()->num_own_type_arguments_, value);
1906 } 1908 }
1907 1909
1908 1910
1909 // Initialize class fields of type Array with empty array. 1911 // Initialize class fields of type Array with empty array.
1910 void Class::InitEmptyFields() { 1912 void Class::InitEmptyFields() {
1911 if (Object::empty_array().raw() == Array::null()) { 1913 if (Object::empty_array().raw() == Array::null()) {
1912 // The empty array has not been initialized yet. 1914 // The empty array has not been initialized yet.
1913 return; 1915 return;
1914 } 1916 }
1915 StorePointer(&raw_ptr()->interfaces_, Object::empty_array().raw()); 1917 StorePointer(&raw_ptr()->interfaces_, Object::empty_array().raw());
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
2238 } 2240 }
2239 2241
2240 2242
2241 void Class::set_signature_function(const Function& value) const { 2243 void Class::set_signature_function(const Function& value) const {
2242 ASSERT(value.IsClosureFunction() || value.IsSignatureFunction()); 2244 ASSERT(value.IsClosureFunction() || value.IsSignatureFunction());
2243 StorePointer(&raw_ptr()->signature_function_, value.raw()); 2245 StorePointer(&raw_ptr()->signature_function_, value.raw());
2244 } 2246 }
2245 2247
2246 2248
2247 void Class::set_state_bits(intptr_t bits) const { 2249 void Class::set_state_bits(intptr_t bits) const {
2248 raw_ptr()->state_bits_ = static_cast<uint16_t>(bits); 2250 StoreNonPointer(&raw_ptr()->state_bits_, static_cast<uint16_t>(bits));
2249 } 2251 }
2250 2252
2251 2253
2252 void Class::set_library(const Library& value) const { 2254 void Class::set_library(const Library& value) const {
2253 StorePointer(&raw_ptr()->library_, value.raw()); 2255 StorePointer(&raw_ptr()->library_, value.raw());
2254 } 2256 }
2255 2257
2256 2258
2257 void Class::set_type_parameters(const TypeArguments& value) const { 2259 void Class::set_type_parameters(const TypeArguments& value) const {
2258 StorePointer(&raw_ptr()->type_parameters_, value.raw()); 2260 StorePointer(&raw_ptr()->type_parameters_, value.raw());
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after
3271 } 3273 }
3272 3274
3273 3275
3274 void Class::set_script(const Script& value) const { 3276 void Class::set_script(const Script& value) const {
3275 StorePointer(&raw_ptr()->script_, value.raw()); 3277 StorePointer(&raw_ptr()->script_, value.raw());
3276 } 3278 }
3277 3279
3278 3280
3279 void Class::set_token_pos(intptr_t token_pos) const { 3281 void Class::set_token_pos(intptr_t token_pos) const {
3280 ASSERT(token_pos >= 0); 3282 ASSERT(token_pos >= 0);
3281 raw_ptr()->token_pos_ = token_pos; 3283 StoreNonPointer(&raw_ptr()->token_pos_, token_pos);
3282 } 3284 }
3283 3285
3284 3286
3285 intptr_t Class::ComputeEndTokenPos() const { 3287 intptr_t Class::ComputeEndTokenPos() const {
3286 // Return the begin token for synthetic classes. 3288 // Return the begin token for synthetic classes.
3287 if (IsSignatureClass() || IsMixinApplication() || IsTopLevel()) { 3289 if (IsSignatureClass() || IsMixinApplication() || IsTopLevel()) {
3288 return token_pos(); 3290 return token_pos();
3289 } 3291 }
3290 const Script& scr = Script::Handle(script()); 3292 const Script& scr = Script::Handle(script());
3291 ASSERT(!scr.IsNull()); 3293 ASSERT(!scr.IsNull());
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after
4183 ASSERT(Object::unresolved_class_class() != Class::null()); 4185 ASSERT(Object::unresolved_class_class() != Class::null());
4184 RawObject* raw = Object::Allocate(UnresolvedClass::kClassId, 4186 RawObject* raw = Object::Allocate(UnresolvedClass::kClassId,
4185 UnresolvedClass::InstanceSize(), 4187 UnresolvedClass::InstanceSize(),
4186 Heap::kOld); 4188 Heap::kOld);
4187 return reinterpret_cast<RawUnresolvedClass*>(raw); 4189 return reinterpret_cast<RawUnresolvedClass*>(raw);
4188 } 4190 }
4189 4191
4190 4192
4191 void UnresolvedClass::set_token_pos(intptr_t token_pos) const { 4193 void UnresolvedClass::set_token_pos(intptr_t token_pos) const {
4192 ASSERT(token_pos >= 0); 4194 ASSERT(token_pos >= 0);
4193 raw_ptr()->token_pos_ = token_pos; 4195 StoreNonPointer(&raw_ptr()->token_pos_, token_pos);
4194 } 4196 }
4195 4197
4196 4198
4197 void UnresolvedClass::set_ident(const String& ident) const { 4199 void UnresolvedClass::set_ident(const String& ident) const {
4198 StorePointer(&raw_ptr()->ident_, ident.raw()); 4200 StorePointer(&raw_ptr()->ident_, ident.raw());
4199 } 4201 }
4200 4202
4201 4203
4202 void UnresolvedClass::set_library_prefix( 4204 void UnresolvedClass::set_library_prefix(
4203 const LibraryPrefix& library_prefix) const { 4205 const LibraryPrefix& library_prefix) const {
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
4766 // TODO(iposva): Determine if we should throw an exception here. 4768 // TODO(iposva): Determine if we should throw an exception here.
4767 ASSERT((index >= 0) && (index < Length())); 4769 ASSERT((index >= 0) && (index < Length()));
4768 return &raw_ptr()->types()[index]; 4770 return &raw_ptr()->types()[index];
4769 } 4771 }
4770 4772
4771 4773
4772 void TypeArguments::SetLength(intptr_t value) const { 4774 void TypeArguments::SetLength(intptr_t value) const {
4773 ASSERT(!IsCanonical()); 4775 ASSERT(!IsCanonical());
4774 // This is only safe because we create a new Smi, which does not cause 4776 // This is only safe because we create a new Smi, which does not cause
4775 // heap allocation. 4777 // heap allocation.
4776 raw_ptr()->length_ = Smi::New(value); 4778 StoreSmi(&raw_ptr()->length_, Smi::New(value));
4777 } 4779 }
4778 4780
4779 4781
4780 static void GrowCanonicalTypeArguments(Isolate* isolate, const Array& table) { 4782 static void GrowCanonicalTypeArguments(Isolate* isolate, const Array& table) {
4781 // Last element of the array is the number of used elements. 4783 // Last element of the array is the number of used elements.
4782 const intptr_t table_size = table.Length() - 1; 4784 const intptr_t table_size = table.Length() - 1;
4783 const intptr_t new_table_size = table_size * 2; 4785 const intptr_t new_table_size = table_size * 2;
4784 Array& new_table = Array::Handle(isolate, Array::New(new_table_size + 1)); 4786 Array& new_table = Array::Handle(isolate, Array::New(new_table_size + 1));
4785 // Copy all elements from the original table to the newly allocated 4787 // Copy all elements from the original table to the newly allocated
4786 // array. 4788 // array.
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
5460 5462
5461 void Function::set_is_async_closure(bool value) const { 5463 void Function::set_is_async_closure(bool value) const {
5462 set_kind_tag(AsyncClosureBit::update(value, raw_ptr()->kind_tag_)); 5464 set_kind_tag(AsyncClosureBit::update(value, raw_ptr()->kind_tag_));
5463 // Prohibit inlining as the closure is used for implementing a continuation. 5465 // Prohibit inlining as the closure is used for implementing a continuation.
5464 set_is_inlinable(false); 5466 set_is_inlinable(false);
5465 } 5467 }
5466 5468
5467 5469
5468 void Function::set_token_pos(intptr_t value) const { 5470 void Function::set_token_pos(intptr_t value) const {
5469 ASSERT(value >= 0); 5471 ASSERT(value >= 0);
5470 raw_ptr()->token_pos_ = value; 5472 StoreNonPointer(&raw_ptr()->token_pos_, value);
5471 } 5473 }
5472 5474
5473 5475
5474 void Function::set_kind_tag(intptr_t value) const { 5476 void Function::set_kind_tag(intptr_t value) const {
5475 raw_ptr()->kind_tag_ = static_cast<uint32_t>(value); 5477 StoreNonPointer(&raw_ptr()->kind_tag_, static_cast<uint32_t>(value));
5476 } 5478 }
5477 5479
5478 5480
5479 void Function::set_num_fixed_parameters(intptr_t value) const { 5481 void Function::set_num_fixed_parameters(intptr_t value) const {
5480 ASSERT(value >= 0); 5482 ASSERT(value >= 0);
5481 ASSERT(Utils::IsInt(16, value)); 5483 ASSERT(Utils::IsInt(16, value));
5482 raw_ptr()->num_fixed_parameters_ = static_cast<int16_t>(value); 5484 StoreNonPointer(&raw_ptr()->num_fixed_parameters_,
5485 static_cast<int16_t>(value));
5483 } 5486 }
5484 5487
5485 5488
5486 void Function::set_num_optional_parameters(intptr_t value) const { 5489 void Function::set_num_optional_parameters(intptr_t value) const {
5487 // A positive value indicates positional params, a negative one named params. 5490 // A positive value indicates positional params, a negative one named params.
5488 ASSERT(Utils::IsInt(16, value)); 5491 ASSERT(Utils::IsInt(16, value));
5489 raw_ptr()->num_optional_parameters_ = static_cast<int16_t>(value); 5492 StoreNonPointer(&raw_ptr()->num_optional_parameters_,
5493 static_cast<int16_t>(value));
5490 } 5494 }
5491 5495
5492 5496
5493 void Function::SetNumOptionalParameters(intptr_t num_optional_parameters, 5497 void Function::SetNumOptionalParameters(intptr_t num_optional_parameters,
5494 bool are_optional_positional) const { 5498 bool are_optional_positional) const {
5495 ASSERT(num_optional_parameters >= 0); 5499 ASSERT(num_optional_parameters >= 0);
5496 set_num_optional_parameters(are_optional_positional ? 5500 set_num_optional_parameters(are_optional_positional ?
5497 num_optional_parameters : 5501 num_optional_parameters :
5498 -num_optional_parameters); 5502 -num_optional_parameters);
5499 } 5503 }
(...skipping 1526 matching lines...) Expand 10 before | Expand all | Expand 10 after
7026 return PrettyName(); 7030 return PrettyName();
7027 } 7031 }
7028 7032
7029 7033
7030 intptr_t Field::guarded_list_length() const { 7034 intptr_t Field::guarded_list_length() const {
7031 return Smi::Value(raw_ptr()->guarded_list_length_); 7035 return Smi::Value(raw_ptr()->guarded_list_length_);
7032 } 7036 }
7033 7037
7034 7038
7035 void Field::set_guarded_list_length(intptr_t list_length) const { 7039 void Field::set_guarded_list_length(intptr_t list_length) const {
7036 raw_ptr()->guarded_list_length_ = Smi::New(list_length); 7040 StoreSmi(&raw_ptr()->guarded_list_length_, Smi::New(list_length));
7037 } 7041 }
7038 7042
7039 7043
7040 intptr_t Field::guarded_list_length_in_object_offset() const { 7044 intptr_t Field::guarded_list_length_in_object_offset() const {
7041 return raw_ptr()->guarded_list_length_in_object_offset_ + kHeapObjectTag; 7045 return raw_ptr()->guarded_list_length_in_object_offset_ + kHeapObjectTag;
7042 } 7046 }
7043 7047
7044 7048
7045 void Field::set_guarded_list_length_in_object_offset( 7049 void Field::set_guarded_list_length_in_object_offset(
7046 intptr_t list_length_offset) const { 7050 intptr_t list_length_offset) const {
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after
8162 StorePointer(&raw_ptr()->url_, value.raw()); 8166 StorePointer(&raw_ptr()->url_, value.raw());
8163 } 8167 }
8164 8168
8165 8169
8166 void Script::set_source(const String& value) const { 8170 void Script::set_source(const String& value) const {
8167 StorePointer(&raw_ptr()->source_, value.raw()); 8171 StorePointer(&raw_ptr()->source_, value.raw());
8168 } 8172 }
8169 8173
8170 8174
8171 void Script::set_kind(RawScript::Kind value) const { 8175 void Script::set_kind(RawScript::Kind value) const {
8172 raw_ptr()->kind_ = value; 8176 StoreNonPointer(&raw_ptr()->kind_, value);
8173 } 8177 }
8174 8178
8175 8179
8176 void Script::set_tokens(const TokenStream& value) const { 8180 void Script::set_tokens(const TokenStream& value) const {
8177 StorePointer(&raw_ptr()->tokens_, value.raw()); 8181 StorePointer(&raw_ptr()->tokens_, value.raw());
8178 } 8182 }
8179 8183
8180 8184
8181 void Script::Tokenize(const String& private_key) const { 8185 void Script::Tokenize(const String& private_key) const {
8182 Isolate* isolate = Isolate::Current(); 8186 Isolate* isolate = Isolate::Current();
(...skipping 13 matching lines...) Expand all
8196 if (FLAG_compiler_stats) { 8200 if (FLAG_compiler_stats) {
8197 CompilerStats::src_length += src.Length(); 8201 CompilerStats::src_length += src.Length();
8198 } 8202 }
8199 } 8203 }
8200 8204
8201 8205
8202 void Script::SetLocationOffset(intptr_t line_offset, 8206 void Script::SetLocationOffset(intptr_t line_offset,
8203 intptr_t col_offset) const { 8207 intptr_t col_offset) const {
8204 ASSERT(line_offset >= 0); 8208 ASSERT(line_offset >= 0);
8205 ASSERT(col_offset >= 0); 8209 ASSERT(col_offset >= 0);
8206 raw_ptr()->line_offset_ = line_offset; 8210 StoreNonPointer(&raw_ptr()->line_offset_, line_offset);
8207 raw_ptr()->col_offset_ = col_offset; 8211 StoreNonPointer(&raw_ptr()->col_offset_, col_offset);
8208 } 8212 }
8209 8213
8210 8214
8211 void Script::GetTokenLocation(intptr_t token_pos, 8215 void Script::GetTokenLocation(intptr_t token_pos,
8212 intptr_t* line, 8216 intptr_t* line,
8213 intptr_t* column) const { 8217 intptr_t* column) const {
8214 ASSERT(line != NULL); 8218 ASSERT(line != NULL);
8215 const TokenStream& tkns = TokenStream::Handle(tokens()); 8219 const TokenStream& tkns = TokenStream::Handle(tokens());
8216 if (column == NULL) { 8220 if (column == NULL) {
8217 TokenStream::Iterator tkit(tkns, 0, TokenStream::Iterator::kAllTokens); 8221 TokenStream::Iterator tkit(tkns, 0, TokenStream::Iterator::kAllTokens);
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
8572 // Only set name once. 8576 // Only set name once.
8573 ASSERT(!Loaded()); 8577 ASSERT(!Loaded());
8574 ASSERT(name.IsSymbol()); 8578 ASSERT(name.IsSymbol());
8575 StorePointer(&raw_ptr()->name_, name.raw()); 8579 StorePointer(&raw_ptr()->name_, name.raw());
8576 } 8580 }
8577 8581
8578 8582
8579 void Library::SetLoadInProgress() const { 8583 void Library::SetLoadInProgress() const {
8580 // Must not already be in the process of being loaded. 8584 // Must not already be in the process of being loaded.
8581 ASSERT(raw_ptr()->load_state_ <= RawLibrary::kLoadRequested); 8585 ASSERT(raw_ptr()->load_state_ <= RawLibrary::kLoadRequested);
8582 raw_ptr()->load_state_ = RawLibrary::kLoadInProgress; 8586 StoreNonPointer(&raw_ptr()->load_state_, RawLibrary::kLoadInProgress);
8583 } 8587 }
8584 8588
8585 8589
8586 void Library::SetLoadRequested() const { 8590 void Library::SetLoadRequested() const {
8587 // Must not be already loaded. 8591 // Must not be already loaded.
8588 ASSERT(raw_ptr()->load_state_ == RawLibrary::kAllocated); 8592 ASSERT(raw_ptr()->load_state_ == RawLibrary::kAllocated);
8589 raw_ptr()->load_state_ = RawLibrary::kLoadRequested; 8593 raw_ptr()->load_state_ = RawLibrary::kLoadRequested;
8590 } 8594 }
8591 8595
8592 8596
8593 void Library::SetLoaded() const { 8597 void Library::SetLoaded() const {
8594 // Should not be already loaded or just allocated. 8598 // Should not be already loaded or just allocated.
8595 ASSERT(LoadInProgress() || LoadRequested()); 8599 ASSERT(LoadInProgress() || LoadRequested());
8596 raw_ptr()->load_state_ = RawLibrary::kLoaded; 8600 StoreNonPointer(&raw_ptr()->load_state_, RawLibrary::kLoaded);
8597 } 8601 }
8598 8602
8599 8603
8600 void Library::SetLoadError(const Instance& error) const { 8604 void Library::SetLoadError(const Instance& error) const {
8601 // Should not be already successfully loaded or just allocated. 8605 // Should not be already successfully loaded or just allocated.
8602 ASSERT(LoadInProgress() || LoadRequested() || LoadFailed()); 8606 ASSERT(LoadInProgress() || LoadRequested() || LoadFailed());
8603 raw_ptr()->load_state_ = RawLibrary::kLoadError; 8607 StoreNonPointer(&raw_ptr()->load_state_, RawLibrary::kLoadError);
8604 StorePointer(&raw_ptr()->load_error_, error.raw()); 8608 StorePointer(&raw_ptr()->load_error_, error.raw());
8605 } 8609 }
8606 8610
8607 8611
8608 // Traits for looking up Libraries by url in a hash set. 8612 // Traits for looking up Libraries by url in a hash set.
8609 class LibraryUrlTraits { 8613 class LibraryUrlTraits {
8610 public: 8614 public:
8611 // Called when growing the table. 8615 // Called when growing the table.
8612 static bool IsMatch(const Object& a, const Object& b) { 8616 static bool IsMatch(const Object& a, const Object& b) {
8613 ASSERT(a.IsLibrary() && b.IsLibrary()); 8617 ASSERT(a.IsLibrary() && b.IsLibrary());
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
9321 void Library::AddAnonymousClass(const Class& cls) const { 9325 void Library::AddAnonymousClass(const Class& cls) const {
9322 intptr_t num_anonymous = this->raw_ptr()->num_anonymous_; 9326 intptr_t num_anonymous = this->raw_ptr()->num_anonymous_;
9323 Array& anon_array = Array::Handle(this->raw_ptr()->anonymous_classes_); 9327 Array& anon_array = Array::Handle(this->raw_ptr()->anonymous_classes_);
9324 if (num_anonymous == anon_array.Length()) { 9328 if (num_anonymous == anon_array.Length()) {
9325 intptr_t new_len = (num_anonymous == 0) ? 4 : num_anonymous * 2; 9329 intptr_t new_len = (num_anonymous == 0) ? 4 : num_anonymous * 2;
9326 anon_array = Array::Grow(anon_array, new_len); 9330 anon_array = Array::Grow(anon_array, new_len);
9327 StorePointer(&raw_ptr()->anonymous_classes_, anon_array.raw()); 9331 StorePointer(&raw_ptr()->anonymous_classes_, anon_array.raw());
9328 } 9332 }
9329 anon_array.SetAt(num_anonymous, cls); 9333 anon_array.SetAt(num_anonymous, cls);
9330 num_anonymous++; 9334 num_anonymous++;
9331 raw_ptr()->num_anonymous_ = num_anonymous; 9335 StoreNonPointer(&raw_ptr()->num_anonymous_, num_anonymous);
9332 } 9336 }
9333 9337
9334 9338
9335 RawLibrary* Library::ImportLibraryAt(intptr_t index) const { 9339 RawLibrary* Library::ImportLibraryAt(intptr_t index) const {
9336 Namespace& import = Namespace::Handle(ImportAt(index)); 9340 Namespace& import = Namespace::Handle(ImportAt(index));
9337 if (import.IsNull()) { 9341 if (import.IsNull()) {
9338 return Library::null(); 9342 return Library::null();
9339 } 9343 }
9340 return import.library(); 9344 return import.library();
9341 } 9345 }
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
9427 // TODO(iposva): Find reasonable initial size. 9431 // TODO(iposva): Find reasonable initial size.
9428 const int kInitialElementCount = 16; 9432 const int kInitialElementCount = 16;
9429 StorePointer(&raw_ptr()->dictionary_, NewDictionary(kInitialElementCount)); 9433 StorePointer(&raw_ptr()->dictionary_, NewDictionary(kInitialElementCount));
9430 } 9434 }
9431 9435
9432 9436
9433 void Library::InitImportList() const { 9437 void Library::InitImportList() const {
9434 const Array& imports = 9438 const Array& imports =
9435 Array::Handle(Array::New(kInitialImportsCapacity, Heap::kOld)); 9439 Array::Handle(Array::New(kInitialImportsCapacity, Heap::kOld));
9436 StorePointer(&raw_ptr()->imports_, imports.raw()); 9440 StorePointer(&raw_ptr()->imports_, imports.raw());
9437 raw_ptr()->num_imports_ = 0; 9441 StoreNonPointer(&raw_ptr()->num_imports_, 0);
9438 } 9442 }
9439 9443
9440 9444
9441 RawLibrary* Library::New() { 9445 RawLibrary* Library::New() {
9442 ASSERT(Object::library_class() != Class::null()); 9446 ASSERT(Object::library_class() != Class::null());
9443 RawObject* raw = Object::Allocate(Library::kClassId, 9447 RawObject* raw = Object::Allocate(Library::kClassId,
9444 Library::InstanceSize(), 9448 Library::InstanceSize(),
9445 Heap::kOld); 9449 Heap::kOld);
9446 return reinterpret_cast<RawLibrary*>(raw); 9450 return reinterpret_cast<RawLibrary*>(raw);
9447 } 9451 }
9448 9452
9449 9453
9450 RawLibrary* Library::NewLibraryHelper(const String& url, 9454 RawLibrary* Library::NewLibraryHelper(const String& url,
9451 bool import_core_lib) { 9455 bool import_core_lib) {
9452 const Library& result = Library::Handle(Library::New()); 9456 const Library& result = Library::Handle(Library::New());
9453 result.StorePointer(&result.raw_ptr()->name_, Symbols::Empty().raw()); 9457 result.StorePointer(&result.raw_ptr()->name_, Symbols::Empty().raw());
9454 result.StorePointer(&result.raw_ptr()->url_, url.raw()); 9458 result.StorePointer(&result.raw_ptr()->url_, url.raw());
9455 result.raw_ptr()->resolved_names_ = Object::empty_array().raw(); 9459 result.StorePointer(&result.raw_ptr()->resolved_names_,
9456 result.raw_ptr()->dictionary_ = Object::empty_array().raw(); 9460 Object::empty_array().raw());
9461 result.StorePointer(&result.raw_ptr()->dictionary_,
9462 Object::empty_array().raw());
9457 result.StorePointer(&result.raw_ptr()->metadata_, 9463 result.StorePointer(&result.raw_ptr()->metadata_,
9458 GrowableObjectArray::New(4, Heap::kOld)); 9464 GrowableObjectArray::New(4, Heap::kOld));
9459 result.raw_ptr()->anonymous_classes_ = Object::empty_array().raw(); 9465 result.StorePointer(&result.raw_ptr()->anonymous_classes_,
9460 result.raw_ptr()->num_anonymous_ = 0; 9466 Object::empty_array().raw());
9461 result.raw_ptr()->imports_ = Object::empty_array().raw(); 9467 result.StoreNonPointer(&result.raw_ptr()->num_anonymous_, 0);
9462 result.raw_ptr()->exports_ = Object::empty_array().raw(); 9468 result.StorePointer(&result.raw_ptr()->imports_, Object::empty_array().raw());
9463 result.raw_ptr()->loaded_scripts_ = Array::null(); 9469 result.StorePointer(&result.raw_ptr()->exports_, Object::empty_array().raw());
9470 result.StorePointer(&result.raw_ptr()->loaded_scripts_, Array::null());
9464 result.raw_ptr()->load_error_ = Instance::null(); 9471 result.raw_ptr()->load_error_ = Instance::null();
9465 result.set_native_entry_resolver(NULL); 9472 result.set_native_entry_resolver(NULL);
9466 result.set_native_entry_symbol_resolver(NULL); 9473 result.set_native_entry_symbol_resolver(NULL);
9467 result.raw_ptr()->corelib_imported_ = true; 9474 result.StoreNonPointer(&result.raw_ptr()->corelib_imported_, true);
9468 result.set_debuggable(false); 9475 result.set_debuggable(false);
9469 result.set_is_dart_scheme(url.StartsWith(Symbols::DartScheme())); 9476 result.set_is_dart_scheme(url.StartsWith(Symbols::DartScheme()));
9470 result.raw_ptr()->load_state_ = RawLibrary::kAllocated; 9477 result.StoreNonPointer(&result.raw_ptr()->load_state_,
9471 result.raw_ptr()->index_ = -1; 9478 RawLibrary::kAllocated);
9479 result.StoreNonPointer(&result.raw_ptr()->index_, -1);
9472 const intptr_t kInitialNameCacheSize = 64; 9480 const intptr_t kInitialNameCacheSize = 64;
9473 result.InitResolvedNamesCache(kInitialNameCacheSize); 9481 result.InitResolvedNamesCache(kInitialNameCacheSize);
9474 result.InitClassDictionary(); 9482 result.InitClassDictionary();
9475 result.InitImportList(); 9483 result.InitImportList();
9476 result.AllocatePrivateKey(); 9484 result.AllocatePrivateKey();
9477 if (import_core_lib) { 9485 if (import_core_lib) {
9478 const Library& core_lib = Library::Handle(Library::CoreLibrary()); 9486 const Library& core_lib = Library::Handle(Library::CoreLibrary());
9479 ASSERT(!core_lib.IsNull()); 9487 ASSERT(!core_lib.IsNull());
9480 const Namespace& ns = Namespace::Handle( 9488 const Namespace& ns = Namespace::Handle(
9481 Namespace::New(core_lib, Object::null_array(), Object::null_array())); 9489 Namespace::New(core_lib, Object::null_array(), Object::null_array()));
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
9944 RawClass* LibraryPrefix::LookupClass(const String& class_name) const { 9952 RawClass* LibraryPrefix::LookupClass(const String& class_name) const {
9945 const Object& obj = Object::Handle(LookupObject(class_name)); 9953 const Object& obj = Object::Handle(LookupObject(class_name));
9946 if (obj.IsClass()) { 9954 if (obj.IsClass()) {
9947 return Class::Cast(obj).raw(); 9955 return Class::Cast(obj).raw();
9948 } 9956 }
9949 return Class::null(); 9957 return Class::null();
9950 } 9958 }
9951 9959
9952 9960
9953 void LibraryPrefix::set_is_loaded() const { 9961 void LibraryPrefix::set_is_loaded() const {
9954 raw_ptr()->is_loaded_ = true; 9962 StoreNonPointer(&raw_ptr()->is_loaded_, true);
9955 } 9963 }
9956 9964
9957 9965
9958 bool LibraryPrefix::LoadLibrary() const { 9966 bool LibraryPrefix::LoadLibrary() const {
9959 // Non-deferred prefixes are loaded. 9967 // Non-deferred prefixes are loaded.
9960 ASSERT(is_deferred_load() || is_loaded()); 9968 ASSERT(is_deferred_load() || is_loaded());
9961 if (is_loaded()) { 9969 if (is_loaded()) {
9962 return true; // Load request has already completed. 9970 return true; // Load request has already completed.
9963 } 9971 }
9964 ASSERT(is_deferred_load()); 9972 ASSERT(is_deferred_load());
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
10063 10071
10064 10072
10065 RawLibraryPrefix* LibraryPrefix::New(const String& name, 10073 RawLibraryPrefix* LibraryPrefix::New(const String& name,
10066 const Namespace& import, 10074 const Namespace& import,
10067 bool deferred_load, 10075 bool deferred_load,
10068 const Library& importer) { 10076 const Library& importer) {
10069 const LibraryPrefix& result = LibraryPrefix::Handle(LibraryPrefix::New()); 10077 const LibraryPrefix& result = LibraryPrefix::Handle(LibraryPrefix::New());
10070 result.set_name(name); 10078 result.set_name(name);
10071 result.set_num_imports(0); 10079 result.set_num_imports(0);
10072 result.set_importer(importer); 10080 result.set_importer(importer);
10073 result.raw_ptr()->is_deferred_load_ = deferred_load; 10081 result.StoreNonPointer(&result.raw_ptr()->is_deferred_load_, deferred_load);
10074 result.raw_ptr()->is_loaded_ = !deferred_load; 10082 result.StoreNonPointer(&result.raw_ptr()->is_loaded_, !deferred_load);
10075 result.set_imports(Array::Handle(Array::New(kInitialSize))); 10083 result.set_imports(Array::Handle(Array::New(kInitialSize)));
10076 result.AddImport(import); 10084 result.AddImport(import);
10077 result.set_dependent_code(Object::null_array()); 10085 result.set_dependent_code(Object::null_array());
10078 return result.raw(); 10086 return result.raw();
10079 } 10087 }
10080 10088
10081 10089
10082 void LibraryPrefix::set_name(const String& value) const { 10090 void LibraryPrefix::set_name(const String& value) const {
10083 ASSERT(value.IsSymbol()); 10091 ASSERT(value.IsSymbol());
10084 StorePointer(&raw_ptr()->name_, value.raw()); 10092 StorePointer(&raw_ptr()->name_, value.raw());
10085 } 10093 }
10086 10094
10087 10095
10088 void LibraryPrefix::set_imports(const Array& value) const { 10096 void LibraryPrefix::set_imports(const Array& value) const {
10089 StorePointer(&raw_ptr()->imports_, value.raw()); 10097 StorePointer(&raw_ptr()->imports_, value.raw());
10090 } 10098 }
10091 10099
10092 10100
10093 void LibraryPrefix::set_num_imports(intptr_t value) const { 10101 void LibraryPrefix::set_num_imports(intptr_t value) const {
10094 raw_ptr()->num_imports_ = value; 10102 StoreNonPointer(&raw_ptr()->num_imports_, value);
10095 } 10103 }
10096 10104
10097 10105
10098 void LibraryPrefix::set_importer(const Library& value) const { 10106 void LibraryPrefix::set_importer(const Library& value) const {
10099 StorePointer(&raw_ptr()->importer_, value.raw()); 10107 StorePointer(&raw_ptr()->importer_, value.raw());
10100 } 10108 }
10101 10109
10102 10110
10103 const char* LibraryPrefix::ToCString() const { 10111 const char* LibraryPrefix::ToCString() const {
10104 const char* kFormat = "LibraryPrefix:'%s'"; 10112 const char* kFormat = "LibraryPrefix:'%s'";
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
10440 Object::PrintJSONImpl(stream, ref); 10448 Object::PrintJSONImpl(stream, ref);
10441 } 10449 }
10442 10450
10443 10451
10444 intptr_t PcDescriptors::Length() const { 10452 intptr_t PcDescriptors::Length() const {
10445 return raw_ptr()->length_; 10453 return raw_ptr()->length_;
10446 } 10454 }
10447 10455
10448 10456
10449 void PcDescriptors::SetLength(intptr_t value) const { 10457 void PcDescriptors::SetLength(intptr_t value) const {
10450 raw_ptr()->length_ = value; 10458 StoreNonPointer(&raw_ptr()->length_, value);
10451 } 10459 }
10452 10460
10453 10461
10454 intptr_t PcDescriptors::RecordSizeInBytes() const { 10462 intptr_t PcDescriptors::RecordSizeInBytes() const {
10455 return raw_ptr()->record_size_in_bytes_; 10463 return raw_ptr()->record_size_in_bytes_;
10456 } 10464 }
10457 10465
10458 10466
10459 void PcDescriptors::SetRecordSizeInBytes(intptr_t value) const { 10467 void PcDescriptors::SetRecordSizeInBytes(intptr_t value) const {
10460 raw_ptr()->record_size_in_bytes_ = value; 10468 raw_ptr()->record_size_in_bytes_ = value;
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
10903 num_variables, RawLocalVarDescriptors::kMaxIndex); 10911 num_variables, RawLocalVarDescriptors::kMaxIndex);
10904 } 10912 }
10905 LocalVarDescriptors& result = LocalVarDescriptors::Handle(); 10913 LocalVarDescriptors& result = LocalVarDescriptors::Handle();
10906 { 10914 {
10907 uword size = LocalVarDescriptors::InstanceSize(num_variables); 10915 uword size = LocalVarDescriptors::InstanceSize(num_variables);
10908 RawObject* raw = Object::Allocate(LocalVarDescriptors::kClassId, 10916 RawObject* raw = Object::Allocate(LocalVarDescriptors::kClassId,
10909 size, 10917 size,
10910 Heap::kOld); 10918 Heap::kOld);
10911 NoGCScope no_gc; 10919 NoGCScope no_gc;
10912 result ^= raw; 10920 result ^= raw;
10913 result.raw_ptr()->num_entries_ = num_variables; 10921 result.StoreNonPointer(&result.raw_ptr()->num_entries_, num_variables);
10914 } 10922 }
10915 return result.raw(); 10923 return result.raw();
10916 } 10924 }
10917 10925
10918 10926
10919 intptr_t LocalVarDescriptors::Length() const { 10927 intptr_t LocalVarDescriptors::Length() const {
10920 return raw_ptr()->num_entries_; 10928 return raw_ptr()->num_entries_;
10921 } 10929 }
10922 10930
10923 10931
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
11002 num_handlers); 11010 num_handlers);
11003 } 11011 }
11004 ExceptionHandlers& result = ExceptionHandlers::Handle(); 11012 ExceptionHandlers& result = ExceptionHandlers::Handle();
11005 { 11013 {
11006 uword size = ExceptionHandlers::InstanceSize(num_handlers); 11014 uword size = ExceptionHandlers::InstanceSize(num_handlers);
11007 RawObject* raw = Object::Allocate(ExceptionHandlers::kClassId, 11015 RawObject* raw = Object::Allocate(ExceptionHandlers::kClassId,
11008 size, 11016 size,
11009 Heap::kOld); 11017 Heap::kOld);
11010 NoGCScope no_gc; 11018 NoGCScope no_gc;
11011 result ^= raw; 11019 result ^= raw;
11012 result.raw_ptr()->num_entries_ = num_handlers; 11020 result.StoreNonPointer(&result.raw_ptr()->num_entries_, num_handlers);
11013 } 11021 }
11014 const Array& handled_types_data = (num_handlers == 0) ? 11022 const Array& handled_types_data = (num_handlers == 0) ?
11015 Object::empty_array() : 11023 Object::empty_array() :
11016 Array::Handle(Array::New(num_handlers)); 11024 Array::Handle(Array::New(num_handlers));
11017 result.set_handled_types_data(handled_types_data); 11025 result.set_handled_types_data(handled_types_data);
11018 return result.raw(); 11026 return result.raw();
11019 } 11027 }
11020 11028
11021 11029
11022 const char* ExceptionHandlers::ToCString() const { 11030 const char* ExceptionHandlers::ToCString() const {
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
11212 result ^= raw; 11220 result ^= raw;
11213 result.SetLength(num_commands); 11221 result.SetLength(num_commands);
11214 } 11222 }
11215 return result.raw(); 11223 return result.raw();
11216 } 11224 }
11217 11225
11218 11226
11219 void DeoptInfo::SetLength(intptr_t value) const { 11227 void DeoptInfo::SetLength(intptr_t value) const {
11220 // This is only safe because we create a new Smi, which does not cause 11228 // This is only safe because we create a new Smi, which does not cause
11221 // heap allocation. 11229 // heap allocation.
11222 raw_ptr()->length_ = Smi::New(value); 11230 StoreSmi(&raw_ptr()->length_, Smi::New(value));
11223 } 11231 }
11224 11232
11225 11233
11226 void DeoptInfo::SetAt(intptr_t index, 11234 void DeoptInfo::SetAt(intptr_t index,
11227 intptr_t instr_kind, 11235 intptr_t instr_kind,
11228 intptr_t from_index) const { 11236 intptr_t from_index) const {
11229 *(EntryAddr(index, kInstruction)) = instr_kind; 11237 *(EntryAddr(index, kInstruction)) = instr_kind;
11230 *(EntryAddr(index, kFromIndex)) = from_index; 11238 *(EntryAddr(index, kFromIndex)) = from_index;
11231 } 11239 }
11232 11240
(...skipping 24 matching lines...) Expand all
11257 } 11265 }
11258 11266
11259 11267
11260 void ICData::set_arguments_descriptor(const Array& value) const { 11268 void ICData::set_arguments_descriptor(const Array& value) const {
11261 ASSERT(!value.IsNull()); 11269 ASSERT(!value.IsNull());
11262 StorePointer(&raw_ptr()->args_descriptor_, value.raw()); 11270 StorePointer(&raw_ptr()->args_descriptor_, value.raw());
11263 } 11271 }
11264 11272
11265 void ICData::set_deopt_id(intptr_t value) const { 11273 void ICData::set_deopt_id(intptr_t value) const {
11266 ASSERT(value <= kMaxInt32); 11274 ASSERT(value <= kMaxInt32);
11267 raw_ptr()->deopt_id_ = value; 11275 StoreNonPointer(&raw_ptr()->deopt_id_, value);
11268 } 11276 }
11269 11277
11270 11278
11271 void ICData::set_ic_data(const Array& value) const { 11279 void ICData::set_ic_data(const Array& value) const {
11272 ASSERT(!value.IsNull()); 11280 ASSERT(!value.IsNull());
11273 StorePointer(&raw_ptr()->ic_data_, value.raw()); 11281 StorePointer(&raw_ptr()->ic_data_, value.raw());
11274 } 11282 }
11275 11283
11276 11284
11277 intptr_t ICData::NumArgsTested() const { 11285 intptr_t ICData::NumArgsTested() const {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
11330 // Warning issued in ic miss handler. 11338 // Warning issued in ic miss handler.
11331 // No decoding necessary, so allow optimization if warning already issued. 11339 // No decoding necessary, so allow optimization if warning already issued.
11332 if (name.Equals(Symbols::toString()) && !IssuedJSWarning()) { 11340 if (name.Equals(Symbols::toString()) && !IssuedJSWarning()) {
11333 return true; 11341 return true;
11334 } 11342 }
11335 return false; 11343 return false;
11336 } 11344 }
11337 11345
11338 11346
11339 void ICData::set_state_bits(uint32_t bits) const { 11347 void ICData::set_state_bits(uint32_t bits) const {
11340 raw_ptr()->state_bits_ = bits; 11348 StoreNonPointer(&raw_ptr()->state_bits_, bits);
11341 } 11349 }
11342 11350
11343 11351
11344 intptr_t ICData::TestEntryLengthFor(intptr_t num_args) { 11352 intptr_t ICData::TestEntryLengthFor(intptr_t num_args) {
11345 return num_args + 1 /* target function*/ + 1 /* frequency */; 11353 return num_args + 1 /* target function*/ + 1 /* frequency */;
11346 } 11354 }
11347 11355
11348 11356
11349 intptr_t ICData::TestEntryLength() const { 11357 intptr_t ICData::TestEntryLength() const {
11350 return TestEntryLengthFor(NumArgsTested()); 11358 return TestEntryLengthFor(NumArgsTested());
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
11854 comments_.SetAt(idx * kNumberOfEntries + kCommentEntry, comment); 11862 comments_.SetAt(idx * kNumberOfEntries + kCommentEntry, comment);
11855 } 11863 }
11856 11864
11857 11865
11858 Code::Comments::Comments(const Array& comments) 11866 Code::Comments::Comments(const Array& comments)
11859 : comments_(comments) { 11867 : comments_(comments) {
11860 } 11868 }
11861 11869
11862 11870
11863 void Code::set_state_bits(intptr_t bits) const { 11871 void Code::set_state_bits(intptr_t bits) const {
11864 raw_ptr()->state_bits_ = bits; 11872 StoreNonPointer(&raw_ptr()->state_bits_, bits);
11865 } 11873 }
11866 11874
11867 11875
11868 void Code::set_is_optimized(bool value) const { 11876 void Code::set_is_optimized(bool value) const {
11869 set_state_bits(OptimizedBit::update(value, raw_ptr()->state_bits_)); 11877 set_state_bits(OptimizedBit::update(value, raw_ptr()->state_bits_));
11870 } 11878 }
11871 11879
11872 11880
11873 void Code::set_is_alive(bool value) const { 11881 void Code::set_is_alive(bool value) const {
11874 set_state_bits(AliveBit::update(value, raw_ptr()->state_bits_)); 11882 set_state_bits(AliveBit::update(value, raw_ptr()->state_bits_));
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
12634 12642
12635 // Class IDs in the table are smi-tagged, so we use a smi-tagged mask 12643 // Class IDs in the table are smi-tagged, so we use a smi-tagged mask
12636 // and target class ID to avoid untagging (on each iteration of the 12644 // and target class ID to avoid untagging (on each iteration of the
12637 // test loop) in generated code. 12645 // test loop) in generated code.
12638 intptr_t MegamorphicCache::mask() const { 12646 intptr_t MegamorphicCache::mask() const {
12639 return Smi::Value(raw_ptr()->mask_); 12647 return Smi::Value(raw_ptr()->mask_);
12640 } 12648 }
12641 12649
12642 12650
12643 void MegamorphicCache::set_mask(intptr_t mask) const { 12651 void MegamorphicCache::set_mask(intptr_t mask) const {
12644 raw_ptr()->mask_ = Smi::New(mask); 12652 StoreSmi(&raw_ptr()->mask_, Smi::New(mask));
12645 } 12653 }
12646 12654
12647 12655
12648 intptr_t MegamorphicCache::filled_entry_count() const { 12656 intptr_t MegamorphicCache::filled_entry_count() const {
12649 return raw_ptr()->filled_entry_count_; 12657 return raw_ptr()->filled_entry_count_;
12650 } 12658 }
12651 12659
12652 12660
12653 void MegamorphicCache::set_filled_entry_count(intptr_t count) const { 12661 void MegamorphicCache::set_filled_entry_count(intptr_t count) const {
12654 raw_ptr()->filled_entry_count_ = count; 12662 StoreNonPointer(&raw_ptr()->filled_entry_count_, count);
12655 } 12663 }
12656 12664
12657 12665
12658 RawMegamorphicCache* MegamorphicCache::New() { 12666 RawMegamorphicCache* MegamorphicCache::New() {
12659 MegamorphicCache& result = MegamorphicCache::Handle(); 12667 MegamorphicCache& result = MegamorphicCache::Handle();
12660 { RawObject* raw = Object::Allocate(MegamorphicCache::kClassId, 12668 { RawObject* raw = Object::Allocate(MegamorphicCache::kClassId,
12661 MegamorphicCache::InstanceSize(), 12669 MegamorphicCache::InstanceSize(),
12662 Heap::kOld); 12670 Heap::kOld);
12663 NoGCScope no_gc; 12671 NoGCScope no_gc;
12664 result ^= raw; 12672 result ^= raw;
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
12953 } 12961 }
12954 12962
12955 12963
12956 void LanguageError::set_script(const Script& value) const { 12964 void LanguageError::set_script(const Script& value) const {
12957 StorePointer(&raw_ptr()->script_, value.raw()); 12965 StorePointer(&raw_ptr()->script_, value.raw());
12958 } 12966 }
12959 12967
12960 12968
12961 void LanguageError::set_token_pos(intptr_t value) const { 12969 void LanguageError::set_token_pos(intptr_t value) const {
12962 ASSERT(value >= 0); 12970 ASSERT(value >= 0);
12963 raw_ptr()->token_pos_ = value; 12971 StoreNonPointer(&raw_ptr()->token_pos_, value);
12964 } 12972 }
12965 12973
12966 12974
12967 void LanguageError::set_kind(uint8_t value) const { 12975 void LanguageError::set_kind(uint8_t value) const {
12968 raw_ptr()->kind_ = value; 12976 StoreNonPointer(&raw_ptr()->kind_, value);
12969 } 12977 }
12970 12978
12971 12979
12972 void LanguageError::set_message(const String& value) const { 12980 void LanguageError::set_message(const String& value) const {
12973 StorePointer(&raw_ptr()->message_, value.raw()); 12981 StorePointer(&raw_ptr()->message_, value.raw());
12974 } 12982 }
12975 12983
12976 12984
12977 void LanguageError::set_formatted_message(const String& value) const { 12985 void LanguageError::set_formatted_message(const String& value) const {
12978 StorePointer(&raw_ptr()->formatted_message_, value.raw()); 12986 StorePointer(&raw_ptr()->formatted_message_, value.raw());
(...skipping 1679 matching lines...) Expand 10 before | Expand all | Expand 10 after
14658 14666
14659 14667
14660 RawType* Type::New(const Object& clazz, 14668 RawType* Type::New(const Object& clazz,
14661 const TypeArguments& arguments, 14669 const TypeArguments& arguments,
14662 intptr_t token_pos, 14670 intptr_t token_pos,
14663 Heap::Space space) { 14671 Heap::Space space) {
14664 const Type& result = Type::Handle(Type::New(space)); 14672 const Type& result = Type::Handle(Type::New(space));
14665 result.set_type_class(clazz); 14673 result.set_type_class(clazz);
14666 result.set_arguments(arguments); 14674 result.set_arguments(arguments);
14667 result.set_token_pos(token_pos); 14675 result.set_token_pos(token_pos);
14668 result.raw_ptr()->type_state_ = RawType::kAllocated; 14676 result.StoreNonPointer(&result.raw_ptr()->type_state_, RawType::kAllocated);
14669 return result.raw(); 14677 return result.raw();
14670 } 14678 }
14671 14679
14672 14680
14673 void Type::set_token_pos(intptr_t token_pos) const { 14681 void Type::set_token_pos(intptr_t token_pos) const {
14674 ASSERT(token_pos >= 0); 14682 ASSERT(token_pos >= 0);
14675 raw_ptr()->token_pos_ = token_pos; 14683 StoreNonPointer(&raw_ptr()->token_pos_, token_pos);
14676 } 14684 }
14677 14685
14678 14686
14679 void Type::set_type_state(int8_t state) const { 14687 void Type::set_type_state(int8_t state) const {
14680 ASSERT((state >= RawType::kAllocated) && 14688 ASSERT((state >= RawType::kAllocated) &&
14681 (state <= RawType::kFinalizedUninstantiated)); 14689 (state <= RawType::kFinalizedUninstantiated));
14682 raw_ptr()->type_state_ = state; 14690 StoreNonPointer(&raw_ptr()->type_state_, state);
14683 } 14691 }
14684 14692
14685 14693
14686 const char* Type::ToCString() const { 14694 const char* Type::ToCString() const {
14687 if (IsResolved()) { 14695 if (IsResolved()) {
14688 const TypeArguments& type_arguments = TypeArguments::Handle(arguments()); 14696 const TypeArguments& type_arguments = TypeArguments::Handle(arguments());
14689 const char* class_name; 14697 const char* class_name;
14690 if (HasResolvedTypeClass()) { 14698 if (HasResolvedTypeClass()) {
14691 class_name = String::Handle( 14699 class_name = String::Handle(
14692 Class::Handle(type_class()).Name()).ToCString(); 14700 Class::Handle(type_class()).Name()).ToCString();
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
14945 14953
14946 14954
14947 void TypeParameter::set_parameterized_class(const Class& value) const { 14955 void TypeParameter::set_parameterized_class(const Class& value) const {
14948 // Set value may be null. 14956 // Set value may be null.
14949 StorePointer(&raw_ptr()->parameterized_class_, value.raw()); 14957 StorePointer(&raw_ptr()->parameterized_class_, value.raw());
14950 } 14958 }
14951 14959
14952 14960
14953 void TypeParameter::set_index(intptr_t value) const { 14961 void TypeParameter::set_index(intptr_t value) const {
14954 ASSERT(value >= 0); 14962 ASSERT(value >= 0);
14955 raw_ptr()->index_ = value; 14963 StoreNonPointer(&raw_ptr()->index_, value);
14956 } 14964 }
14957 14965
14958 14966
14959 void TypeParameter::set_name(const String& value) const { 14967 void TypeParameter::set_name(const String& value) const {
14960 ASSERT(value.IsSymbol()); 14968 ASSERT(value.IsSymbol());
14961 StorePointer(&raw_ptr()->name_, value.raw()); 14969 StorePointer(&raw_ptr()->name_, value.raw());
14962 } 14970 }
14963 14971
14964 14972
14965 void TypeParameter::set_bound(const AbstractType& value) const { 14973 void TypeParameter::set_bound(const AbstractType& value) const {
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
15067 intptr_t index, 15075 intptr_t index,
15068 const String& name, 15076 const String& name,
15069 const AbstractType& bound, 15077 const AbstractType& bound,
15070 intptr_t token_pos) { 15078 intptr_t token_pos) {
15071 const TypeParameter& result = TypeParameter::Handle(TypeParameter::New()); 15079 const TypeParameter& result = TypeParameter::Handle(TypeParameter::New());
15072 result.set_parameterized_class(parameterized_class); 15080 result.set_parameterized_class(parameterized_class);
15073 result.set_index(index); 15081 result.set_index(index);
15074 result.set_name(name); 15082 result.set_name(name);
15075 result.set_bound(bound); 15083 result.set_bound(bound);
15076 result.set_token_pos(token_pos); 15084 result.set_token_pos(token_pos);
15077 result.raw_ptr()->type_state_ = RawTypeParameter::kAllocated; 15085 result.StoreNonPointer(&result.raw_ptr()->type_state_,
15086 RawTypeParameter::kAllocated);
15078 return result.raw(); 15087 return result.raw();
15079 } 15088 }
15080 15089
15081 15090
15082 void TypeParameter::set_token_pos(intptr_t token_pos) const { 15091 void TypeParameter::set_token_pos(intptr_t token_pos) const {
15083 ASSERT(token_pos >= 0); 15092 ASSERT(token_pos >= 0);
15084 raw_ptr()->token_pos_ = token_pos; 15093 StoreNonPointer(&raw_ptr()->token_pos_, token_pos);
15085 } 15094 }
15086 15095
15087 15096
15088 void TypeParameter::set_type_state(int8_t state) const { 15097 void TypeParameter::set_type_state(int8_t state) const {
15089 ASSERT((state == RawTypeParameter::kAllocated) || 15098 ASSERT((state == RawTypeParameter::kAllocated) ||
15090 (state == RawTypeParameter::kBeingFinalized) || 15099 (state == RawTypeParameter::kBeingFinalized) ||
15091 (state == RawTypeParameter::kFinalizedUninstantiated)); 15100 (state == RawTypeParameter::kFinalizedUninstantiated));
15092 raw_ptr()->type_state_ = state; 15101 StoreNonPointer(&raw_ptr()->type_state_, state);
15093 } 15102 }
15094 15103
15095 15104
15096 const char* TypeParameter::ToCString() const { 15105 const char* TypeParameter::ToCString() const {
15097 const char* format = 15106 const char* format =
15098 "TypeParameter: name %s; index: %d; class: %s; bound: %s"; 15107 "TypeParameter: name %s; index: %d; class: %s; bound: %s";
15099 const char* name_cstr = String::Handle(Name()).ToCString(); 15108 const char* name_cstr = String::Handle(Name()).ToCString();
15100 const Class& cls = Class::Handle(parameterized_class()); 15109 const Class& cls = Class::Handle(parameterized_class());
15101 const char* cls_cstr = 15110 const char* cls_cstr =
15102 cls.IsNull() ? " null" : String::Handle(cls.Name()).ToCString(); 15111 cls.IsNull() ? " null" : String::Handle(cls.Name()).ToCString();
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after
15863 jsobj.AddPropertyF("valueAsString", "%" Pd "", Value()); 15872 jsobj.AddPropertyF("valueAsString", "%" Pd "", Value());
15864 } 15873 }
15865 15874
15866 15875
15867 RawClass* Smi::Class() { 15876 RawClass* Smi::Class() {
15868 return Isolate::Current()->object_store()->smi_class(); 15877 return Isolate::Current()->object_store()->smi_class();
15869 } 15878 }
15870 15879
15871 15880
15872 void Mint::set_value(int64_t value) const { 15881 void Mint::set_value(int64_t value) const {
15873 raw_ptr()->value_ = value; 15882 StoreNonPointer(&raw_ptr()->value_, value);
15874 } 15883 }
15875 15884
15876 15885
15877 RawMint* Mint::New(int64_t val, Heap::Space space) { 15886 RawMint* Mint::New(int64_t val, Heap::Space space) {
15878 // Do not allocate a Mint if Smi would do. 15887 // Do not allocate a Mint if Smi would do.
15879 ASSERT(!Smi::IsValid(val)); 15888 ASSERT(!Smi::IsValid(val));
15880 ASSERT(Isolate::Current()->object_store()->mint_class() != Class::null()); 15889 ASSERT(Isolate::Current()->object_store()->mint_class() != Class::null());
15881 Mint& result = Mint::Handle(); 15890 Mint& result = Mint::Handle();
15882 { 15891 {
15883 RawObject* raw = Object::Allocate(Mint::kClassId, 15892 RawObject* raw = Object::Allocate(Mint::kClassId,
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
15984 return chars; 15993 return chars;
15985 } 15994 }
15986 15995
15987 15996
15988 void Mint::PrintJSONImpl(JSONStream* stream, bool ref) const { 15997 void Mint::PrintJSONImpl(JSONStream* stream, bool ref) const {
15989 Integer::PrintJSONImpl(stream, ref); 15998 Integer::PrintJSONImpl(stream, ref);
15990 } 15999 }
15991 16000
15992 16001
15993 void Double::set_value(double value) const { 16002 void Double::set_value(double value) const {
15994 raw_ptr()->value_ = value; 16003 StoreNonPointer(&raw_ptr()->value_, value);
15995 } 16004 }
15996 16005
15997 16006
15998 bool Double::BitwiseEqualsToDouble(double value) const { 16007 bool Double::BitwiseEqualsToDouble(double value) const {
15999 intptr_t value_offset = Double::value_offset(); 16008 intptr_t value_offset = Double::value_offset();
16000 void* this_addr = reinterpret_cast<void*>( 16009 void* this_addr = reinterpret_cast<void*>(
16001 reinterpret_cast<uword>(this->raw_ptr()) + value_offset); 16010 reinterpret_cast<uword>(this->raw_ptr()) + value_offset);
16002 void* other_addr = reinterpret_cast<void*>(&value); 16011 void* other_addr = reinterpret_cast<void*>(&value);
16003 return (memcmp(this_addr, other_addr, sizeof(value)) == 0); 16012 return (memcmp(this_addr, other_addr, sizeof(value)) == 0);
16004 } 16013 }
(...skipping 3195 matching lines...) Expand 10 before | Expand all | Expand 10 after
19200 return simd128_value_t().readFrom(&raw_ptr()->value_[0]); 19209 return simd128_value_t().readFrom(&raw_ptr()->value_[0]);
19201 } 19210 }
19202 19211
19203 19212
19204 void Float32x4::set_value(simd128_value_t value) const { 19213 void Float32x4::set_value(simd128_value_t value) const {
19205 value.writeTo(&raw_ptr()->value_[0]); 19214 value.writeTo(&raw_ptr()->value_[0]);
19206 } 19215 }
19207 19216
19208 19217
19209 void Float32x4::set_x(float value) const { 19218 void Float32x4::set_x(float value) const {
19210 raw_ptr()->value_[0] = value; 19219 StoreNonPointer(&raw_ptr()->value_[0], value);
19211 } 19220 }
19212 19221
19213 19222
19214 void Float32x4::set_y(float value) const { 19223 void Float32x4::set_y(float value) const {
19215 raw_ptr()->value_[1] = value; 19224 StoreNonPointer(&raw_ptr()->value_[1], value);
19216 } 19225 }
19217 19226
19218 19227
19219 void Float32x4::set_z(float value) const { 19228 void Float32x4::set_z(float value) const {
19220 raw_ptr()->value_[2] = value; 19229 StoreNonPointer(&raw_ptr()->value_[2], value);
19221 } 19230 }
19222 19231
19223 19232
19224 void Float32x4::set_w(float value) const { 19233 void Float32x4::set_w(float value) const {
19225 raw_ptr()->value_[3] = value; 19234 StoreNonPointer(&raw_ptr()->value_[3], value);
19226 } 19235 }
19227 19236
19228 19237
19229 float Float32x4::x() const { 19238 float Float32x4::x() const {
19230 return raw_ptr()->value_[0]; 19239 return raw_ptr()->value_[0];
19231 } 19240 }
19232 19241
19233 19242
19234 float Float32x4::y() const { 19243 float Float32x4::y() const {
19235 return raw_ptr()->value_[1]; 19244 return raw_ptr()->value_[1];
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
19295 space); 19304 space);
19296 NoGCScope no_gc; 19305 NoGCScope no_gc;
19297 result ^= raw; 19306 result ^= raw;
19298 } 19307 }
19299 result.set_value(value); 19308 result.set_value(value);
19300 return result.raw(); 19309 return result.raw();
19301 } 19310 }
19302 19311
19303 19312
19304 void Int32x4::set_x(int32_t value) const { 19313 void Int32x4::set_x(int32_t value) const {
19305 raw_ptr()->value_[0] = value; 19314 StoreNonPointer(&raw_ptr()->value_[0], value);
19306 } 19315 }
19307 19316
19308 19317
19309 void Int32x4::set_y(int32_t value) const { 19318 void Int32x4::set_y(int32_t value) const {
19310 raw_ptr()->value_[1] = value; 19319 StoreNonPointer(&raw_ptr()->value_[1], value);
19311 } 19320 }
19312 19321
19313 19322
19314 void Int32x4::set_z(int32_t value) const { 19323 void Int32x4::set_z(int32_t value) const {
19315 raw_ptr()->value_[2] = value; 19324 StoreNonPointer(&raw_ptr()->value_[2], value);
19316 } 19325 }
19317 19326
19318 19327
19319 void Int32x4::set_w(int32_t value) const { 19328 void Int32x4::set_w(int32_t value) const {
19320 raw_ptr()->value_[3] = value; 19329 StoreNonPointer(&raw_ptr()->value_[3], value);
19321 } 19330 }
19322 19331
19323 19332
19324 int32_t Int32x4::x() const { 19333 int32_t Int32x4::x() const {
19325 return raw_ptr()->value_[0]; 19334 return raw_ptr()->value_[0];
19326 } 19335 }
19327 19336
19328 19337
19329 int32_t Int32x4::y() const { 19338 int32_t Int32x4::y() const {
19330 return raw_ptr()->value_[1]; 19339 return raw_ptr()->value_[1];
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
19407 return raw_ptr()->value_[0]; 19416 return raw_ptr()->value_[0];
19408 } 19417 }
19409 19418
19410 19419
19411 double Float64x2::y() const { 19420 double Float64x2::y() const {
19412 return raw_ptr()->value_[1]; 19421 return raw_ptr()->value_[1];
19413 } 19422 }
19414 19423
19415 19424
19416 void Float64x2::set_x(double x) const { 19425 void Float64x2::set_x(double x) const {
19417 raw_ptr()->value_[0] = x; 19426 StoreNonPointer(&raw_ptr()->value_[0], x);
19418 } 19427 }
19419 19428
19420 19429
19421 void Float64x2::set_y(double y) const { 19430 void Float64x2::set_y(double y) const {
19422 raw_ptr()->value_[1] = y; 19431 StoreNonPointer(&raw_ptr()->value_[1], y);
19423 } 19432 }
19424 19433
19425 19434
19426 simd128_value_t Float64x2::value() const { 19435 simd128_value_t Float64x2::value() const {
19427 return simd128_value_t().readFrom(&raw_ptr()->value_[0]); 19436 return simd128_value_t().readFrom(&raw_ptr()->value_[0]);
19428 } 19437 }
19429 19438
19430 19439
19431 void Float64x2::set_value(simd128_value_t value) const { 19440 void Float64x2::set_value(simd128_value_t value) const {
19432 value.writeTo(&raw_ptr()->value_[0]); 19441 value.writeTo(&raw_ptr()->value_[0]);
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
19577 19586
19578 19587
19579 RawCapability* Capability::New(uint64_t id, Heap::Space space) { 19588 RawCapability* Capability::New(uint64_t id, Heap::Space space) {
19580 Capability& result = Capability::Handle(); 19589 Capability& result = Capability::Handle();
19581 { 19590 {
19582 RawObject* raw = Object::Allocate(Capability::kClassId, 19591 RawObject* raw = Object::Allocate(Capability::kClassId,
19583 Capability::InstanceSize(), 19592 Capability::InstanceSize(),
19584 space); 19593 space);
19585 NoGCScope no_gc; 19594 NoGCScope no_gc;
19586 result ^= raw; 19595 result ^= raw;
19587 result.raw_ptr()->id_ = id; 19596 result.StoreNonPointer(&result.raw_ptr()->id_, id);
19588 } 19597 }
19589 return result.raw(); 19598 return result.raw();
19590 } 19599 }
19591 19600
19592 19601
19593 const char* Capability::ToCString() const { 19602 const char* Capability::ToCString() const {
19594 return "Capability"; 19603 return "Capability";
19595 } 19604 }
19596 19605
19597 19606
19598 void Capability::PrintJSONImpl(JSONStream* stream, bool ref) const { 19607 void Capability::PrintJSONImpl(JSONStream* stream, bool ref) const {
19599 Instance::PrintJSONImpl(stream, ref); 19608 Instance::PrintJSONImpl(stream, ref);
19600 } 19609 }
19601 19610
19602 19611
19603 RawReceivePort* ReceivePort::New(Dart_Port id, 19612 RawReceivePort* ReceivePort::New(Dart_Port id,
19604 bool is_control_port, 19613 bool is_control_port,
19605 Heap::Space space) { 19614 Heap::Space space) {
19606 Isolate* isolate = Isolate::Current(); 19615 Isolate* isolate = Isolate::Current();
19607 const SendPort& send_port = SendPort::Handle(isolate, SendPort::New(id)); 19616 const SendPort& send_port = SendPort::Handle(isolate, SendPort::New(id));
19608 19617
19609 ReceivePort& result = ReceivePort::Handle(isolate); 19618 ReceivePort& result = ReceivePort::Handle(isolate);
19610 { 19619 {
19611 RawObject* raw = Object::Allocate(ReceivePort::kClassId, 19620 RawObject* raw = Object::Allocate(ReceivePort::kClassId,
19612 ReceivePort::InstanceSize(), 19621 ReceivePort::InstanceSize(),
19613 space); 19622 space);
19614 NoGCScope no_gc; 19623 NoGCScope no_gc;
19615 result ^= raw; 19624 result ^= raw;
19616 result.raw_ptr()->send_port_ = send_port.raw(); 19625 result.StorePointer(&result.raw_ptr()->send_port_, send_port.raw());
19617 } 19626 }
19618 if (is_control_port) { 19627 if (is_control_port) {
19619 PortMap::SetPortState(id, PortMap::kControlPort); 19628 PortMap::SetPortState(id, PortMap::kControlPort);
19620 } else { 19629 } else {
19621 PortMap::SetPortState(id, PortMap::kLivePort); 19630 PortMap::SetPortState(id, PortMap::kLivePort);
19622 } 19631 }
19623 return result.raw(); 19632 return result.raw();
19624 } 19633 }
19625 19634
19626 19635
19627 const char* ReceivePort::ToCString() const { 19636 const char* ReceivePort::ToCString() const {
19628 return "ReceivePort"; 19637 return "ReceivePort";
19629 } 19638 }
19630 19639
19631 19640
19632 void ReceivePort::PrintJSONImpl(JSONStream* stream, bool ref) const { 19641 void ReceivePort::PrintJSONImpl(JSONStream* stream, bool ref) const {
19633 Instance::PrintJSONImpl(stream, ref); 19642 Instance::PrintJSONImpl(stream, ref);
19634 } 19643 }
19635 19644
19636 19645
19637 RawSendPort* SendPort::New(Dart_Port id, Heap::Space space) { 19646 RawSendPort* SendPort::New(Dart_Port id, Heap::Space space) {
19638 SendPort& result = SendPort::Handle(); 19647 SendPort& result = SendPort::Handle();
19639 { 19648 {
19640 RawObject* raw = Object::Allocate(SendPort::kClassId, 19649 RawObject* raw = Object::Allocate(SendPort::kClassId,
19641 SendPort::InstanceSize(), 19650 SendPort::InstanceSize(),
19642 space); 19651 space);
19643 NoGCScope no_gc; 19652 NoGCScope no_gc;
19644 result ^= raw; 19653 result ^= raw;
19645 result.raw_ptr()->id_ = id; 19654 result.StoreNonPointer(&result.raw_ptr()->id_, id);
19646 } 19655 }
19647 return result.raw(); 19656 return result.raw();
19648 } 19657 }
19649 19658
19650 19659
19651 const char* SendPort::ToCString() const { 19660 const char* SendPort::ToCString() const {
19652 return "SendPort"; 19661 return "SendPort";
19653 } 19662 }
19654 19663
19655 19664
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
19744 StorePointer(&raw_ptr()->catch_code_array_, code_array.raw()); 19753 StorePointer(&raw_ptr()->catch_code_array_, code_array.raw());
19745 } 19754 }
19746 19755
19747 19756
19748 void Stacktrace::set_catch_pc_offset_array(const Array& pc_offset_array) const { 19757 void Stacktrace::set_catch_pc_offset_array(const Array& pc_offset_array) const {
19749 StorePointer(&raw_ptr()->catch_pc_offset_array_, pc_offset_array.raw()); 19758 StorePointer(&raw_ptr()->catch_pc_offset_array_, pc_offset_array.raw());
19750 } 19759 }
19751 19760
19752 19761
19753 void Stacktrace::set_expand_inlined(bool value) const { 19762 void Stacktrace::set_expand_inlined(bool value) const {
19754 raw_ptr()->expand_inlined_ = value; 19763 StoreNonPointer(&raw_ptr()->expand_inlined_, value);
19755 } 19764 }
19756 19765
19757 19766
19758 bool Stacktrace::expand_inlined() const { 19767 bool Stacktrace::expand_inlined() const {
19759 return raw_ptr()->expand_inlined_; 19768 return raw_ptr()->expand_inlined_;
19760 } 19769 }
19761 19770
19762 19771
19763 RawStacktrace* Stacktrace::New(const Array& code_array, 19772 RawStacktrace* Stacktrace::New(const Array& code_array,
19764 const Array& pc_offset_array, 19773 const Array& pc_offset_array,
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
19960 return chars; 19969 return chars;
19961 } 19970 }
19962 19971
19963 19972
19964 void JSRegExp::set_pattern(const String& pattern) const { 19973 void JSRegExp::set_pattern(const String& pattern) const {
19965 StorePointer(&raw_ptr()->pattern_, pattern.raw()); 19974 StorePointer(&raw_ptr()->pattern_, pattern.raw());
19966 } 19975 }
19967 19976
19968 19977
19969 void JSRegExp::set_num_bracket_expressions(intptr_t value) const { 19978 void JSRegExp::set_num_bracket_expressions(intptr_t value) const {
19970 raw_ptr()->num_bracket_expressions_ = Smi::New(value); 19979 StoreSmi(&raw_ptr()->num_bracket_expressions_, Smi::New(value));
19971 } 19980 }
19972 19981
19973 19982
19974 RawJSRegExp* JSRegExp::New(intptr_t len, Heap::Space space) { 19983 RawJSRegExp* JSRegExp::New(intptr_t len, Heap::Space space) {
19975 if (len < 0 || len > kMaxElements) { 19984 if (len < 0 || len > kMaxElements) {
19976 // This should be caught before we reach here. 19985 // This should be caught before we reach here.
19977 FATAL1("Fatal error in JSRegexp::New: invalid len %" Pd "\n", len); 19986 FATAL1("Fatal error in JSRegexp::New: invalid len %" Pd "\n", len);
19978 } 19987 }
19979 JSRegExp& result = JSRegExp::Handle(); 19988 JSRegExp& result = JSRegExp::Handle();
19980 { 19989 {
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
20295 return tag_label.ToCString(); 20304 return tag_label.ToCString();
20296 } 20305 }
20297 20306
20298 20307
20299 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 20308 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
20300 Instance::PrintJSONImpl(stream, ref); 20309 Instance::PrintJSONImpl(stream, ref);
20301 } 20310 }
20302 20311
20303 20312
20304 } // namespace dart 20313 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698