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 uintptr_t stored_limit = | 460 Isolate::PerIsolateThreadData* per_thread = |
461 Isolate::CurrentPerIsolateThreadData()->stack_limit(); | 461 isolate_->FindOrAllocatePerThreadDataForThisThread(); |
| 462 uintptr_t stored_limit = per_thread->stack_limit(); |
462 // You should hold the ExecutionAccess lock when you call this. | 463 // You should hold the ExecutionAccess lock when you call this. |
463 if (stored_limit != 0) { | 464 if (stored_limit != 0) { |
464 StackGuard::SetStackLimit(stored_limit); | 465 StackGuard::SetStackLimit(stored_limit); |
465 } | 466 } |
466 } | 467 } |
467 | 468 |
468 | 469 |
469 // --- C a l l s t o n a t i v e s --- | 470 // --- C a l l s t o n a t i v e s --- |
470 | 471 |
471 #define RETURN_NATIVE_CALL(name, argc, argv, has_pending_exception) \ | 472 #define RETURN_NATIVE_CALL(name, argc, argv, has_pending_exception) \ |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 return isolate->TerminateExecution(); | 783 return isolate->TerminateExecution(); |
783 } | 784 } |
784 if (stack_guard->IsInterrupted()) { | 785 if (stack_guard->IsInterrupted()) { |
785 stack_guard->Continue(INTERRUPT); | 786 stack_guard->Continue(INTERRUPT); |
786 return isolate->StackOverflow(); | 787 return isolate->StackOverflow(); |
787 } | 788 } |
788 return isolate->heap()->undefined_value(); | 789 return isolate->heap()->undefined_value(); |
789 } | 790 } |
790 | 791 |
791 } } // namespace v8::internal | 792 } } // namespace v8::internal |
OLD | NEW |