| 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/become.h" | 10 #include "vm/become.h" |
| (...skipping 12552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12563 } | 12563 } |
| 12564 | 12564 |
| 12565 | 12565 |
| 12566 void ICData::AddDeoptReason(DeoptReasonId reason) const { | 12566 void ICData::AddDeoptReason(DeoptReasonId reason) const { |
| 12567 if (reason <= kLastRecordedDeoptReason) { | 12567 if (reason <= kLastRecordedDeoptReason) { |
| 12568 SetDeoptReasons(DeoptReasons() | (1 << reason)); | 12568 SetDeoptReasons(DeoptReasons() | (1 << reason)); |
| 12569 } | 12569 } |
| 12570 } | 12570 } |
| 12571 | 12571 |
| 12572 | 12572 |
| 12573 void ICData::SetIsStaticCall(bool static_call) const { | |
| 12574 StoreNonPointer(&raw_ptr()->state_bits_, | |
| 12575 StaticCallBit::update(static_call, raw_ptr()->state_bits_)); | |
| 12576 } | |
| 12577 | |
| 12578 | |
| 12579 bool ICData::is_static_call() const { | |
| 12580 return StaticCallBit::decode(raw_ptr()->state_bits_); | |
| 12581 } | |
| 12582 | |
| 12583 | |
| 12584 void ICData::set_state_bits(uint32_t bits) const { | 12573 void ICData::set_state_bits(uint32_t bits) const { |
| 12585 StoreNonPointer(&raw_ptr()->state_bits_, bits); | 12574 StoreNonPointer(&raw_ptr()->state_bits_, bits); |
| 12586 } | 12575 } |
| 12587 | 12576 |
| 12588 | 12577 |
| 12589 intptr_t ICData::TestEntryLengthFor(intptr_t num_args) { | 12578 intptr_t ICData::TestEntryLengthFor(intptr_t num_args) { |
| 12590 return num_args + 1 /* target function*/ + 1 /* frequency */; | 12579 return num_args + 1 /* target function*/ + 1 /* frequency */; |
| 12591 } | 12580 } |
| 12592 | 12581 |
| 12593 | 12582 |
| (...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13477 | 13466 |
| 13478 RawICData* ICData::NewFrom(const ICData& from, intptr_t num_args_tested) { | 13467 RawICData* ICData::NewFrom(const ICData& from, intptr_t num_args_tested) { |
| 13479 const ICData& result = ICData::Handle(ICData::New( | 13468 const ICData& result = ICData::Handle(ICData::New( |
| 13480 Function::Handle(from.Owner()), | 13469 Function::Handle(from.Owner()), |
| 13481 String::Handle(from.target_name()), | 13470 String::Handle(from.target_name()), |
| 13482 Array::Handle(from.arguments_descriptor()), | 13471 Array::Handle(from.arguments_descriptor()), |
| 13483 from.deopt_id(), | 13472 from.deopt_id(), |
| 13484 num_args_tested)); | 13473 num_args_tested)); |
| 13485 // Copy deoptimization reasons. | 13474 // Copy deoptimization reasons. |
| 13486 result.SetDeoptReasons(from.DeoptReasons()); | 13475 result.SetDeoptReasons(from.DeoptReasons()); |
| 13487 // Copy whether or not this is a static call. | |
| 13488 result.SetIsStaticCall(from.is_static_call()); | |
| 13489 return result.raw(); | 13476 return result.raw(); |
| 13490 } | 13477 } |
| 13491 | 13478 |
| 13492 | 13479 |
| 13493 RawICData* ICData::Clone(const ICData& from) { | 13480 RawICData* ICData::Clone(const ICData& from) { |
| 13494 Zone* zone = Thread::Current()->zone(); | 13481 Zone* zone = Thread::Current()->zone(); |
| 13495 const ICData& result = ICData::Handle(ICData::NewDescriptor( | 13482 const ICData& result = ICData::Handle(ICData::NewDescriptor( |
| 13496 zone, | 13483 zone, |
| 13497 Function::Handle(zone, from.Owner()), | 13484 Function::Handle(zone, from.Owner()), |
| 13498 String::Handle(zone, from.target_name()), | 13485 String::Handle(zone, from.target_name()), |
| 13499 Array::Handle(zone, from.arguments_descriptor()), | 13486 Array::Handle(zone, from.arguments_descriptor()), |
| 13500 from.deopt_id(), | 13487 from.deopt_id(), |
| 13501 from.NumArgsTested())); | 13488 from.NumArgsTested())); |
| 13502 // Clone entry array. | 13489 // Clone entry array. |
| 13503 const Array& from_array = Array::Handle(zone, from.ic_data()); | 13490 const Array& from_array = Array::Handle(zone, from.ic_data()); |
| 13504 const intptr_t len = from_array.Length(); | 13491 const intptr_t len = from_array.Length(); |
| 13505 const Array& cloned_array = | 13492 const Array& cloned_array = |
| 13506 Array::Handle(zone, Array::New(len, Heap::kOld)); | 13493 Array::Handle(zone, Array::New(len, Heap::kOld)); |
| 13507 Object& obj = Object::Handle(zone); | 13494 Object& obj = Object::Handle(zone); |
| 13508 for (intptr_t i = 0; i < len; i++) { | 13495 for (intptr_t i = 0; i < len; i++) { |
| 13509 obj = from_array.At(i); | 13496 obj = from_array.At(i); |
| 13510 cloned_array.SetAt(i, obj); | 13497 cloned_array.SetAt(i, obj); |
| 13511 } | 13498 } |
| 13512 result.SetIsStaticCall(from.is_static_call()); | |
| 13513 result.set_ic_data_array(cloned_array); | 13499 result.set_ic_data_array(cloned_array); |
| 13514 // Copy deoptimization reasons. | 13500 // Copy deoptimization reasons. |
| 13515 result.SetDeoptReasons(from.DeoptReasons()); | 13501 result.SetDeoptReasons(from.DeoptReasons()); |
| 13516 return result.raw(); | 13502 return result.raw(); |
| 13517 } | 13503 } |
| 13518 | 13504 |
| 13519 | 13505 |
| 13520 static Token::Kind RecognizeArithmeticOp(const String& name) { | 13506 static Token::Kind RecognizeArithmeticOp(const String& name) { |
| 13521 ASSERT(name.IsSymbol()); | 13507 ASSERT(name.IsSymbol()); |
| 13522 if (name.raw() == Symbols::Plus().raw()) { | 13508 if (name.raw() == Symbols::Plus().raw()) { |
| (...skipping 9140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 22663 return UserTag::null(); | 22649 return UserTag::null(); |
| 22664 } | 22650 } |
| 22665 | 22651 |
| 22666 | 22652 |
| 22667 const char* UserTag::ToCString() const { | 22653 const char* UserTag::ToCString() const { |
| 22668 const String& tag_label = String::Handle(label()); | 22654 const String& tag_label = String::Handle(label()); |
| 22669 return tag_label.ToCString(); | 22655 return tag_label.ToCString(); |
| 22670 } | 22656 } |
| 22671 | 22657 |
| 22672 } // namespace dart | 22658 } // namespace dart |
| OLD | NEW |