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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 "Throw an exception when the result of an integer calculation will not " | 57 "Throw an exception when the result of an integer calculation will not " |
58 "fit into a javascript integer."); | 58 "fit into a javascript integer."); |
59 DECLARE_FLAG(bool, eliminate_type_checks); | 59 DECLARE_FLAG(bool, eliminate_type_checks); |
60 DECLARE_FLAG(bool, enable_type_checks); | 60 DECLARE_FLAG(bool, enable_type_checks); |
61 DECLARE_FLAG(bool, error_on_bad_override); | 61 DECLARE_FLAG(bool, error_on_bad_override); |
62 DECLARE_FLAG(bool, error_on_bad_type); | 62 DECLARE_FLAG(bool, error_on_bad_type); |
63 DECLARE_FLAG(bool, trace_compiler); | 63 DECLARE_FLAG(bool, trace_compiler); |
64 DECLARE_FLAG(bool, trace_deoptimization); | 64 DECLARE_FLAG(bool, trace_deoptimization); |
65 DECLARE_FLAG(bool, trace_deoptimization_verbose); | 65 DECLARE_FLAG(bool, trace_deoptimization_verbose); |
66 DECLARE_FLAG(bool, verbose_stacktrace); | 66 DECLARE_FLAG(bool, verbose_stacktrace); |
67 DECLARE_FLAG(bool, print_coverage); | 67 DECLARE_FLAG(charp, coverage_dir); |
68 | 68 |
69 static const char* kGetterPrefix = "get:"; | 69 static const char* kGetterPrefix = "get:"; |
70 static const intptr_t kGetterPrefixLength = strlen(kGetterPrefix); | 70 static const intptr_t kGetterPrefixLength = strlen(kGetterPrefix); |
71 static const char* kSetterPrefix = "set:"; | 71 static const char* kSetterPrefix = "set:"; |
72 static const intptr_t kSetterPrefixLength = strlen(kSetterPrefix); | 72 static const intptr_t kSetterPrefixLength = strlen(kSetterPrefix); |
73 | 73 |
74 cpp_vtable Object::handle_vtable_ = 0; | 74 cpp_vtable Object::handle_vtable_ = 0; |
75 cpp_vtable Object::builtin_vtables_[kNumPredefinedCids] = { 0 }; | 75 cpp_vtable Object::builtin_vtables_[kNumPredefinedCids] = { 0 }; |
76 cpp_vtable Smi::handle_vtable_ = 0; | 76 cpp_vtable Smi::handle_vtable_ = 0; |
77 | 77 |
(...skipping 4081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4159 void Function::SetNumOptionalParameters(intptr_t num_optional_parameters, | 4159 void Function::SetNumOptionalParameters(intptr_t num_optional_parameters, |
4160 bool are_optional_positional) const { | 4160 bool are_optional_positional) const { |
4161 ASSERT(num_optional_parameters >= 0); | 4161 ASSERT(num_optional_parameters >= 0); |
4162 set_num_optional_parameters(are_optional_positional ? | 4162 set_num_optional_parameters(are_optional_positional ? |
4163 num_optional_parameters : | 4163 num_optional_parameters : |
4164 -num_optional_parameters); | 4164 -num_optional_parameters); |
4165 } | 4165 } |
4166 | 4166 |
4167 | 4167 |
4168 bool Function::is_optimizable() const { | 4168 bool Function::is_optimizable() const { |
4169 if (FLAG_print_coverage) { | 4169 if (FLAG_coverage_dir != NULL) { |
| 4170 // Do not optimize if collecting coverage data. |
4170 return false; | 4171 return false; |
4171 } | 4172 } |
4172 if (OptimizableBit::decode(raw_ptr()->kind_tag_) && | 4173 if (OptimizableBit::decode(raw_ptr()->kind_tag_) && |
4173 (script() != Script::null()) && | 4174 (script() != Script::null()) && |
4174 ((end_token_pos() - token_pos()) < FLAG_huge_method_cutoff_in_tokens)) { | 4175 ((end_token_pos() - token_pos()) < FLAG_huge_method_cutoff_in_tokens)) { |
4175 // Additional check needed for implicit getters. | 4176 // Additional check needed for implicit getters. |
4176 if (HasCode() && | 4177 if (HasCode() && |
4177 (Code::Handle(unoptimized_code()).Size() >= | 4178 (Code::Handle(unoptimized_code()).Size() >= |
4178 FLAG_huge_method_cutoff_in_code_size)) { | 4179 FLAG_huge_method_cutoff_in_code_size)) { |
4179 return false; | 4180 return false; |
(...skipping 10856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15036 return "_MirrorReference"; | 15037 return "_MirrorReference"; |
15037 } | 15038 } |
15038 | 15039 |
15039 | 15040 |
15040 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { | 15041 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { |
15041 JSONObject jsobj(stream); | 15042 JSONObject jsobj(stream); |
15042 } | 15043 } |
15043 | 15044 |
15044 | 15045 |
15045 } // namespace dart | 15046 } // namespace dart |
OLD | NEW |