| 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 1775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1786 END_LEAF_RUNTIME_ENTRY | 1786 END_LEAF_RUNTIME_ENTRY |
| 1787 | 1787 |
| 1788 | 1788 |
| 1789 // This is the last step in the deoptimization, GC can occur. | 1789 // This is the last step in the deoptimization, GC can occur. |
| 1790 // Returns number of bytes to remove from the expression stack of the | 1790 // Returns number of bytes to remove from the expression stack of the |
| 1791 // bottom-most deoptimized frame. Those arguments were artificially injected | 1791 // bottom-most deoptimized frame. Those arguments were artificially injected |
| 1792 // under return address to keep them discoverable by GC that can occur during | 1792 // under return address to keep them discoverable by GC that can occur during |
| 1793 // materialization phase. | 1793 // materialization phase. |
| 1794 DEFINE_RUNTIME_ENTRY(DeoptimizeMaterialize, 0) { | 1794 DEFINE_RUNTIME_ENTRY(DeoptimizeMaterialize, 0) { |
| 1795 #if !defined(DART_PRECOMPILED_RUNTIME) | 1795 #if !defined(DART_PRECOMPILED_RUNTIME) |
| 1796 #if defined(DEBUG) |
| 1797 { |
| 1798 // We may rendezvous for a safepoint at entry or GC from the allocations |
| 1799 // below. Check the stack is walkable. |
| 1800 StackFrameIterator frames_iterator(StackFrameIterator::kValidateFrames); |
| 1801 StackFrame* frame = frames_iterator.NextFrame(); |
| 1802 while (frame != NULL) { |
| 1803 frame = frames_iterator.NextFrame(); |
| 1804 } |
| 1805 } |
| 1806 #endif |
| 1796 DeoptContext* deopt_context = isolate->deopt_context(); | 1807 DeoptContext* deopt_context = isolate->deopt_context(); |
| 1797 intptr_t deopt_arg_count = deopt_context->MaterializeDeferredObjects(); | 1808 intptr_t deopt_arg_count = deopt_context->MaterializeDeferredObjects(); |
| 1798 isolate->set_deopt_context(NULL); | 1809 isolate->set_deopt_context(NULL); |
| 1799 delete deopt_context; | 1810 delete deopt_context; |
| 1800 | 1811 |
| 1801 // Return value tells deoptimization stub to remove the given number of bytes | 1812 // Return value tells deoptimization stub to remove the given number of bytes |
| 1802 // from the stack. | 1813 // from the stack. |
| 1803 arguments.SetReturn(Smi::Handle(Smi::New(deopt_arg_count * kWordSize))); | 1814 arguments.SetReturn(Smi::Handle(Smi::New(deopt_arg_count * kWordSize))); |
| 1804 #else | 1815 #else |
| 1805 UNREACHABLE(); | 1816 UNREACHABLE(); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1874 const intptr_t elm_size = old_data.ElementSizeInBytes(); | 1885 const intptr_t elm_size = old_data.ElementSizeInBytes(); |
| 1875 const TypedData& new_data = | 1886 const TypedData& new_data = |
| 1876 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); | 1887 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); |
| 1877 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); | 1888 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); |
| 1878 typed_data_cell.SetAt(0, new_data); | 1889 typed_data_cell.SetAt(0, new_data); |
| 1879 arguments.SetReturn(new_data); | 1890 arguments.SetReturn(new_data); |
| 1880 } | 1891 } |
| 1881 | 1892 |
| 1882 | 1893 |
| 1883 } // namespace dart | 1894 } // namespace dart |
| OLD | NEW |