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 1554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1565 target_function.ToFullyQualifiedCString(), | 1565 target_function.ToFullyQualifiedCString(), |
1566 current_target_code.EntryPoint()); | 1566 current_target_code.EntryPoint()); |
1567 } | 1567 } |
1568 arguments.SetReturn(current_target_code); | 1568 arguments.SetReturn(current_target_code); |
1569 } | 1569 } |
1570 | 1570 |
1571 | 1571 |
1572 // The caller tried to allocate an instance via an invalidated allocation | 1572 // The caller tried to allocate an instance via an invalidated allocation |
1573 // stub. | 1573 // stub. |
1574 DEFINE_RUNTIME_ENTRY(FixAllocationStubTarget, 0) { | 1574 DEFINE_RUNTIME_ENTRY(FixAllocationStubTarget, 0) { |
| 1575 #if !defined(DART_PRECOMPILED_RUNTIME) |
1575 StackFrameIterator iterator(StackFrameIterator::kDontValidateFrames); | 1576 StackFrameIterator iterator(StackFrameIterator::kDontValidateFrames); |
1576 StackFrame* frame = iterator.NextFrame(); | 1577 StackFrame* frame = iterator.NextFrame(); |
1577 ASSERT(frame != NULL); | 1578 ASSERT(frame != NULL); |
1578 while (frame->IsStubFrame() || frame->IsExitFrame()) { | 1579 while (frame->IsStubFrame() || frame->IsExitFrame()) { |
1579 frame = iterator.NextFrame(); | 1580 frame = iterator.NextFrame(); |
1580 ASSERT(frame != NULL); | 1581 ASSERT(frame != NULL); |
1581 } | 1582 } |
1582 if (frame->IsEntryFrame()) { | 1583 if (frame->IsEntryFrame()) { |
1583 // There must be a valid Dart frame. | 1584 // There must be a valid Dart frame. |
1584 UNREACHABLE(); | 1585 UNREACHABLE(); |
(...skipping 15 matching lines...) Expand all Loading... |
1600 alloc_stub); | 1601 alloc_stub); |
1601 caller_code.SetStubCallTargetCodeAt(frame->pc(), alloc_stub); | 1602 caller_code.SetStubCallTargetCodeAt(frame->pc(), alloc_stub); |
1602 if (FLAG_trace_patching) { | 1603 if (FLAG_trace_patching) { |
1603 OS::PrintErr("FixAllocationStubTarget: caller %#" Px " alloc-class %s " | 1604 OS::PrintErr("FixAllocationStubTarget: caller %#" Px " alloc-class %s " |
1604 " -> %#" Px "\n", | 1605 " -> %#" Px "\n", |
1605 frame->pc(), | 1606 frame->pc(), |
1606 alloc_class.ToCString(), | 1607 alloc_class.ToCString(), |
1607 alloc_stub.EntryPoint()); | 1608 alloc_stub.EntryPoint()); |
1608 } | 1609 } |
1609 arguments.SetReturn(alloc_stub); | 1610 arguments.SetReturn(alloc_stub); |
| 1611 #else |
| 1612 UNREACHABLE(); |
| 1613 #endif |
1610 } | 1614 } |
1611 | 1615 |
1612 | 1616 |
1613 const char* DeoptReasonToCString(ICData::DeoptReasonId deopt_reason) { | 1617 const char* DeoptReasonToCString(ICData::DeoptReasonId deopt_reason) { |
1614 switch (deopt_reason) { | 1618 switch (deopt_reason) { |
1615 #define DEOPT_REASON_TO_TEXT(name) case ICData::kDeopt##name: return #name; | 1619 #define DEOPT_REASON_TO_TEXT(name) case ICData::kDeopt##name: return #name; |
1616 DEOPT_REASONS(DEOPT_REASON_TO_TEXT) | 1620 DEOPT_REASONS(DEOPT_REASON_TO_TEXT) |
1617 #undef DEOPT_REASON_TO_TEXT | 1621 #undef DEOPT_REASON_TO_TEXT |
1618 default: | 1622 default: |
1619 UNREACHABLE(); | 1623 UNREACHABLE(); |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1890 const intptr_t elm_size = old_data.ElementSizeInBytes(); | 1894 const intptr_t elm_size = old_data.ElementSizeInBytes(); |
1891 const TypedData& new_data = | 1895 const TypedData& new_data = |
1892 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); | 1896 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); |
1893 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); | 1897 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); |
1894 typed_data_cell.SetAt(0, new_data); | 1898 typed_data_cell.SetAt(0, new_data); |
1895 arguments.SetReturn(new_data); | 1899 arguments.SetReturn(new_data); |
1896 } | 1900 } |
1897 | 1901 |
1898 | 1902 |
1899 } // namespace dart | 1903 } // namespace dart |
OLD | NEW |