OLD | NEW |
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" |
11 #include "vm/bit_vector.h" | 11 #include "vm/bit_vector.h" |
12 #include "vm/bootstrap.h" | 12 #include "vm/bootstrap.h" |
13 #include "vm/class_finalizer.h" | 13 #include "vm/class_finalizer.h" |
14 #include "vm/code_generator.h" | |
15 #include "vm/code_observers.h" | 14 #include "vm/code_observers.h" |
16 #include "vm/code_patcher.h" | |
17 #include "vm/compiler.h" | 15 #include "vm/compiler.h" |
18 #include "vm/compiler_stats.h" | 16 #include "vm/compiler_stats.h" |
19 #include "vm/dart.h" | 17 #include "vm/dart.h" |
20 #include "vm/dart_api_state.h" | 18 #include "vm/dart_api_state.h" |
21 #include "vm/dart_entry.h" | 19 #include "vm/dart_entry.h" |
22 #include "vm/datastream.h" | 20 #include "vm/datastream.h" |
23 #include "vm/debugger.h" | 21 #include "vm/debugger.h" |
24 #include "vm/deopt_instructions.h" | 22 #include "vm/deopt_instructions.h" |
25 #include "vm/disassembler.h" | 23 #include "vm/disassembler.h" |
26 #include "vm/double_conversion.h" | 24 #include "vm/double_conversion.h" |
27 #include "vm/exceptions.h" | 25 #include "vm/exceptions.h" |
28 #include "vm/flow_graph_builder.h" | |
29 #include "vm/flow_graph_compiler.h" | |
30 #include "vm/growable_array.h" | 26 #include "vm/growable_array.h" |
31 #include "vm/hash_table.h" | 27 #include "vm/hash_table.h" |
32 #include "vm/heap.h" | 28 #include "vm/heap.h" |
33 #include "vm/intermediate_language.h" | |
34 #include "vm/intrinsifier.h" | 29 #include "vm/intrinsifier.h" |
35 #include "vm/object_store.h" | 30 #include "vm/object_store.h" |
36 #include "vm/parser.h" | 31 #include "vm/parser.h" |
37 #include "vm/profiler.h" | 32 #include "vm/profiler.h" |
38 #include "vm/report.h" | 33 #include "vm/report.h" |
39 #include "vm/reusable_handles.h" | 34 #include "vm/reusable_handles.h" |
40 #include "vm/runtime_entry.h" | 35 #include "vm/runtime_entry.h" |
41 #include "vm/scopes.h" | 36 #include "vm/scopes.h" |
42 #include "vm/stack_frame.h" | 37 #include "vm/stack_frame.h" |
43 #include "vm/symbols.h" | 38 #include "vm/symbols.h" |
(...skipping 7531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7575 | 7570 |
7576 | 7571 |
7577 void Field::set_guarded_list_length_in_object_offset( | 7572 void Field::set_guarded_list_length_in_object_offset( |
7578 intptr_t list_length_offset) const { | 7573 intptr_t list_length_offset) const { |
7579 StoreNonPointer(&raw_ptr()->guarded_list_length_in_object_offset_, | 7574 StoreNonPointer(&raw_ptr()->guarded_list_length_in_object_offset_, |
7580 static_cast<int8_t>(list_length_offset - kHeapObjectTag)); | 7575 static_cast<int8_t>(list_length_offset - kHeapObjectTag)); |
7581 ASSERT(guarded_list_length_in_object_offset() == list_length_offset); | 7576 ASSERT(guarded_list_length_in_object_offset() == list_length_offset); |
7582 } | 7577 } |
7583 | 7578 |
7584 | 7579 |
7585 bool Field::IsUnboxedField() const { | |
7586 bool valid_class = (FlowGraphCompiler::SupportsUnboxedDoubles() && | |
7587 (guarded_cid() == kDoubleCid)) || | |
7588 (FlowGraphCompiler::SupportsUnboxedSimd128() && | |
7589 (guarded_cid() == kFloat32x4Cid)) || | |
7590 (FlowGraphCompiler::SupportsUnboxedSimd128() && | |
7591 (guarded_cid() == kFloat64x2Cid)); | |
7592 return is_unboxing_candidate() && !is_final() && !is_nullable() && | |
7593 valid_class; | |
7594 } | |
7595 | |
7596 | |
7597 bool Field::IsPotentialUnboxedField() const { | |
7598 return is_unboxing_candidate() && | |
7599 (IsUnboxedField() || (!is_final() && (guarded_cid() == kIllegalCid))); | |
7600 } | |
7601 | |
7602 | |
7603 const char* Field::ToCString() const { | 7580 const char* Field::ToCString() const { |
7604 if (IsNull()) { | 7581 if (IsNull()) { |
7605 return "Field::null"; | 7582 return "Field::null"; |
7606 } | 7583 } |
7607 const char* kF0 = is_static() ? " static" : ""; | 7584 const char* kF0 = is_static() ? " static" : ""; |
7608 const char* kF1 = is_final() ? " final" : ""; | 7585 const char* kF1 = is_final() ? " final" : ""; |
7609 const char* kF2 = is_const() ? " const" : ""; | 7586 const char* kF2 = is_const() ? " const" : ""; |
7610 const char* field_name = String::Handle(name()).ToCString(); | 7587 const char* field_name = String::Handle(name()).ToCString(); |
7611 const Class& cls = Class::Handle(owner()); | 7588 const Class& cls = Class::Handle(owner()); |
7612 const char* cls_name = String::Handle(cls.Name()).ToCString(); | 7589 const char* cls_name = String::Handle(cls.Name()).ToCString(); |
(...skipping 14333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
21946 return tag_label.ToCString(); | 21923 return tag_label.ToCString(); |
21947 } | 21924 } |
21948 | 21925 |
21949 | 21926 |
21950 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 21927 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
21951 Instance::PrintJSONImpl(stream, ref); | 21928 Instance::PrintJSONImpl(stream, ref); |
21952 } | 21929 } |
21953 | 21930 |
21954 | 21931 |
21955 } // namespace dart | 21932 } // namespace dart |
OLD | NEW |