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 11319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11330 } | 11330 } |
11331 return; | 11331 return; |
11332 } | 11332 } |
11333 // Only check ids for unoptimized code that is optimizable. | 11333 // Only check ids for unoptimized code that is optimizable. |
11334 if (!function.IsOptimizable()) { | 11334 if (!function.IsOptimizable()) { |
11335 return; | 11335 return; |
11336 } | 11336 } |
11337 Iterator iter(*this, RawPcDescriptors::kDeopt | RawPcDescriptors::kIcCall); | 11337 Iterator iter(*this, RawPcDescriptors::kDeopt | RawPcDescriptors::kIcCall); |
11338 while (iter.MoveNext()) { | 11338 while (iter.MoveNext()) { |
11339 // 'deopt_id' is set for kDeopt and kIcCall and must be unique for one kind. | 11339 // 'deopt_id' is set for kDeopt and kIcCall and must be unique for one kind. |
11340 if (Isolate::IsDeoptAfter(iter.DeoptId())) { | 11340 if (Thread::IsDeoptAfter(iter.DeoptId())) { |
11341 // TODO(vegorov): some instructions contain multiple calls and have | 11341 // TODO(vegorov): some instructions contain multiple calls and have |
11342 // multiple "after" targets recorded. Right now it is benign but might | 11342 // multiple "after" targets recorded. Right now it is benign but might |
11343 // lead to issues in the future. Fix that and enable verification. | 11343 // lead to issues in the future. Fix that and enable verification. |
11344 continue; | 11344 continue; |
11345 } | 11345 } |
11346 | 11346 |
11347 Iterator nested(iter); | 11347 Iterator nested(iter); |
11348 while (nested.MoveNext()) { | 11348 while (nested.MoveNext()) { |
11349 if (iter.Kind() == nested.Kind()) { | 11349 if (iter.Kind() == nested.Kind()) { |
11350 ASSERT(nested.DeoptId() != iter.DeoptId()); | 11350 ASSERT(nested.DeoptId() != iter.DeoptId()); |
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12494 RawICData* ICData::New() { | 12494 RawICData* ICData::New() { |
12495 ICData& result = ICData::Handle(); | 12495 ICData& result = ICData::Handle(); |
12496 { | 12496 { |
12497 // IC data objects are long living objects, allocate them in old generation. | 12497 // IC data objects are long living objects, allocate them in old generation. |
12498 RawObject* raw = Object::Allocate(ICData::kClassId, | 12498 RawObject* raw = Object::Allocate(ICData::kClassId, |
12499 ICData::InstanceSize(), | 12499 ICData::InstanceSize(), |
12500 Heap::kOld); | 12500 Heap::kOld); |
12501 NoSafepointScope no_safepoint; | 12501 NoSafepointScope no_safepoint; |
12502 result ^= raw; | 12502 result ^= raw; |
12503 } | 12503 } |
12504 result.set_deopt_id(Isolate::kNoDeoptId); | 12504 result.set_deopt_id(Thread::kNoDeoptId); |
12505 result.set_state_bits(0); | 12505 result.set_state_bits(0); |
12506 return result.raw(); | 12506 return result.raw(); |
12507 } | 12507 } |
12508 | 12508 |
12509 | 12509 |
12510 RawICData* ICData::New(const Function& owner, | 12510 RawICData* ICData::New(const Function& owner, |
12511 const String& target_name, | 12511 const String& target_name, |
12512 const Array& arguments_descriptor, | 12512 const Array& arguments_descriptor, |
12513 intptr_t deopt_id, | 12513 intptr_t deopt_id, |
12514 intptr_t num_args_tested) { | 12514 intptr_t num_args_tested) { |
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13249 | 13249 |
13250 intptr_t Code::GetDeoptIdForOsr(uword pc) const { | 13250 intptr_t Code::GetDeoptIdForOsr(uword pc) const { |
13251 uword pc_offset = pc - EntryPoint(); | 13251 uword pc_offset = pc - EntryPoint(); |
13252 const PcDescriptors& descriptors = PcDescriptors::Handle(pc_descriptors()); | 13252 const PcDescriptors& descriptors = PcDescriptors::Handle(pc_descriptors()); |
13253 PcDescriptors::Iterator iter(descriptors, RawPcDescriptors::kOsrEntry); | 13253 PcDescriptors::Iterator iter(descriptors, RawPcDescriptors::kOsrEntry); |
13254 while (iter.MoveNext()) { | 13254 while (iter.MoveNext()) { |
13255 if (iter.PcOffset() == pc_offset) { | 13255 if (iter.PcOffset() == pc_offset) { |
13256 return iter.DeoptId(); | 13256 return iter.DeoptId(); |
13257 } | 13257 } |
13258 } | 13258 } |
13259 return Isolate::kNoDeoptId; | 13259 return Thread::kNoDeoptId; |
13260 } | 13260 } |
13261 | 13261 |
13262 | 13262 |
13263 const char* Code::ToCString() const { | 13263 const char* Code::ToCString() const { |
13264 Zone* zone = Thread::Current()->zone(); | 13264 Zone* zone = Thread::Current()->zone(); |
13265 if (IsStubCode()) { | 13265 if (IsStubCode()) { |
13266 const char* name = StubCode::NameOfStub(EntryPoint()); | 13266 const char* name = StubCode::NameOfStub(EntryPoint()); |
13267 return zone->PrintToString("[stub: %s]", name); | 13267 return zone->PrintToString("[stub: %s]", name); |
13268 } else { | 13268 } else { |
13269 return zone->PrintToString("Code entry:%" Px, EntryPoint()); | 13269 return zone->PrintToString("Code entry:%" Px, EntryPoint()); |
(...skipping 8296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
21566 return tag_label.ToCString(); | 21566 return tag_label.ToCString(); |
21567 } | 21567 } |
21568 | 21568 |
21569 | 21569 |
21570 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 21570 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
21571 Instance::PrintJSONImpl(stream, ref); | 21571 Instance::PrintJSONImpl(stream, ref); |
21572 } | 21572 } |
21573 | 21573 |
21574 | 21574 |
21575 } // namespace dart | 21575 } // namespace dart |
OLD | NEW |