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...) 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(); |
Vitaly Repeshko
2011/04/15 00:29:39
Are you sure you need "OrAllocate" here?
Dmitry Lomov
2011/04/19 01:50:47
It is actually the if below that was bogus - done
| |
462 // You should hold the ExecutionAccess lock when you call this. | 462 if (per_thread != NULL) { |
463 if (stored_limit != 0) { | 463 uintptr_t stored_limit = per_thread->stack_limit(); |
464 StackGuard::SetStackLimit(stored_limit); | 464 // You should hold the ExecutionAccess lock when you call this. |
465 if (stored_limit != 0) { | |
466 StackGuard::SetStackLimit(stored_limit); | |
467 } | |
465 } | 468 } |
466 } | 469 } |
467 | 470 |
468 | 471 |
469 // --- C a l l s t o n a t i v e s --- | 472 // --- C a l l s t o n a t i v e s --- |
470 | 473 |
471 #define RETURN_NATIVE_CALL(name, argc, argv, has_pending_exception) \ | 474 #define RETURN_NATIVE_CALL(name, argc, argv, has_pending_exception) \ |
472 do { \ | 475 do { \ |
473 Isolate* isolate = Isolate::Current(); \ | 476 Isolate* isolate = Isolate::Current(); \ |
474 Object** args[argc] = argv; \ | 477 Object** args[argc] = argv; \ |
(...skipping 307 matching lines...) Loading... | |
782 return isolate->TerminateExecution(); | 785 return isolate->TerminateExecution(); |
783 } | 786 } |
784 if (stack_guard->IsInterrupted()) { | 787 if (stack_guard->IsInterrupted()) { |
785 stack_guard->Continue(INTERRUPT); | 788 stack_guard->Continue(INTERRUPT); |
786 return isolate->StackOverflow(); | 789 return isolate->StackOverflow(); |
787 } | 790 } |
788 return isolate->heap()->undefined_value(); | 791 return isolate->heap()->undefined_value(); |
789 } | 792 } |
790 | 793 |
791 } } // namespace v8::internal | 794 } } // namespace v8::internal |
OLD | NEW |