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 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1105 return false; | 1105 return false; |
1106 } | 1106 } |
1107 return true; | 1107 return true; |
1108 } | 1108 } |
1109 | 1109 |
1110 | 1110 |
1111 DEFINE_RUNTIME_ENTRY(StackOverflow, 0) { | 1111 DEFINE_RUNTIME_ENTRY(StackOverflow, 0) { |
1112 #if defined(USING_SIMULATOR) | 1112 #if defined(USING_SIMULATOR) |
1113 uword stack_pos = Simulator::Current()->get_register(SPREG); | 1113 uword stack_pos = Simulator::Current()->get_register(SPREG); |
1114 #else | 1114 #else |
1115 uword stack_pos = reinterpret_cast<uword>(&arguments); | 1115 uword stack_pos = Isolate::GetCurrentStackPointer(); |
1116 #endif | 1116 #endif |
1117 // Always clear the stack overflow flags. They are meant for this | 1117 // Always clear the stack overflow flags. They are meant for this |
1118 // particular stack overflow runtime call and are not meant to | 1118 // particular stack overflow runtime call and are not meant to |
1119 // persist. | 1119 // persist. |
1120 uword stack_overflow_flags = isolate->GetAndClearStackOverflowFlags(); | 1120 uword stack_overflow_flags = isolate->GetAndClearStackOverflowFlags(); |
1121 | 1121 |
1122 // If an interrupt happens at the same time as a stack overflow, we | 1122 // If an interrupt happens at the same time as a stack overflow, we |
1123 // process the stack overflow now and leave the interrupt for next | 1123 // process the stack overflow now and leave the interrupt for next |
1124 // time. | 1124 // time. |
1125 if (stack_pos < isolate->saved_stack_limit()) { | 1125 if (stack_pos < isolate->saved_stack_limit()) { |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1679 const intptr_t elm_size = old_data.ElementSizeInBytes(); | 1679 const intptr_t elm_size = old_data.ElementSizeInBytes(); |
1680 const TypedData& new_data = | 1680 const TypedData& new_data = |
1681 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); | 1681 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); |
1682 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); | 1682 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); |
1683 typed_data_cell.SetAt(0, new_data); | 1683 typed_data_cell.SetAt(0, new_data); |
1684 arguments.SetReturn(new_data); | 1684 arguments.SetReturn(new_data); |
1685 } | 1685 } |
1686 | 1686 |
1687 | 1687 |
1688 } // namespace dart | 1688 } // namespace dart |
OLD | NEW |