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

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

Issue 2965723002: VM: Reland Inline instance object hash code into object header on 64bit. (Closed)
Patch Set: Fix snapshot incompatibility that sank Flutter Gallery Created 3 years, 5 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
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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/globals.h" // Needed here to get TARGET_ARCH_DBC. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_DBC.
6 #if defined(TARGET_ARCH_DBC) 6 #if defined(TARGET_ARCH_DBC)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 Location::RequiresRegister(), 1004 Location::RequiresRegister(),
1005 LocationSummary::kCall) { 1005 LocationSummary::kCall) {
1006 if (ArgumentCount() == 1) { 1006 if (ArgumentCount() == 1) {
1007 // Allocate with type arguments. 1007 // Allocate with type arguments.
1008 if (compiler->is_optimizing()) { 1008 if (compiler->is_optimizing()) {
1009 // If we're optimizing, try a streamlined fastpath. 1009 // If we're optimizing, try a streamlined fastpath.
1010 const intptr_t instance_size = cls().instance_size(); 1010 const intptr_t instance_size = cls().instance_size();
1011 Isolate* isolate = Isolate::Current(); 1011 Isolate* isolate = Isolate::Current();
1012 if (Heap::IsAllocatableInNewSpace(instance_size) && 1012 if (Heap::IsAllocatableInNewSpace(instance_size) &&
1013 !cls().TraceAllocation(isolate)) { 1013 !cls().TraceAllocation(isolate)) {
1014 uword tags = 0; 1014 uint32_t tags = 0;
1015 tags = RawObject::SizeTag::update(instance_size, tags); 1015 tags = RawObject::SizeTag::update(instance_size, tags);
1016 ASSERT(cls().id() != kIllegalCid); 1016 ASSERT(cls().id() != kIllegalCid);
1017 tags = RawObject::ClassIdTag::update(cls().id(), tags); 1017 tags = RawObject::ClassIdTag::update(cls().id(), tags);
1018 if (Smi::IsValid(tags)) { 1018 if (Smi::IsValid(tags)) {
1019 const intptr_t tags_kidx = 1019 const intptr_t tags_kidx =
1020 __ AddConstant(Smi::Handle(Smi::New(tags))); 1020 __ AddConstant(Smi::Handle(Smi::New(tags)));
1021 __ AllocateTOpt(locs()->out(0).reg(), tags_kidx); 1021 __ AllocateTOpt(locs()->out(0).reg(), tags_kidx);
1022 __ Nop(cls().type_arguments_field_offset()); 1022 __ Nop(cls().type_arguments_field_offset());
1023 } 1023 }
1024 } 1024 }
(...skipping 13 matching lines...) Expand all
1038 } else if (compiler->is_optimizing()) { 1038 } else if (compiler->is_optimizing()) {
1039 // If we're optimizing, try a streamlined fastpath. 1039 // If we're optimizing, try a streamlined fastpath.
1040 const intptr_t instance_size = cls().instance_size(); 1040 const intptr_t instance_size = cls().instance_size();
1041 Isolate* isolate = Isolate::Current(); 1041 Isolate* isolate = Isolate::Current();
1042 if (Heap::IsAllocatableInNewSpace(instance_size) && 1042 if (Heap::IsAllocatableInNewSpace(instance_size) &&
1043 !cls().TraceAllocation(isolate)) { 1043 !cls().TraceAllocation(isolate)) {
1044 uword tags = 0; 1044 uword tags = 0;
1045 tags = RawObject::SizeTag::update(instance_size, tags); 1045 tags = RawObject::SizeTag::update(instance_size, tags);
1046 ASSERT(cls().id() != kIllegalCid); 1046 ASSERT(cls().id() != kIllegalCid);
1047 tags = RawObject::ClassIdTag::update(cls().id(), tags); 1047 tags = RawObject::ClassIdTag::update(cls().id(), tags);
1048 // tags also has the initial zero hash code on 64 bit.
1048 if (Smi::IsValid(tags)) { 1049 if (Smi::IsValid(tags)) {
1049 const intptr_t tags_kidx = __ AddConstant(Smi::Handle(Smi::New(tags))); 1050 const intptr_t tags_kidx = __ AddConstant(Smi::Handle(Smi::New(tags)));
1050 __ AllocateOpt(locs()->out(0).reg(), tags_kidx); 1051 __ AllocateOpt(locs()->out(0).reg(), tags_kidx);
1051 } 1052 }
1052 } 1053 }
1053 const intptr_t kidx = __ AddConstant(cls()); 1054 const intptr_t kidx = __ AddConstant(cls());
1054 __ Allocate(kidx); 1055 __ Allocate(kidx);
1055 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId, 1056 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId,
1056 token_pos()); 1057 token_pos());
1057 compiler->RecordSafepoint(locs()); 1058 compiler->RecordSafepoint(locs());
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
1649 ASSERT(from_representation() == kUnboxedDouble); 1650 ASSERT(from_representation() == kUnboxedDouble);
1650 const Register value = locs()->in(0).reg(); 1651 const Register value = locs()->in(0).reg();
1651 const Register out = locs()->out(0).reg(); 1652 const Register out = locs()->out(0).reg();
1652 const intptr_t instance_size = compiler->double_class().instance_size(); 1653 const intptr_t instance_size = compiler->double_class().instance_size();
1653 Isolate* isolate = Isolate::Current(); 1654 Isolate* isolate = Isolate::Current();
1654 ASSERT(Heap::IsAllocatableInNewSpace(instance_size)); 1655 ASSERT(Heap::IsAllocatableInNewSpace(instance_size));
1655 if (!compiler->double_class().TraceAllocation(isolate)) { 1656 if (!compiler->double_class().TraceAllocation(isolate)) {
1656 uword tags = 0; 1657 uword tags = 0;
1657 tags = RawObject::SizeTag::update(instance_size, tags); 1658 tags = RawObject::SizeTag::update(instance_size, tags);
1658 tags = RawObject::ClassIdTag::update(compiler->double_class().id(), tags); 1659 tags = RawObject::ClassIdTag::update(compiler->double_class().id(), tags);
1660 // tags also has the initial zero hash code on 64 bit.
1659 if (Smi::IsValid(tags)) { 1661 if (Smi::IsValid(tags)) {
1660 const intptr_t tags_kidx = __ AddConstant(Smi::Handle(Smi::New(tags))); 1662 const intptr_t tags_kidx = __ AddConstant(Smi::Handle(Smi::New(tags)));
1661 __ AllocateOpt(out, tags_kidx); 1663 __ AllocateOpt(out, tags_kidx);
1662 } 1664 }
1663 } 1665 }
1664 const intptr_t kidx = __ AddConstant(compiler->double_class()); 1666 const intptr_t kidx = __ AddConstant(compiler->double_class());
1665 __ Allocate(kidx); 1667 __ Allocate(kidx);
1666 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId, 1668 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId,
1667 token_pos()); 1669 token_pos());
1668 compiler->RecordSafepoint(locs()); 1670 compiler->RecordSafepoint(locs());
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
2063 } 2065 }
2064 __ IfULe(length, index); 2066 __ IfULe(length, index);
2065 compiler->EmitDeopt(deopt_id(), ICData::kDeoptCheckArrayBound, 2067 compiler->EmitDeopt(deopt_id(), ICData::kDeoptCheckArrayBound,
2066 (generalized_ ? ICData::kGeneralized : 0) | 2068 (generalized_ ? ICData::kGeneralized : 0) |
2067 (licm_hoisted_ ? ICData::kHoisted : 0)); 2069 (licm_hoisted_ ? ICData::kHoisted : 0));
2068 } 2070 }
2069 2071
2070 } // namespace dart 2072 } // namespace dart
2071 2073
2072 #endif // defined TARGET_ARCH_DBC 2074 #endif // defined TARGET_ARCH_DBC
OLDNEW
« no previous file with comments | « runtime/vm/heap.cc ('k') | runtime/vm/intrinsifier.cc » ('j') | runtime/vm/intrinsifier.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698