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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 void StackGuard::EnableInterrupts() { | 349 void StackGuard::EnableInterrupts() { |
350 ExecutionAccess access(isolate_); | 350 ExecutionAccess access(isolate_); |
351 if (has_pending_interrupts(access)) { | 351 if (has_pending_interrupts(access)) { |
352 set_interrupt_limits(access); | 352 set_interrupt_limits(access); |
353 } | 353 } |
354 } | 354 } |
355 | 355 |
356 | 356 |
357 void StackGuard::SetStackLimit(uintptr_t limit) { | 357 void StackGuard::SetStackLimit(uintptr_t limit) { |
358 ExecutionAccess access(isolate_); | 358 ExecutionAccess access(isolate_); |
359 // If the current limits are special (eg due to a pending interrupt) then | 359 // If the current limits are special (e.g. due to a pending interrupt) then |
360 // leave them alone. | 360 // leave them alone. |
361 uintptr_t jslimit = SimulatorStack::JsLimitFromCLimit(isolate_, limit); | 361 uintptr_t jslimit = SimulatorStack::JsLimitFromCLimit(isolate_, limit); |
362 if (thread_local_.jslimit_ == thread_local_.real_jslimit_) { | 362 if (thread_local_.jslimit_ == thread_local_.real_jslimit_) { |
363 thread_local_.jslimit_ = jslimit; | 363 thread_local_.jslimit_ = jslimit; |
364 } | 364 } |
365 if (thread_local_.climit_ == thread_local_.real_climit_) { | 365 if (thread_local_.climit_ == thread_local_.real_climit_) { |
366 thread_local_.climit_ = limit; | 366 thread_local_.climit_ = limit; |
367 } | 367 } |
368 thread_local_.real_climit_ = limit; | 368 thread_local_.real_climit_ = limit; |
369 thread_local_.real_jslimit_ = jslimit; | 369 thread_local_.real_jslimit_ = jslimit; |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
898 return isolate->TerminateExecution(); | 898 return isolate->TerminateExecution(); |
899 } | 899 } |
900 if (stack_guard->IsInterrupted()) { | 900 if (stack_guard->IsInterrupted()) { |
901 stack_guard->Continue(INTERRUPT); | 901 stack_guard->Continue(INTERRUPT); |
902 return isolate->StackOverflow(); | 902 return isolate->StackOverflow(); |
903 } | 903 } |
904 return isolate->heap()->undefined_value(); | 904 return isolate->heap()->undefined_value(); |
905 } | 905 } |
906 | 906 |
907 } } // namespace v8::internal | 907 } } // namespace v8::internal |
OLD | NEW |