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

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
« 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 6275 matching lines...) Expand 10 before | Expand all | Expand 10 after
6286 intptr_t Field::guarded_list_length() const { 6286 intptr_t Field::guarded_list_length() const {
6287 return Smi::Value(raw_ptr()->guarded_list_length_); 6287 return Smi::Value(raw_ptr()->guarded_list_length_);
6288 } 6288 }
6289 6289
6290 6290
6291 void Field::set_guarded_list_length(intptr_t list_length) const { 6291 void Field::set_guarded_list_length(intptr_t list_length) const {
6292 raw_ptr()->guarded_list_length_ = Smi::New(list_length); 6292 raw_ptr()->guarded_list_length_ = Smi::New(list_length);
6293 } 6293 }
6294 6294
6295 6295
6296 bool Field::IsUnboxedField() const {
6297 // TODO(johnmccutchan): Add kFloat32x4Cid here.
6298 return is_unboxing_candidate() && !is_final() && !is_nullable() &&
6299 ((guarded_cid() == kDoubleCid));
6300 }
6301
6302
6303 bool Field::IsPotentialUnboxedField() const {
6304 return is_unboxing_candidate() &&
6305 (IsUnboxedField() || (!is_final() && (guarded_cid() == kIllegalCid)));
6306 }
6307
6308
6296 const char* Field::ToCString() const { 6309 const char* Field::ToCString() const {
6297 if (IsNull()) { 6310 if (IsNull()) {
6298 return "Field::null"; 6311 return "Field::null";
6299 } 6312 }
6300 const char* kF0 = is_static() ? " static" : ""; 6313 const char* kF0 = is_static() ? " static" : "";
6301 const char* kF1 = is_final() ? " final" : ""; 6314 const char* kF1 = is_final() ? " final" : "";
6302 const char* kF2 = is_const() ? " const" : ""; 6315 const char* kF2 = is_const() ? " const" : "";
6303 const char* kFormat = "Field <%s.%s>:%s%s%s"; 6316 const char* kFormat = "Field <%s.%s>:%s%s%s";
6304 const char* field_name = String::Handle(name()).ToCString(); 6317 const char* field_name = String::Handle(name()).ToCString();
6305 const Class& cls = Class::Handle(owner()); 6318 const Class& cls = Class::Handle(owner());
(...skipping 10903 matching lines...) Expand 10 before | Expand all | Expand 10 after
17209 return "_MirrorReference"; 17222 return "_MirrorReference";
17210 } 17223 }
17211 17224
17212 17225
17213 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { 17226 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const {
17214 Instance::PrintToJSONStream(stream, ref); 17227 Instance::PrintToJSONStream(stream, ref);
17215 } 17228 }
17216 17229
17217 17230
17218 } // namespace dart 17231 } // 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