| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 "instead of showing the corresponding interface names (e.g. \"String\")"); | 46 "instead of showing the corresponding interface names (e.g. \"String\")"); |
| 47 DEFINE_FLAG(bool, trace_disabling_optimized_code, false, | 47 DEFINE_FLAG(bool, trace_disabling_optimized_code, false, |
| 48 "Trace disabling optimized code."); | 48 "Trace disabling optimized code."); |
| 49 DEFINE_FLAG(int, huge_method_cutoff_in_tokens, 20000, | 49 DEFINE_FLAG(int, huge_method_cutoff_in_tokens, 20000, |
| 50 "Huge method cutoff in tokens: Disables optimizations for huge methods."); | 50 "Huge method cutoff in tokens: Disables optimizations for huge methods."); |
| 51 DEFINE_FLAG(int, huge_method_cutoff_in_code_size, 200000, | 51 DEFINE_FLAG(int, huge_method_cutoff_in_code_size, 200000, |
| 52 "Huge method cutoff in unoptimized code size (in bytes)."); | 52 "Huge method cutoff in unoptimized code size (in bytes)."); |
| 53 DECLARE_FLAG(bool, trace_compiler); | 53 DECLARE_FLAG(bool, trace_compiler); |
| 54 DECLARE_FLAG(bool, eliminate_type_checks); | 54 DECLARE_FLAG(bool, eliminate_type_checks); |
| 55 DECLARE_FLAG(bool, enable_type_checks); | 55 DECLARE_FLAG(bool, enable_type_checks); |
| 56 DECLARE_FLAG(int, deoptimization_counter_threshold); |
| 56 | 57 |
| 57 static const char* kGetterPrefix = "get:"; | 58 static const char* kGetterPrefix = "get:"; |
| 58 static const intptr_t kGetterPrefixLength = strlen(kGetterPrefix); | 59 static const intptr_t kGetterPrefixLength = strlen(kGetterPrefix); |
| 59 static const char* kSetterPrefix = "set:"; | 60 static const char* kSetterPrefix = "set:"; |
| 60 static const intptr_t kSetterPrefixLength = strlen(kSetterPrefix); | 61 static const intptr_t kSetterPrefixLength = strlen(kSetterPrefix); |
| 61 | 62 |
| 62 cpp_vtable Object::handle_vtable_ = 0; | 63 cpp_vtable Object::handle_vtable_ = 0; |
| 63 cpp_vtable Object::builtin_vtables_[kNumPredefinedCids] = { 0 }; | 64 cpp_vtable Object::builtin_vtables_[kNumPredefinedCids] = { 0 }; |
| 64 cpp_vtable Smi::handle_vtable_ = 0; | 65 cpp_vtable Smi::handle_vtable_ = 0; |
| 65 | 66 |
| (...skipping 3345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3411 void Function::set_unoptimized_code(const Code& value) const { | 3412 void Function::set_unoptimized_code(const Code& value) const { |
| 3412 StorePointer(&raw_ptr()->unoptimized_code_, value.raw()); | 3413 StorePointer(&raw_ptr()->unoptimized_code_, value.raw()); |
| 3413 } | 3414 } |
| 3414 | 3415 |
| 3415 | 3416 |
| 3416 void Function::set_deopt_history(const Array& value) const { | 3417 void Function::set_deopt_history(const Array& value) const { |
| 3417 StorePointer(&raw_ptr()->deopt_history_, value.raw()); | 3418 StorePointer(&raw_ptr()->deopt_history_, value.raw()); |
| 3418 } | 3419 } |
| 3419 | 3420 |
| 3420 | 3421 |
| 3422 void Function::EnsureDeoptHistory() const { |
| 3423 Array& array = Array::Handle(deopt_history()); |
| 3424 if (array.IsNull()) { |
| 3425 array = Array::New(FLAG_deoptimization_counter_threshold); |
| 3426 set_deopt_history(array); |
| 3427 } |
| 3428 } |
| 3429 |
| 3430 |
| 3421 RawContextScope* Function::context_scope() const { | 3431 RawContextScope* Function::context_scope() const { |
| 3422 if (IsClosureFunction()) { | 3432 if (IsClosureFunction()) { |
| 3423 const Object& obj = Object::Handle(raw_ptr()->data_); | 3433 const Object& obj = Object::Handle(raw_ptr()->data_); |
| 3424 ASSERT(!obj.IsNull()); | 3434 ASSERT(!obj.IsNull()); |
| 3425 return ClosureData::Cast(obj).context_scope(); | 3435 return ClosureData::Cast(obj).context_scope(); |
| 3426 } | 3436 } |
| 3427 return ContextScope::null(); | 3437 return ContextScope::null(); |
| 3428 } | 3438 } |
| 3429 | 3439 |
| 3430 | 3440 |
| (...skipping 9899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13330 } | 13340 } |
| 13331 return result.raw(); | 13341 return result.raw(); |
| 13332 } | 13342 } |
| 13333 | 13343 |
| 13334 | 13344 |
| 13335 const char* WeakProperty::ToCString() const { | 13345 const char* WeakProperty::ToCString() const { |
| 13336 return "_WeakProperty"; | 13346 return "_WeakProperty"; |
| 13337 } | 13347 } |
| 13338 | 13348 |
| 13339 } // namespace dart | 13349 } // namespace dart |
| OLD | NEW |