| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 124 |
| 125 #ifdef DEBUG | 125 #ifdef DEBUG |
| 126 value->Verify(); | 126 value->Verify(); |
| 127 #endif | 127 #endif |
| 128 | 128 |
| 129 // Update the pending exception flag and return the value. | 129 // Update the pending exception flag and return the value. |
| 130 *has_pending_exception = value->IsException(); | 130 *has_pending_exception = value->IsException(); |
| 131 ASSERT(*has_pending_exception == Isolate::Current()->has_pending_exception()); | 131 ASSERT(*has_pending_exception == Isolate::Current()->has_pending_exception()); |
| 132 if (*has_pending_exception) { | 132 if (*has_pending_exception) { |
| 133 isolate->ReportPendingMessages(); | 133 isolate->ReportPendingMessages(); |
| 134 if (isolate->pending_exception() == Failure::OutOfMemoryException()) { |
| 135 if (!isolate->handle_scope_implementer()->ignore_out_of_memory()) { |
| 136 V8::FatalProcessOutOfMemory("JS", true); |
| 137 } |
| 138 } |
| 134 return Handle<Object>(); | 139 return Handle<Object>(); |
| 135 } else { | 140 } else { |
| 136 isolate->clear_pending_message(); | 141 isolate->clear_pending_message(); |
| 137 } | 142 } |
| 138 | 143 |
| 139 return Handle<Object>(value->ToObjectUnchecked(), isolate); | 144 return Handle<Object>(value->ToObjectUnchecked(), isolate); |
| 140 } | 145 } |
| 141 | 146 |
| 142 | 147 |
| 143 Handle<Object> Execution::Call(Handle<JSFunction> func, | 148 Handle<Object> Execution::Call(Handle<JSFunction> func, |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 postpone_interrupts_nesting_ = 0; | 423 postpone_interrupts_nesting_ = 0; |
| 419 interrupt_flags_ = 0; | 424 interrupt_flags_ = 0; |
| 420 } | 425 } |
| 421 | 426 |
| 422 | 427 |
| 423 bool StackGuard::ThreadLocal::Initialize() { | 428 bool StackGuard::ThreadLocal::Initialize() { |
| 424 bool should_set_stack_limits = false; | 429 bool should_set_stack_limits = false; |
| 425 if (real_climit_ == kIllegalLimit) { | 430 if (real_climit_ == kIllegalLimit) { |
| 426 // Takes the address of the limit variable in order to find out where | 431 // Takes the address of the limit variable in order to find out where |
| 427 // the top of stack is right now. | 432 // the top of stack is right now. |
| 433 const uintptr_t kLimitSize = FLAG_stack_size * KB; |
| 428 uintptr_t limit = reinterpret_cast<uintptr_t>(&limit) - kLimitSize; | 434 uintptr_t limit = reinterpret_cast<uintptr_t>(&limit) - kLimitSize; |
| 429 ASSERT(reinterpret_cast<uintptr_t>(&limit) > kLimitSize); | 435 ASSERT(reinterpret_cast<uintptr_t>(&limit) > kLimitSize); |
| 430 real_jslimit_ = SimulatorStack::JsLimitFromCLimit(limit); | 436 real_jslimit_ = SimulatorStack::JsLimitFromCLimit(limit); |
| 431 jslimit_ = SimulatorStack::JsLimitFromCLimit(limit); | 437 jslimit_ = SimulatorStack::JsLimitFromCLimit(limit); |
| 432 real_climit_ = limit; | 438 real_climit_ = limit; |
| 433 climit_ = limit; | 439 climit_ = limit; |
| 434 should_set_stack_limits = true; | 440 should_set_stack_limits = true; |
| 435 } | 441 } |
| 436 nesting_ = 0; | 442 nesting_ = 0; |
| 437 postpone_interrupts_nesting_ = 0; | 443 postpone_interrupts_nesting_ = 0; |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 return isolate->TerminateExecution(); | 767 return isolate->TerminateExecution(); |
| 762 } | 768 } |
| 763 if (stack_guard->IsInterrupted()) { | 769 if (stack_guard->IsInterrupted()) { |
| 764 stack_guard->Continue(INTERRUPT); | 770 stack_guard->Continue(INTERRUPT); |
| 765 return isolate->StackOverflow(); | 771 return isolate->StackOverflow(); |
| 766 } | 772 } |
| 767 return isolate->heap()->undefined_value(); | 773 return isolate->heap()->undefined_value(); |
| 768 } | 774 } |
| 769 | 775 |
| 770 } } // namespace v8::internal | 776 } } // namespace v8::internal |
| OLD | NEW |