| 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/bigint_operations.h" | 10 #include "vm/bigint_operations.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 namespace dart { | 38 namespace dart { |
| 39 | 39 |
| 40 DEFINE_FLAG(bool, show_internal_names, false, | 40 DEFINE_FLAG(bool, show_internal_names, false, |
| 41 "Show names of internal classes (e.g. \"OneByteString\") in error messages " | 41 "Show names of internal classes (e.g. \"OneByteString\") in error messages " |
| 42 "instead of showing the corresponding interface names (e.g. \"String\")"); | 42 "instead of showing the corresponding interface names (e.g. \"String\")"); |
| 43 DEFINE_FLAG(bool, trace_disabling_optimized_code, false, | 43 DEFINE_FLAG(bool, trace_disabling_optimized_code, false, |
| 44 "Trace disabling optimized code."); | 44 "Trace disabling optimized code."); |
| 45 DEFINE_FLAG(int, huge_method_cutoff_in_tokens, 20000, | 45 DEFINE_FLAG(int, huge_method_cutoff_in_tokens, 20000, |
| 46 "Huge method cutoff in tokens: Disables optimizations for huge methods."); | 46 "Huge method cutoff in tokens: Disables optimizations for huge methods."); |
| 47 DEFINE_FLAG(int, huge_method_cutoff_in_code_size, 50000, | 47 DEFINE_FLAG(int, huge_method_cutoff_in_code_size, 200000, |
| 48 "Huge method cutoff in unoptimized code size (in words)."); | 48 "Huge method cutoff in unoptimized code size (in bytes)."); |
| 49 DECLARE_FLAG(bool, trace_compiler); | 49 DECLARE_FLAG(bool, trace_compiler); |
| 50 DECLARE_FLAG(bool, eliminate_type_checks); | 50 DECLARE_FLAG(bool, eliminate_type_checks); |
| 51 DECLARE_FLAG(bool, enable_type_checks); | 51 DECLARE_FLAG(bool, enable_type_checks); |
| 52 | 52 |
| 53 static const char* kGetterPrefix = "get:"; | 53 static const char* kGetterPrefix = "get:"; |
| 54 static const intptr_t kGetterPrefixLength = strlen(kGetterPrefix); | 54 static const intptr_t kGetterPrefixLength = strlen(kGetterPrefix); |
| 55 static const char* kSetterPrefix = "set:"; | 55 static const char* kSetterPrefix = "set:"; |
| 56 static const intptr_t kSetterPrefixLength = strlen(kSetterPrefix); | 56 static const intptr_t kSetterPrefixLength = strlen(kSetterPrefix); |
| 57 | 57 |
| 58 cpp_vtable Object::handle_vtable_ = 0; | 58 cpp_vtable Object::handle_vtable_ = 0; |
| (...skipping 3614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3673 | 3673 |
| 3674 | 3674 |
| 3675 bool Function::is_optimizable() const { | 3675 bool Function::is_optimizable() const { |
| 3676 if (OptimizableBit::decode(raw_ptr()->kind_tag_) && | 3676 if (OptimizableBit::decode(raw_ptr()->kind_tag_) && |
| 3677 (script() != Script::null()) && | 3677 (script() != Script::null()) && |
| 3678 !is_native() && | 3678 !is_native() && |
| 3679 ((end_token_pos() - token_pos()) < FLAG_huge_method_cutoff_in_tokens)) { | 3679 ((end_token_pos() - token_pos()) < FLAG_huge_method_cutoff_in_tokens)) { |
| 3680 // Additional check needed for implicit getters. | 3680 // Additional check needed for implicit getters. |
| 3681 if (HasCode() && | 3681 if (HasCode() && |
| 3682 (Code::Handle(unoptimized_code()).Size() >= | 3682 (Code::Handle(unoptimized_code()).Size() >= |
| 3683 FLAG_huge_method_cutoff_in_code_size * kWordSize)) { | 3683 FLAG_huge_method_cutoff_in_code_size)) { |
| 3684 return false; | 3684 return false; |
| 3685 } else { | 3685 } else { |
| 3686 return true; | 3686 return true; |
| 3687 } | 3687 } |
| 3688 } | 3688 } |
| 3689 return false; | 3689 return false; |
| 3690 } | 3690 } |
| 3691 | 3691 |
| 3692 | 3692 |
| 3693 void Function::set_is_optimizable(bool value) const { | 3693 void Function::set_is_optimizable(bool value) const { |
| (...skipping 9191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12885 } | 12885 } |
| 12886 return result.raw(); | 12886 return result.raw(); |
| 12887 } | 12887 } |
| 12888 | 12888 |
| 12889 | 12889 |
| 12890 const char* WeakProperty::ToCString() const { | 12890 const char* WeakProperty::ToCString() const { |
| 12891 return "_WeakProperty"; | 12891 return "_WeakProperty"; |
| 12892 } | 12892 } |
| 12893 | 12893 |
| 12894 } // namespace dart | 12894 } // namespace dart |
| OLD | NEW |