OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 | 450 |
451 | 451 |
452 void StackGuard::ClearThread(const ExecutionAccess& lock) { | 452 void StackGuard::ClearThread(const ExecutionAccess& lock) { |
453 thread_local_.Clear(); | 453 thread_local_.Clear(); |
454 isolate_->heap()->SetStackLimits(); | 454 isolate_->heap()->SetStackLimits(); |
455 } | 455 } |
456 | 456 |
457 | 457 |
458 void StackGuard::InitThread(const ExecutionAccess& lock) { | 458 void StackGuard::InitThread(const ExecutionAccess& lock) { |
459 if (thread_local_.Initialize()) isolate_->heap()->SetStackLimits(); | 459 if (thread_local_.Initialize()) isolate_->heap()->SetStackLimits(); |
460 Isolate::PerIsolateThreadData* per_thread = | 460 uintptr_t stored_limit = |
461 isolate_->FindOrAllocatePerThreadDataForThisThread(); | 461 Isolate::CurrentPerIsolateThreadData()->stack_limit(); |
462 uintptr_t stored_limit = per_thread->stack_limit(); | |
463 // You should hold the ExecutionAccess lock when you call this. | 462 // You should hold the ExecutionAccess lock when you call this. |
464 if (stored_limit != 0) { | 463 if (stored_limit != 0) { |
465 StackGuard::SetStackLimit(stored_limit); | 464 StackGuard::SetStackLimit(stored_limit); |
466 } | 465 } |
467 } | 466 } |
468 | 467 |
469 | 468 |
470 // --- C a l l s t o n a t i v e s --- | 469 // --- C a l l s t o n a t i v e s --- |
471 | 470 |
472 #define RETURN_NATIVE_CALL(name, argc, argv, has_pending_exception) \ | 471 #define RETURN_NATIVE_CALL(name, argc, argv, has_pending_exception) \ |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 return isolate->TerminateExecution(); | 782 return isolate->TerminateExecution(); |
784 } | 783 } |
785 if (stack_guard->IsInterrupted()) { | 784 if (stack_guard->IsInterrupted()) { |
786 stack_guard->Continue(INTERRUPT); | 785 stack_guard->Continue(INTERRUPT); |
787 return isolate->StackOverflow(); | 786 return isolate->StackOverflow(); |
788 } | 787 } |
789 return isolate->heap()->undefined_value(); | 788 return isolate->heap()->undefined_value(); |
790 } | 789 } |
791 | 790 |
792 } } // namespace v8::internal | 791 } } // namespace v8::internal |
OLD | NEW |