| 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 14211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14222 { | 14222 { |
| 14223 uword size = Code::InstanceSize(pointer_offsets_length); | 14223 uword size = Code::InstanceSize(pointer_offsets_length); |
| 14224 RawObject* raw = Object::Allocate(Code::kClassId, size, Heap::kOld); | 14224 RawObject* raw = Object::Allocate(Code::kClassId, size, Heap::kOld); |
| 14225 NoSafepointScope no_safepoint; | 14225 NoSafepointScope no_safepoint; |
| 14226 result ^= raw; | 14226 result ^= raw; |
| 14227 result.set_pointer_offsets_length(pointer_offsets_length); | 14227 result.set_pointer_offsets_length(pointer_offsets_length); |
| 14228 result.set_is_optimized(false); | 14228 result.set_is_optimized(false); |
| 14229 result.set_is_alive(false); | 14229 result.set_is_alive(false); |
| 14230 result.set_comments(Comments::New(0)); | 14230 result.set_comments(Comments::New(0)); |
| 14231 result.set_compile_timestamp(0); | 14231 result.set_compile_timestamp(0); |
| 14232 result.set_lazy_deopt_return_pc_offset(kInvalidPc); | |
| 14233 result.set_lazy_deopt_throw_pc_offset(kInvalidPc); | |
| 14234 result.set_pc_descriptors(Object::empty_descriptors()); | 14232 result.set_pc_descriptors(Object::empty_descriptors()); |
| 14235 } | 14233 } |
| 14236 return result.raw(); | 14234 return result.raw(); |
| 14237 } | 14235 } |
| 14238 | 14236 |
| 14239 | 14237 |
| 14240 RawCode* Code::FinalizeCode(const char* name, | 14238 RawCode* Code::FinalizeCode(const char* name, |
| 14241 Assembler* assembler, | 14239 Assembler* assembler, |
| 14242 bool optimized) { | 14240 bool optimized) { |
| 14243 Isolate* isolate = Isolate::Current(); | 14241 Isolate* isolate = Isolate::Current(); |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14537 // store buffer update is not needed here. | 14535 // store buffer update is not needed here. |
| 14538 StorePointer(&raw_ptr()->active_instructions_, instructions); | 14536 StorePointer(&raw_ptr()->active_instructions_, instructions); |
| 14539 StoreNonPointer(&raw_ptr()->entry_point_, | 14537 StoreNonPointer(&raw_ptr()->entry_point_, |
| 14540 Instructions::UncheckedEntryPoint(instructions)); | 14538 Instructions::UncheckedEntryPoint(instructions)); |
| 14541 StoreNonPointer(&raw_ptr()->checked_entry_point_, | 14539 StoreNonPointer(&raw_ptr()->checked_entry_point_, |
| 14542 Instructions::CheckedEntryPoint(instructions)); | 14540 Instructions::CheckedEntryPoint(instructions)); |
| 14543 #endif | 14541 #endif |
| 14544 } | 14542 } |
| 14545 | 14543 |
| 14546 | 14544 |
| 14547 uword Code::GetLazyDeoptReturnPc() const { | |
| 14548 return (lazy_deopt_return_pc_offset() != kInvalidPc) | |
| 14549 ? PayloadStart() + lazy_deopt_return_pc_offset() : 0; | |
| 14550 } | |
| 14551 | |
| 14552 | |
| 14553 uword Code::GetLazyDeoptThrowPc() const { | |
| 14554 return (lazy_deopt_throw_pc_offset() != kInvalidPc) | |
| 14555 ? PayloadStart() + lazy_deopt_throw_pc_offset() : 0; | |
| 14556 } | |
| 14557 | |
| 14558 | |
| 14559 RawStackmap* Code::GetStackmap( | 14545 RawStackmap* Code::GetStackmap( |
| 14560 uint32_t pc_offset, Array* maps, Stackmap* map) const { | 14546 uint32_t pc_offset, Array* maps, Stackmap* map) const { |
| 14561 // This code is used during iterating frames during a GC and hence it | 14547 // This code is used during iterating frames during a GC and hence it |
| 14562 // should not in turn start a GC. | 14548 // should not in turn start a GC. |
| 14563 NoSafepointScope no_safepoint; | 14549 NoSafepointScope no_safepoint; |
| 14564 if (stackmaps() == Array::null()) { | 14550 if (stackmaps() == Array::null()) { |
| 14565 // No stack maps are present in the code object which means this | 14551 // No stack maps are present in the code object which means this |
| 14566 // frame relies on tagged pointers. | 14552 // frame relies on tagged pointers. |
| 14567 return Stackmap::null(); | 14553 return Stackmap::null(); |
| 14568 } | 14554 } |
| (...skipping 8448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 23017 return UserTag::null(); | 23003 return UserTag::null(); |
| 23018 } | 23004 } |
| 23019 | 23005 |
| 23020 | 23006 |
| 23021 const char* UserTag::ToCString() const { | 23007 const char* UserTag::ToCString() const { |
| 23022 const String& tag_label = String::Handle(label()); | 23008 const String& tag_label = String::Handle(label()); |
| 23023 return tag_label.ToCString(); | 23009 return tag_label.ToCString(); |
| 23024 } | 23010 } |
| 23025 | 23011 |
| 23026 } // namespace dart | 23012 } // namespace dart |
| OLD | NEW |