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

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

Issue 2962543002: Revert "VM: Reland Inline instance object hash code into object header on 64bit." (Closed)
Patch Set: 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
« no previous file with comments | « runtime/vm/heap.cc ('k') | runtime/vm/intrinsifier_arm64.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) 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 uint32_t tags = 0; 1014 uword 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.
1049 if (Smi::IsValid(tags)) { 1048 if (Smi::IsValid(tags)) {
1050 const intptr_t tags_kidx = __ AddConstant(Smi::Handle(Smi::New(tags))); 1049 const intptr_t tags_kidx = __ AddConstant(Smi::Handle(Smi::New(tags)));
1051 __ AllocateOpt(locs()->out(0).reg(), tags_kidx); 1050 __ AllocateOpt(locs()->out(0).reg(), tags_kidx);
1052 } 1051 }
1053 } 1052 }
1054 const intptr_t kidx = __ AddConstant(cls()); 1053 const intptr_t kidx = __ AddConstant(cls());
1055 __ Allocate(kidx); 1054 __ Allocate(kidx);
1056 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId, 1055 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId,
1057 token_pos()); 1056 token_pos());
1058 compiler->RecordSafepoint(locs()); 1057 compiler->RecordSafepoint(locs());
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
1650 ASSERT(from_representation() == kUnboxedDouble); 1649 ASSERT(from_representation() == kUnboxedDouble);
1651 const Register value = locs()->in(0).reg(); 1650 const Register value = locs()->in(0).reg();
1652 const Register out = locs()->out(0).reg(); 1651 const Register out = locs()->out(0).reg();
1653 const intptr_t instance_size = compiler->double_class().instance_size(); 1652 const intptr_t instance_size = compiler->double_class().instance_size();
1654 Isolate* isolate = Isolate::Current(); 1653 Isolate* isolate = Isolate::Current();
1655 ASSERT(Heap::IsAllocatableInNewSpace(instance_size)); 1654 ASSERT(Heap::IsAllocatableInNewSpace(instance_size));
1656 if (!compiler->double_class().TraceAllocation(isolate)) { 1655 if (!compiler->double_class().TraceAllocation(isolate)) {
1657 uword tags = 0; 1656 uword tags = 0;
1658 tags = RawObject::SizeTag::update(instance_size, tags); 1657 tags = RawObject::SizeTag::update(instance_size, tags);
1659 tags = RawObject::ClassIdTag::update(compiler->double_class().id(), tags); 1658 tags = RawObject::ClassIdTag::update(compiler->double_class().id(), tags);
1660 // tags also has the initial zero hash code on 64 bit.
1661 if (Smi::IsValid(tags)) { 1659 if (Smi::IsValid(tags)) {
1662 const intptr_t tags_kidx = __ AddConstant(Smi::Handle(Smi::New(tags))); 1660 const intptr_t tags_kidx = __ AddConstant(Smi::Handle(Smi::New(tags)));
1663 __ AllocateOpt(out, tags_kidx); 1661 __ AllocateOpt(out, tags_kidx);
1664 } 1662 }
1665 } 1663 }
1666 const intptr_t kidx = __ AddConstant(compiler->double_class()); 1664 const intptr_t kidx = __ AddConstant(compiler->double_class());
1667 __ Allocate(kidx); 1665 __ Allocate(kidx);
1668 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId, 1666 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId,
1669 token_pos()); 1667 token_pos());
1670 compiler->RecordSafepoint(locs()); 1668 compiler->RecordSafepoint(locs());
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
2065 } 2063 }
2066 __ IfULe(length, index); 2064 __ IfULe(length, index);
2067 compiler->EmitDeopt(deopt_id(), ICData::kDeoptCheckArrayBound, 2065 compiler->EmitDeopt(deopt_id(), ICData::kDeoptCheckArrayBound,
2068 (generalized_ ? ICData::kGeneralized : 0) | 2066 (generalized_ ? ICData::kGeneralized : 0) |
2069 (licm_hoisted_ ? ICData::kHoisted : 0)); 2067 (licm_hoisted_ ? ICData::kHoisted : 0));
2070 } 2068 }
2071 2069
2072 } // namespace dart 2070 } // namespace dart
2073 2071
2074 #endif // defined TARGET_ARCH_DBC 2072 #endif // defined TARGET_ARCH_DBC
OLDNEW
« no previous file with comments | « runtime/vm/heap.cc ('k') | runtime/vm/intrinsifier_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698