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" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 DEFINE_FLAG(bool, show_internal_names, false, | 59 DEFINE_FLAG(bool, show_internal_names, false, |
60 "Show names of internal classes (e.g. \"OneByteString\") in error messages " | 60 "Show names of internal classes (e.g. \"OneByteString\") in error messages " |
61 "instead of showing the corresponding interface names (e.g. \"String\")"); | 61 "instead of showing the corresponding interface names (e.g. \"String\")"); |
62 DEFINE_FLAG(bool, throw_on_javascript_int_overflow, false, | 62 DEFINE_FLAG(bool, throw_on_javascript_int_overflow, false, |
63 "Throw an exception when the result of an integer calculation will not " | 63 "Throw an exception when the result of an integer calculation will not " |
64 "fit into a javascript integer."); | 64 "fit into a javascript integer."); |
65 DEFINE_FLAG(bool, use_field_guards, true, "Guard field cids."); | 65 DEFINE_FLAG(bool, use_field_guards, true, "Guard field cids."); |
66 DEFINE_FLAG(bool, use_lib_cache, true, "Use library name cache"); | 66 DEFINE_FLAG(bool, use_lib_cache, true, "Use library name cache"); |
67 DEFINE_FLAG(bool, trace_field_guards, false, "Trace changes in field's cids."); | 67 DEFINE_FLAG(bool, trace_field_guards, false, "Trace changes in field's cids."); |
68 | 68 |
| 69 DECLARE_FLAG(charp, coverage_dir); |
| 70 DECLARE_FLAG(bool, load_deferred_eagerly); |
| 71 DECLARE_FLAG(bool, show_invisible_frames); |
69 DECLARE_FLAG(bool, trace_compiler); | 72 DECLARE_FLAG(bool, trace_compiler); |
70 DECLARE_FLAG(bool, trace_deoptimization); | 73 DECLARE_FLAG(bool, trace_deoptimization); |
71 DECLARE_FLAG(bool, trace_deoptimization_verbose); | 74 DECLARE_FLAG(bool, trace_deoptimization_verbose); |
72 DECLARE_FLAG(bool, show_invisible_frames); | |
73 DECLARE_FLAG(charp, coverage_dir); | |
74 DECLARE_FLAG(bool, write_protect_code); | 75 DECLARE_FLAG(bool, write_protect_code); |
75 | 76 |
| 77 |
76 static const char* kGetterPrefix = "get:"; | 78 static const char* kGetterPrefix = "get:"; |
77 static const intptr_t kGetterPrefixLength = strlen(kGetterPrefix); | 79 static const intptr_t kGetterPrefixLength = strlen(kGetterPrefix); |
78 static const char* kSetterPrefix = "set:"; | 80 static const char* kSetterPrefix = "set:"; |
79 static const intptr_t kSetterPrefixLength = strlen(kSetterPrefix); | 81 static const intptr_t kSetterPrefixLength = strlen(kSetterPrefix); |
80 | 82 |
81 cpp_vtable Object::handle_vtable_ = 0; | 83 cpp_vtable Object::handle_vtable_ = 0; |
82 cpp_vtable Object::builtin_vtables_[kNumPredefinedCids] = { 0 }; | 84 cpp_vtable Object::builtin_vtables_[kNumPredefinedCids] = { 0 }; |
83 cpp_vtable Smi::handle_vtable_ = 0; | 85 cpp_vtable Smi::handle_vtable_ = 0; |
84 | 86 |
85 // These are initialized to a value that will force a illegal memory access if | 87 // These are initialized to a value that will force a illegal memory access if |
(...skipping 10126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10212 const intptr_t new_length = length + kIncrementSize; | 10214 const intptr_t new_length = length + kIncrementSize; |
10213 imports = Array::Grow(imports, new_length, Heap::kOld); | 10215 imports = Array::Grow(imports, new_length, Heap::kOld); |
10214 set_imports(imports); | 10216 set_imports(imports); |
10215 } | 10217 } |
10216 imports.SetAt(num_current_imports, import); | 10218 imports.SetAt(num_current_imports, import); |
10217 set_num_imports(num_current_imports + 1); | 10219 set_num_imports(num_current_imports + 1); |
10218 } | 10220 } |
10219 | 10221 |
10220 | 10222 |
10221 RawObject* LibraryPrefix::LookupObject(const String& name) const { | 10223 RawObject* LibraryPrefix::LookupObject(const String& name) const { |
10222 if (!is_loaded()) { | 10224 if (!is_loaded() && !FLAG_load_deferred_eagerly) { |
10223 return Object::null(); | 10225 return Object::null(); |
10224 } | 10226 } |
10225 Array& imports = Array::Handle(this->imports()); | 10227 Array& imports = Array::Handle(this->imports()); |
10226 Object& obj = Object::Handle(); | 10228 Object& obj = Object::Handle(); |
10227 Namespace& import = Namespace::Handle(); | 10229 Namespace& import = Namespace::Handle(); |
10228 Library& import_lib = Library::Handle(); | 10230 Library& import_lib = Library::Handle(); |
10229 String& import_lib_url = String::Handle(); | 10231 String& import_lib_url = String::Handle(); |
10230 String& first_import_lib_url = String::Handle(); | 10232 String& first_import_lib_url = String::Handle(); |
10231 Object& found_obj = Object::Handle(); | 10233 Object& found_obj = Object::Handle(); |
10232 for (intptr_t i = 0; i < num_imports(); i++) { | 10234 for (intptr_t i = 0; i < num_imports(); i++) { |
(...skipping 10958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
21191 return tag_label.ToCString(); | 21193 return tag_label.ToCString(); |
21192 } | 21194 } |
21193 | 21195 |
21194 | 21196 |
21195 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 21197 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
21196 Instance::PrintJSONImpl(stream, ref); | 21198 Instance::PrintJSONImpl(stream, ref); |
21197 } | 21199 } |
21198 | 21200 |
21199 | 21201 |
21200 } // namespace dart | 21202 } // namespace dart |
OLD | NEW |