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

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

Issue 136753012: Refactor unboxed fields in preparation of reusable SIMD boxes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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
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 6260 matching lines...) Expand 10 before | Expand all | Expand 10 after
6271 intptr_t Field::guarded_list_length() const { 6271 intptr_t Field::guarded_list_length() const {
6272 return Smi::Value(raw_ptr()->guarded_list_length_); 6272 return Smi::Value(raw_ptr()->guarded_list_length_);
6273 } 6273 }
6274 6274
6275 6275
6276 void Field::set_guarded_list_length(intptr_t list_length) const { 6276 void Field::set_guarded_list_length(intptr_t list_length) const {
6277 raw_ptr()->guarded_list_length_ = Smi::New(list_length); 6277 raw_ptr()->guarded_list_length_ = Smi::New(list_length);
6278 } 6278 }
6279 6279
6280 6280
6281 bool Field::IsUnboxedField() const {
6282 // TODO(johnmccutchan): Add kFloat32x4Cid here.
6283 return is_unboxing_candidate() && !is_final() && !is_nullable() &&
6284 ((guarded_cid() == kDoubleCid));
6285 }
6286
6287
6288 bool Field::IsPotentialUnboxedField() const {
6289 return is_unboxing_candidate() &&
6290 (IsUnboxedField() || (!is_final() && (guarded_cid() == kIllegalCid)));
6291 }
6292
6293
6281 const char* Field::ToCString() const { 6294 const char* Field::ToCString() const {
6282 if (IsNull()) { 6295 if (IsNull()) {
6283 return "Field::null"; 6296 return "Field::null";
6284 } 6297 }
6285 const char* kF0 = is_static() ? " static" : ""; 6298 const char* kF0 = is_static() ? " static" : "";
6286 const char* kF1 = is_final() ? " final" : ""; 6299 const char* kF1 = is_final() ? " final" : "";
6287 const char* kF2 = is_const() ? " const" : ""; 6300 const char* kF2 = is_const() ? " const" : "";
6288 const char* kFormat = "Field <%s.%s>:%s%s%s"; 6301 const char* kFormat = "Field <%s.%s>:%s%s%s";
6289 const char* field_name = String::Handle(name()).ToCString(); 6302 const char* field_name = String::Handle(name()).ToCString();
6290 const Class& cls = Class::Handle(owner()); 6303 const Class& cls = Class::Handle(owner());
(...skipping 10822 matching lines...) Expand 10 before | Expand all | Expand 10 after
17113 return "_MirrorReference"; 17126 return "_MirrorReference";
17114 } 17127 }
17115 17128
17116 17129
17117 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { 17130 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const {
17118 Instance::PrintToJSONStream(stream, ref); 17131 Instance::PrintToJSONStream(stream, ref);
17119 } 17132 }
17120 17133
17121 17134
17122 } // namespace dart 17135 } // namespace dart
OLDNEW
« runtime/vm/intermediate_language_ia32.cc ('K') | « runtime/vm/object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698