Chromium Code Reviews| 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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 472 void Isolate::SetStackLimit(uword limit) { | 472 void Isolate::SetStackLimit(uword limit) { |
| 473 MutexLocker ml(mutex_); | 473 MutexLocker ml(mutex_); |
| 474 if (stack_limit_ == saved_stack_limit_) { | 474 if (stack_limit_ == saved_stack_limit_) { |
| 475 // No interrupt pending, set stack_limit_ too. | 475 // No interrupt pending, set stack_limit_ too. |
| 476 stack_limit_ = limit; | 476 stack_limit_ = limit; |
| 477 } | 477 } |
| 478 saved_stack_limit_ = limit; | 478 saved_stack_limit_ = limit; |
| 479 } | 479 } |
| 480 | 480 |
| 481 | 481 |
| 482 bool Isolate::GetStackBounds(uintptr_t* lower, uintptr_t* upper) { | 482 bool Isolate::GetStackBounds(uword* lower, uword* upper) { |
| 483 uintptr_t stack_lower = stack_limit(); | 483 uword stack_lower = stack_limit(); |
| 484 if (stack_lower == static_cast<uintptr_t>(~0)) { | 484 if (stack_lower == static_cast<uword>(~0)) { |
|
siva
2014/02/19 18:09:54
should this be
if (stack_lower == kUwordMax) {
.
Cutch
2014/02/19 18:20:31
Done.
| |
| 485 stack_lower = saved_stack_limit(); | 485 stack_lower = saved_stack_limit(); |
| 486 } | 486 } |
| 487 if (stack_lower == static_cast<uintptr_t>(~0)) { | 487 if (stack_lower == static_cast<uword>(~0)) { |
|
siva
2014/02/19 18:09:54
Ditto...
Cutch
2014/02/19 18:20:31
Done.
| |
| 488 return false; | 488 return false; |
| 489 } | 489 } |
| 490 uintptr_t stack_upper = stack_lower + GetSpecifiedStackSize(); | 490 uword stack_upper = stack_lower + GetSpecifiedStackSize(); |
| 491 *lower = stack_lower; | 491 *lower = stack_lower; |
| 492 *upper = stack_upper; | 492 *upper = stack_upper; |
| 493 return true; | 493 return true; |
| 494 } | 494 } |
| 495 | 495 |
| 496 | 496 |
| 497 void Isolate::ScheduleInterrupts(uword interrupt_bits) { | 497 void Isolate::ScheduleInterrupts(uword interrupt_bits) { |
| 498 // TODO(turnidge): Can't use MutexLocker here because MutexLocker is | 498 // TODO(turnidge): Can't use MutexLocker here because MutexLocker is |
| 499 // a StackResource, which requires a current isolate. Should | 499 // a StackResource, which requires a current isolate. Should |
| 500 // MutexLocker really be a StackResource? | 500 // MutexLocker really be a StackResource? |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1051 return func.raw(); | 1051 return func.raw(); |
| 1052 } | 1052 } |
| 1053 | 1053 |
| 1054 | 1054 |
| 1055 void IsolateSpawnState::Cleanup() { | 1055 void IsolateSpawnState::Cleanup() { |
| 1056 SwitchIsolateScope switch_scope(isolate()); | 1056 SwitchIsolateScope switch_scope(isolate()); |
| 1057 Dart::ShutdownIsolate(); | 1057 Dart::ShutdownIsolate(); |
| 1058 } | 1058 } |
| 1059 | 1059 |
| 1060 } // namespace dart | 1060 } // namespace dart |
| OLD | NEW |