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 "lib/mirrors.h" | 9 #include "lib/mirrors.h" |
10 #include "vm/code_observers.h" | 10 #include "vm/code_observers.h" |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 // TODO(5411455): Use flag to override default value and Validate the | 381 // TODO(5411455): Use flag to override default value and Validate the |
382 // stack size by querying OS. | 382 // stack size by querying OS. |
383 uword Isolate::GetSpecifiedStackSize() { | 383 uword Isolate::GetSpecifiedStackSize() { |
384 ASSERT(Isolate::kStackSizeBuffer < Thread::GetMaxStackSize()); | 384 ASSERT(Isolate::kStackSizeBuffer < Thread::GetMaxStackSize()); |
385 uword stack_size = Thread::GetMaxStackSize() - Isolate::kStackSizeBuffer; | 385 uword stack_size = Thread::GetMaxStackSize() - Isolate::kStackSizeBuffer; |
386 return stack_size; | 386 return stack_size; |
387 } | 387 } |
388 | 388 |
389 | 389 |
390 void Isolate::SetStackLimitFromCurrentTOS(uword stack_top_value) { | 390 void Isolate::SetStackLimitFromCurrentTOS(uword stack_top_value) { |
391 #ifdef USING_SIMULATOR | 391 #if defined(USING_SIMULATOR) |
392 // Ignore passed-in native stack top and use Simulator stack top. | 392 // Ignore passed-in native stack top and use Simulator stack top. |
393 Simulator* sim = Simulator::Current(); // May allocate a simulator. | 393 Simulator* sim = Simulator::Current(); // May allocate a simulator. |
394 ASSERT(simulator() == sim); // This isolate's simulator is the current one. | 394 ASSERT(simulator() == sim); // This isolate's simulator is the current one. |
395 stack_top_value = sim->StackTop(); | 395 stack_top_value = sim->StackTop(); |
396 // The overflow area is accounted for by the simulator. | 396 // The overflow area is accounted for by the simulator. |
397 #endif | 397 #endif |
398 SetStackLimit(stack_top_value - GetSpecifiedStackSize()); | 398 SetStackLimit(stack_top_value - GetSpecifiedStackSize()); |
399 } | 399 } |
400 | 400 |
401 | 401 |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 isolate->saved_stack_limit(), | 685 isolate->saved_stack_limit(), |
686 heap->Used(Heap::kNew) / KB, | 686 heap->Used(Heap::kNew) / KB, |
687 heap->Capacity(Heap::kNew) / KB, | 687 heap->Capacity(Heap::kNew) / KB, |
688 heap->Used(Heap::kOld) / KB, | 688 heap->Used(Heap::kOld) / KB, |
689 heap->Capacity(Heap::kOld) / KB); | 689 heap->Capacity(Heap::kOld) / KB); |
690 ASSERT(n < 256); | 690 ASSERT(n < 256); |
691 return strdup(buffer); | 691 return strdup(buffer); |
692 } | 692 } |
693 | 693 |
694 } // namespace dart | 694 } // namespace dart |
OLD | NEW |