| 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/isolate.h" | 5 #include "vm/isolate.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 "platform/json.h" | 9 #include "platform/json.h" |
| 10 #include "lib/mirrors.h" | 10 #include "lib/mirrors.h" |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 debugger_(NULL), | 314 debugger_(NULL), |
| 315 single_step_(false), | 315 single_step_(false), |
| 316 random_(), | 316 random_(), |
| 317 simulator_(NULL), | 317 simulator_(NULL), |
| 318 long_jump_base_(NULL), | 318 long_jump_base_(NULL), |
| 319 timer_list_(), | 319 timer_list_(), |
| 320 deopt_id_(0), | 320 deopt_id_(0), |
| 321 mutex_(new Mutex()), | 321 mutex_(new Mutex()), |
| 322 stack_limit_(0), | 322 stack_limit_(0), |
| 323 saved_stack_limit_(0), | 323 saved_stack_limit_(0), |
| 324 stack_overflow_flags_(0), |
| 325 stack_overflow_count_(0), |
| 324 message_handler_(NULL), | 326 message_handler_(NULL), |
| 325 spawn_state_(NULL), | 327 spawn_state_(NULL), |
| 326 is_runnable_(false), | 328 is_runnable_(false), |
| 327 gc_prologue_callback_(NULL), | 329 gc_prologue_callback_(NULL), |
| 328 gc_epilogue_callback_(NULL), | 330 gc_epilogue_callback_(NULL), |
| 329 defer_finalization_count_(0), | 331 defer_finalization_count_(0), |
| 330 deopt_context_(NULL), | 332 deopt_context_(NULL), |
| 331 stacktrace_(NULL), | 333 stacktrace_(NULL), |
| 332 stack_frame_index_(-1), | 334 stack_frame_index_(-1), |
| 333 cha_used_(false), | 335 cha_used_(false), |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 MutexLocker ml(mutex_); | 657 MutexLocker ml(mutex_); |
| 656 if (stack_limit_ == saved_stack_limit_) { | 658 if (stack_limit_ == saved_stack_limit_) { |
| 657 return 0; // No interrupt was requested. | 659 return 0; // No interrupt was requested. |
| 658 } | 660 } |
| 659 uword interrupt_bits = stack_limit_ & kInterruptsMask; | 661 uword interrupt_bits = stack_limit_ & kInterruptsMask; |
| 660 stack_limit_ = saved_stack_limit_; | 662 stack_limit_ = saved_stack_limit_; |
| 661 return interrupt_bits; | 663 return interrupt_bits; |
| 662 } | 664 } |
| 663 | 665 |
| 664 | 666 |
| 667 uword Isolate::GetAndClearStackOverflowFlags() { |
| 668 uword stack_overflow_flags = stack_overflow_flags_; |
| 669 stack_overflow_flags_ = 0; |
| 670 return stack_overflow_flags; |
| 671 } |
| 672 |
| 673 |
| 665 static int MostUsedFunctionFirst(const Function* const* a, | 674 static int MostUsedFunctionFirst(const Function* const* a, |
| 666 const Function* const* b) { | 675 const Function* const* b) { |
| 667 if ((*a)->usage_counter() > (*b)->usage_counter()) { | 676 if ((*a)->usage_counter() > (*b)->usage_counter()) { |
| 668 return -1; | 677 return -1; |
| 669 } else if ((*a)->usage_counter() < (*b)->usage_counter()) { | 678 } else if ((*a)->usage_counter() < (*b)->usage_counter()) { |
| 670 return 1; | 679 return 1; |
| 671 } else { | 680 } else { |
| 672 return 0; | 681 return 0; |
| 673 } | 682 } |
| 674 } | 683 } |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1124 return func.raw(); | 1133 return func.raw(); |
| 1125 } | 1134 } |
| 1126 | 1135 |
| 1127 | 1136 |
| 1128 void IsolateSpawnState::Cleanup() { | 1137 void IsolateSpawnState::Cleanup() { |
| 1129 SwitchIsolateScope switch_scope(isolate()); | 1138 SwitchIsolateScope switch_scope(isolate()); |
| 1130 Dart::ShutdownIsolate(); | 1139 Dart::ShutdownIsolate(); |
| 1131 } | 1140 } |
| 1132 | 1141 |
| 1133 } // namespace dart | 1142 } // namespace dart |
| OLD | NEW |