OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/code_generator.h" | 5 #include "vm/code_generator.h" |
6 | 6 |
7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
8 #include "vm/ast.h" | 8 #include "vm/ast.h" |
9 #include "vm/code_patcher.h" | 9 #include "vm/code_patcher.h" |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 1524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1535 ASSERT(frame->IsDartFrame()); | 1535 ASSERT(frame->IsDartFrame()); |
1536 const Code& caller_code = Code::Handle(isolate, frame->LookupDartCode()); | 1536 const Code& caller_code = Code::Handle(isolate, frame->LookupDartCode()); |
1537 ASSERT(!caller_code.IsNull()); | 1537 ASSERT(!caller_code.IsNull()); |
1538 const Code& stub = Code::Handle( | 1538 const Code& stub = Code::Handle( |
1539 CodePatcher::GetStaticCallTargetAt(frame->pc(), caller_code)); | 1539 CodePatcher::GetStaticCallTargetAt(frame->pc(), caller_code)); |
1540 Class& alloc_class = Class::ZoneHandle(zone); | 1540 Class& alloc_class = Class::ZoneHandle(zone); |
1541 alloc_class ^= stub.owner(); | 1541 alloc_class ^= stub.owner(); |
1542 Code& alloc_stub = Code::Handle(isolate, alloc_class.allocation_stub()); | 1542 Code& alloc_stub = Code::Handle(isolate, alloc_class.allocation_stub()); |
1543 if (alloc_stub.IsNull()) { | 1543 if (alloc_stub.IsNull()) { |
1544 alloc_stub = StubCode::GetAllocationStubForClass(alloc_class); | 1544 alloc_stub = StubCode::GetAllocationStubForClass(alloc_class); |
1545 ASSERT(!CodePatcher::IsEntryPatched(alloc_stub)); | 1545 ASSERT(!alloc_stub.IsDisabled()); |
1546 } | 1546 } |
1547 CodePatcher::PatchStaticCallAt(frame->pc(), | 1547 CodePatcher::PatchStaticCallAt(frame->pc(), |
1548 caller_code, | 1548 caller_code, |
1549 alloc_stub); | 1549 alloc_stub); |
1550 caller_code.SetStubCallTargetCodeAt(frame->pc(), alloc_stub); | 1550 caller_code.SetStubCallTargetCodeAt(frame->pc(), alloc_stub); |
1551 if (FLAG_trace_patching) { | 1551 if (FLAG_trace_patching) { |
1552 OS::PrintErr("FixAllocationStubTarget: caller %#" Px " alloc-class %s " | 1552 OS::PrintErr("FixAllocationStubTarget: caller %#" Px " alloc-class %s " |
1553 " -> %#" Px "\n", | 1553 " -> %#" Px "\n", |
1554 frame->pc(), | 1554 frame->pc(), |
1555 alloc_class.ToCString(), | 1555 alloc_class.ToCString(), |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1825 const intptr_t elm_size = old_data.ElementSizeInBytes(); | 1825 const intptr_t elm_size = old_data.ElementSizeInBytes(); |
1826 const TypedData& new_data = | 1826 const TypedData& new_data = |
1827 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); | 1827 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); |
1828 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); | 1828 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); |
1829 typed_data_cell.SetAt(0, new_data); | 1829 typed_data_cell.SetAt(0, new_data); |
1830 arguments.SetReturn(new_data); | 1830 arguments.SetReturn(new_data); |
1831 } | 1831 } |
1832 | 1832 |
1833 | 1833 |
1834 } // namespace dart | 1834 } // namespace dart |
OLD | NEW |