| 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 7408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7419 void ICData::set_num_args_tested(intptr_t value) const { | 7419 void ICData::set_num_args_tested(intptr_t value) const { |
| 7420 raw_ptr()->num_args_tested_ = value; | 7420 raw_ptr()->num_args_tested_ = value; |
| 7421 } | 7421 } |
| 7422 | 7422 |
| 7423 | 7423 |
| 7424 void ICData::set_ic_data(const Array& value) const { | 7424 void ICData::set_ic_data(const Array& value) const { |
| 7425 StorePointer(&raw_ptr()->ic_data_, value.raw()); | 7425 StorePointer(&raw_ptr()->ic_data_, value.raw()); |
| 7426 } | 7426 } |
| 7427 | 7427 |
| 7428 | 7428 |
| 7429 void ICData::set_deopt_reason(intptr_t deopt_reason) const { |
| 7430 raw_ptr()->deopt_reason_ = deopt_reason; |
| 7431 } |
| 7432 |
| 7433 |
| 7429 intptr_t ICData::TestEntryLength() const { | 7434 intptr_t ICData::TestEntryLength() const { |
| 7430 return num_args_tested() + 1 /* target function*/; | 7435 return num_args_tested() + 1 /* target function*/; |
| 7431 } | 7436 } |
| 7432 | 7437 |
| 7433 | 7438 |
| 7434 intptr_t ICData::NumberOfChecks() const { | 7439 intptr_t ICData::NumberOfChecks() const { |
| 7435 // Do not count the sentinel; | 7440 // Do not count the sentinel; |
| 7436 return (Array::Handle(ic_data()).Length() / TestEntryLength()) - 1; | 7441 return (Array::Handle(ic_data()).Length() / TestEntryLength()) - 1; |
| 7437 } | 7442 } |
| 7438 | 7443 |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7693 RawObject* raw = Object::Allocate(ICData::kClassId, | 7698 RawObject* raw = Object::Allocate(ICData::kClassId, |
| 7694 ICData::InstanceSize(), | 7699 ICData::InstanceSize(), |
| 7695 Heap::kOld); | 7700 Heap::kOld); |
| 7696 NoGCScope no_gc; | 7701 NoGCScope no_gc; |
| 7697 result ^= raw; | 7702 result ^= raw; |
| 7698 } | 7703 } |
| 7699 result.set_function(function); | 7704 result.set_function(function); |
| 7700 result.set_target_name(target_name); | 7705 result.set_target_name(target_name); |
| 7701 result.set_deopt_id(deopt_id); | 7706 result.set_deopt_id(deopt_id); |
| 7702 result.set_num_args_tested(num_args_tested); | 7707 result.set_num_args_tested(num_args_tested); |
| 7708 result.set_deopt_reason(kDeoptUnknown); |
| 7703 // Number of array elements in one test entry (num_args_tested + 1) | 7709 // Number of array elements in one test entry (num_args_tested + 1) |
| 7704 intptr_t len = result.TestEntryLength(); | 7710 intptr_t len = result.TestEntryLength(); |
| 7705 // IC data array must be null terminated (sentinel entry). | 7711 // IC data array must be null terminated (sentinel entry). |
| 7706 const Array& ic_data = Array::Handle(Array::New(len, Heap::kOld)); | 7712 const Array& ic_data = Array::Handle(Array::New(len, Heap::kOld)); |
| 7707 result.set_ic_data(ic_data); | 7713 result.set_ic_data(ic_data); |
| 7708 result.WriteSentinel(); | 7714 result.WriteSentinel(); |
| 7709 return result.raw(); | 7715 return result.raw(); |
| 7710 } | 7716 } |
| 7711 | 7717 |
| 7712 | 7718 |
| (...skipping 4238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11951 } | 11957 } |
| 11952 return result.raw(); | 11958 return result.raw(); |
| 11953 } | 11959 } |
| 11954 | 11960 |
| 11955 | 11961 |
| 11956 const char* WeakProperty::ToCString() const { | 11962 const char* WeakProperty::ToCString() const { |
| 11957 return "_WeakProperty"; | 11963 return "_WeakProperty"; |
| 11958 } | 11964 } |
| 11959 | 11965 |
| 11960 } // namespace dart | 11966 } // namespace dart |
| OLD | NEW |