ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 1 | // Copyright 2006-2008 the V8 project authors. All rights reserved. |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 2 | // Redistribution and use in source and binary forms, with or without |
| 3 | // modification, are permitted provided that the following conditions are |
| 4 | // met: |
| 5 | // |
| 6 | // * Redistributions of source code must retain the above copyright |
| 7 | // notice, this list of conditions and the following disclaimer. |
| 8 | // * Redistributions in binary form must reproduce the above |
| 9 | // copyright notice, this list of conditions and the following |
| 10 | // disclaimer in the documentation and/or other materials provided |
| 11 | // with the distribution. |
| 12 | // * Neither the name of Google Inc. nor the names of its |
| 13 | // contributors may be used to endorse or promote products derived |
| 14 | // from this software without specific prior written permission. |
| 15 | // |
| 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 17 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 18 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 20 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 21 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 22 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 23 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | |
| 28 | #include <stdlib.h> |
| 29 | |
| 30 | #include "v8.h" |
| 31 | |
| 32 | #include "api.h" |
kmillikin@chromium.org | 13bd294 | 2009-12-16 15:36:05 +0000 | [diff] [blame] | 33 | #include "bootstrapper.h" |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 34 | #include "codegen-inl.h" |
christian.plesner.hansen@gmail.com | 37abdec | 2009-01-06 14:43:28 +0000 | [diff] [blame] | 35 | #include "debug.h" |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 36 | #include "runtime-profiler.h" |
ager@chromium.org | c4c9272 | 2009-11-18 14:12:51 +0000 | [diff] [blame] | 37 | #include "simulator.h" |
christian.plesner.hansen@gmail.com | 37abdec | 2009-01-06 14:43:28 +0000 | [diff] [blame] | 38 | #include "v8threads.h" |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 39 | #include "vm-state-inl.h" |
christian.plesner.hansen@gmail.com | 37abdec | 2009-01-06 14:43:28 +0000 | [diff] [blame] | 40 | |
kasperl@chromium.org | 71affb5 | 2009-05-26 05:44:31 +0000 | [diff] [blame] | 41 | namespace v8 { |
| 42 | namespace internal { |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 43 | |
| 44 | |
| 45 | static Handle<Object> Invoke(bool construct, |
| 46 | Handle<JSFunction> func, |
| 47 | Handle<Object> receiver, |
| 48 | int argc, |
| 49 | Object*** args, |
| 50 | bool* has_pending_exception) { |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 51 | // Entering JavaScript. |
| 52 | VMState state(JS); |
| 53 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 54 | // Placeholder for return value. |
lrn@chromium.org | 303ada7 | 2010-10-27 09:33:13 +0000 | [diff] [blame] | 55 | MaybeObject* value = reinterpret_cast<Object*>(kZapValue); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 56 | |
| 57 | typedef Object* (*JSEntryFunction)( |
| 58 | byte* entry, |
| 59 | Object* function, |
| 60 | Object* receiver, |
| 61 | int argc, |
| 62 | Object*** args); |
| 63 | |
| 64 | Handle<Code> code; |
| 65 | if (construct) { |
| 66 | JSConstructEntryStub stub; |
| 67 | code = stub.GetCode(); |
| 68 | } else { |
| 69 | JSEntryStub stub; |
| 70 | code = stub.GetCode(); |
| 71 | } |
| 72 | |
sgjesse@chromium.org | 8d96e6d | 2009-08-07 10:18:15 +0000 | [diff] [blame] | 73 | // Convert calls on global objects to be calls on the global |
| 74 | // receiver instead to avoid having a 'this' pointer which refers |
| 75 | // directly to a global object. |
| 76 | if (receiver->IsGlobalObject()) { |
| 77 | Handle<GlobalObject> global = Handle<GlobalObject>::cast(receiver); |
| 78 | receiver = Handle<JSObject>(global->global_receiver()); |
| 79 | } |
| 80 | |
kasperl@chromium.org | 7b9eafd | 2009-12-21 15:20:30 +0000 | [diff] [blame] | 81 | // Make sure that the global object of the context we're about to |
| 82 | // make the current one is indeed a global object. |
| 83 | ASSERT(func->context()->global()->IsGlobalObject()); |
| 84 | |
kasper.lund | 4451067 | 2008-07-25 07:37:58 +0000 | [diff] [blame] | 85 | { |
| 86 | // Save and restore context around invocation and block the |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 87 | // allocation of handles without explicit handle scopes. |
| 88 | SaveContext save; |
| 89 | NoHandleAllocation na; |
| 90 | JSEntryFunction entry = FUNCTION_CAST<JSEntryFunction>(code->entry()); |
| 91 | |
| 92 | // Call the function through the right JS entry stub. |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 93 | byte* entry_address = func->code()->entry(); |
christian.plesner.hansen@gmail.com | 9d58c2b | 2009-10-16 11:48:38 +0000 | [diff] [blame] | 94 | JSFunction* function = *func; |
| 95 | Object* receiver_pointer = *receiver; |
| 96 | value = CALL_GENERATED_CODE(entry, entry_address, function, |
| 97 | receiver_pointer, argc, args); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 98 | } |
| 99 | |
| 100 | #ifdef DEBUG |
| 101 | value->Verify(); |
| 102 | #endif |
| 103 | |
| 104 | // Update the pending exception flag and return the value. |
| 105 | *has_pending_exception = value->IsException(); |
| 106 | ASSERT(*has_pending_exception == Top::has_pending_exception()); |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 107 | if (*has_pending_exception) { |
ager@chromium.org | 8bb6058 | 2008-12-11 12:02:20 +0000 | [diff] [blame] | 108 | Top::ReportPendingMessages(); |
ager@chromium.org | 3bf7b91 | 2008-11-17 09:09:45 +0000 | [diff] [blame] | 109 | return Handle<Object>(); |
ager@chromium.org | 8bb6058 | 2008-12-11 12:02:20 +0000 | [diff] [blame] | 110 | } else { |
| 111 | Top::clear_pending_message(); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 112 | } |
| 113 | |
lrn@chromium.org | 303ada7 | 2010-10-27 09:33:13 +0000 | [diff] [blame] | 114 | return Handle<Object>(value->ToObjectUnchecked()); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 115 | } |
| 116 | |
| 117 | |
| 118 | Handle<Object> Execution::Call(Handle<JSFunction> func, |
| 119 | Handle<Object> receiver, |
| 120 | int argc, |
| 121 | Object*** args, |
| 122 | bool* pending_exception) { |
| 123 | return Invoke(false, func, receiver, argc, args, pending_exception); |
| 124 | } |
| 125 | |
| 126 | |
| 127 | Handle<Object> Execution::New(Handle<JSFunction> func, int argc, |
| 128 | Object*** args, bool* pending_exception) { |
| 129 | return Invoke(true, func, Top::global(), argc, args, pending_exception); |
| 130 | } |
| 131 | |
| 132 | |
| 133 | Handle<Object> Execution::TryCall(Handle<JSFunction> func, |
| 134 | Handle<Object> receiver, |
| 135 | int argc, |
| 136 | Object*** args, |
| 137 | bool* caught_exception) { |
| 138 | // Enter a try-block while executing the JavaScript code. To avoid |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 139 | // duplicate error printing it must be non-verbose. Also, to avoid |
| 140 | // creating message objects during stack overflow we shouldn't |
| 141 | // capture messages. |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 142 | v8::TryCatch catcher; |
| 143 | catcher.SetVerbose(false); |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 144 | catcher.SetCaptureMessage(false); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 145 | |
| 146 | Handle<Object> result = Invoke(false, func, receiver, argc, args, |
| 147 | caught_exception); |
| 148 | |
| 149 | if (*caught_exception) { |
| 150 | ASSERT(catcher.HasCaught()); |
| 151 | ASSERT(Top::has_pending_exception()); |
| 152 | ASSERT(Top::external_caught_exception()); |
ager@chromium.org | 18ad94b | 2009-09-02 08:22:29 +0000 | [diff] [blame] | 153 | if (Top::pending_exception() == Heap::termination_exception()) { |
| 154 | result = Factory::termination_exception(); |
| 155 | } else { |
| 156 | result = v8::Utils::OpenHandle(*catcher.Exception()); |
| 157 | } |
| 158 | Top::OptionalRescheduleException(true); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 159 | } |
| 160 | |
| 161 | ASSERT(!Top::has_pending_exception()); |
| 162 | ASSERT(!Top::external_caught_exception()); |
| 163 | return result; |
| 164 | } |
| 165 | |
| 166 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 167 | Handle<Object> Execution::GetFunctionDelegate(Handle<Object> object) { |
| 168 | ASSERT(!object->IsJSFunction()); |
| 169 | |
| 170 | // If you return a function from here, it will be called when an |
| 171 | // attempt is made to call the given object as a function. |
| 172 | |
kasperl@chromium.org | e959c18 | 2009-07-27 08:59:04 +0000 | [diff] [blame] | 173 | // Regular expressions can be called as functions in both Firefox |
| 174 | // and Safari so we allow it too. |
sgjesse@chromium.org | 911335c | 2009-08-19 12:59:44 +0000 | [diff] [blame] | 175 | if (object->IsJSRegExp()) { |
kasperl@chromium.org | e959c18 | 2009-07-27 08:59:04 +0000 | [diff] [blame] | 176 | Handle<String> exec = Factory::exec_symbol(); |
lrn@chromium.org | 303ada7 | 2010-10-27 09:33:13 +0000 | [diff] [blame] | 177 | // TODO(lrn): Bug 617. We should use the default function here, not the |
| 178 | // one on the RegExp object. |
| 179 | Object* exec_function; |
| 180 | { MaybeObject* maybe_exec_function = object->GetProperty(*exec); |
| 181 | // This can lose an exception, but the alternative is to put a failure |
| 182 | // object in a handle, which is not GC safe. |
| 183 | if (!maybe_exec_function->ToObject(&exec_function)) { |
| 184 | return Factory::undefined_value(); |
| 185 | } |
| 186 | } |
| 187 | return Handle<Object>(exec_function); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 188 | } |
| 189 | |
| 190 | // Objects created through the API can have an instance-call handler |
| 191 | // that should be used when calling the object as a function. |
| 192 | if (object->IsHeapObject() && |
| 193 | HeapObject::cast(*object)->map()->has_instance_call_handler()) { |
| 194 | return Handle<JSFunction>( |
| 195 | Top::global_context()->call_as_function_delegate()); |
| 196 | } |
| 197 | |
| 198 | return Factory::undefined_value(); |
| 199 | } |
| 200 | |
| 201 | |
sgjesse@chromium.org | 05521fc | 2009-05-21 07:37:44 +0000 | [diff] [blame] | 202 | Handle<Object> Execution::GetConstructorDelegate(Handle<Object> object) { |
| 203 | ASSERT(!object->IsJSFunction()); |
| 204 | |
| 205 | // If you return a function from here, it will be called when an |
| 206 | // attempt is made to call the given object as a constructor. |
| 207 | |
| 208 | // Objects created through the API can have an instance-call handler |
| 209 | // that should be used when calling the object as a function. |
| 210 | if (object->IsHeapObject() && |
| 211 | HeapObject::cast(*object)->map()->has_instance_call_handler()) { |
| 212 | return Handle<JSFunction>( |
| 213 | Top::global_context()->call_as_constructor_delegate()); |
| 214 | } |
| 215 | |
| 216 | return Factory::undefined_value(); |
| 217 | } |
| 218 | |
| 219 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 220 | // Static state for stack guards. |
| 221 | StackGuard::ThreadLocal StackGuard::thread_local_; |
| 222 | |
| 223 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 224 | bool StackGuard::IsStackOverflow() { |
| 225 | ExecutionAccess access; |
| 226 | return (thread_local_.jslimit_ != kInterruptLimit && |
| 227 | thread_local_.climit_ != kInterruptLimit); |
| 228 | } |
| 229 | |
| 230 | |
| 231 | void StackGuard::EnableInterrupts() { |
| 232 | ExecutionAccess access; |
whesse@chromium.org | b6e43bb | 2010-04-14 09:36:28 +0000 | [diff] [blame] | 233 | if (has_pending_interrupts(access)) { |
| 234 | set_interrupt_limits(access); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 235 | } |
| 236 | } |
| 237 | |
| 238 | |
| 239 | void StackGuard::SetStackLimit(uintptr_t limit) { |
| 240 | ExecutionAccess access; |
| 241 | // If the current limits are special (eg due to a pending interrupt) then |
| 242 | // leave them alone. |
sgjesse@chromium.org | c514574 | 2009-10-07 09:00:33 +0000 | [diff] [blame] | 243 | uintptr_t jslimit = SimulatorStack::JsLimitFromCLimit(limit); |
ager@chromium.org | c4c9272 | 2009-11-18 14:12:51 +0000 | [diff] [blame] | 244 | if (thread_local_.jslimit_ == thread_local_.real_jslimit_) { |
sgjesse@chromium.org | c514574 | 2009-10-07 09:00:33 +0000 | [diff] [blame] | 245 | thread_local_.jslimit_ = jslimit; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 246 | } |
ager@chromium.org | c4c9272 | 2009-11-18 14:12:51 +0000 | [diff] [blame] | 247 | if (thread_local_.climit_ == thread_local_.real_climit_) { |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 248 | thread_local_.climit_ = limit; |
| 249 | } |
ager@chromium.org | c4c9272 | 2009-11-18 14:12:51 +0000 | [diff] [blame] | 250 | thread_local_.real_climit_ = limit; |
| 251 | thread_local_.real_jslimit_ = jslimit; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 252 | } |
| 253 | |
| 254 | |
| 255 | void StackGuard::DisableInterrupts() { |
| 256 | ExecutionAccess access; |
| 257 | reset_limits(access); |
| 258 | } |
| 259 | |
| 260 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 261 | bool StackGuard::IsInterrupted() { |
| 262 | ExecutionAccess access; |
| 263 | return thread_local_.interrupt_flags_ & INTERRUPT; |
| 264 | } |
| 265 | |
| 266 | |
| 267 | void StackGuard::Interrupt() { |
| 268 | ExecutionAccess access; |
| 269 | thread_local_.interrupt_flags_ |= INTERRUPT; |
whesse@chromium.org | b6e43bb | 2010-04-14 09:36:28 +0000 | [diff] [blame] | 270 | set_interrupt_limits(access); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 271 | } |
| 272 | |
| 273 | |
| 274 | bool StackGuard::IsPreempted() { |
| 275 | ExecutionAccess access; |
| 276 | return thread_local_.interrupt_flags_ & PREEMPT; |
| 277 | } |
| 278 | |
| 279 | |
| 280 | void StackGuard::Preempt() { |
| 281 | ExecutionAccess access; |
| 282 | thread_local_.interrupt_flags_ |= PREEMPT; |
whesse@chromium.org | b6e43bb | 2010-04-14 09:36:28 +0000 | [diff] [blame] | 283 | set_interrupt_limits(access); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 284 | } |
| 285 | |
| 286 | |
sgjesse@chromium.org | c81c894 | 2009-08-21 10:54:26 +0000 | [diff] [blame] | 287 | bool StackGuard::IsTerminateExecution() { |
| 288 | ExecutionAccess access; |
| 289 | return thread_local_.interrupt_flags_ & TERMINATE; |
| 290 | } |
| 291 | |
| 292 | |
| 293 | void StackGuard::TerminateExecution() { |
| 294 | ExecutionAccess access; |
| 295 | thread_local_.interrupt_flags_ |= TERMINATE; |
whesse@chromium.org | b6e43bb | 2010-04-14 09:36:28 +0000 | [diff] [blame] | 296 | set_interrupt_limits(access); |
sgjesse@chromium.org | c81c894 | 2009-08-21 10:54:26 +0000 | [diff] [blame] | 297 | } |
| 298 | |
| 299 | |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 300 | bool StackGuard::IsRuntimeProfilerTick() { |
| 301 | ExecutionAccess access; |
| 302 | return thread_local_.interrupt_flags_ & RUNTIME_PROFILER_TICK; |
| 303 | } |
| 304 | |
| 305 | |
| 306 | void StackGuard::RequestRuntimeProfilerTick() { |
| 307 | // Ignore calls if we're not optimizing or if we can't get the lock. |
| 308 | if (FLAG_opt && ExecutionAccess::TryLock()) { |
| 309 | thread_local_.interrupt_flags_ |= RUNTIME_PROFILER_TICK; |
| 310 | if (thread_local_.postpone_interrupts_nesting_ == 0) { |
| 311 | thread_local_.jslimit_ = thread_local_.climit_ = kInterruptLimit; |
| 312 | Heap::SetStackLimits(); |
| 313 | } |
| 314 | ExecutionAccess::Unlock(); |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 319 | #ifdef ENABLE_DEBUGGER_SUPPORT |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 320 | bool StackGuard::IsDebugBreak() { |
| 321 | ExecutionAccess access; |
| 322 | return thread_local_.interrupt_flags_ & DEBUGBREAK; |
| 323 | } |
| 324 | |
kasper.lund | 4451067 | 2008-07-25 07:37:58 +0000 | [diff] [blame] | 325 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 326 | void StackGuard::DebugBreak() { |
| 327 | ExecutionAccess access; |
kasper.lund | 7276f14 | 2008-07-30 08:49:36 +0000 | [diff] [blame] | 328 | thread_local_.interrupt_flags_ |= DEBUGBREAK; |
whesse@chromium.org | b6e43bb | 2010-04-14 09:36:28 +0000 | [diff] [blame] | 329 | set_interrupt_limits(access); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 330 | } |
| 331 | |
| 332 | |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 333 | bool StackGuard::IsDebugCommand() { |
| 334 | ExecutionAccess access; |
| 335 | return thread_local_.interrupt_flags_ & DEBUGCOMMAND; |
| 336 | } |
| 337 | |
| 338 | |
| 339 | void StackGuard::DebugCommand() { |
| 340 | if (FLAG_debugger_auto_break) { |
| 341 | ExecutionAccess access; |
| 342 | thread_local_.interrupt_flags_ |= DEBUGCOMMAND; |
whesse@chromium.org | b6e43bb | 2010-04-14 09:36:28 +0000 | [diff] [blame] | 343 | set_interrupt_limits(access); |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 344 | } |
| 345 | } |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 346 | #endif |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 347 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 348 | void StackGuard::Continue(InterruptFlag after_what) { |
| 349 | ExecutionAccess access; |
| 350 | thread_local_.interrupt_flags_ &= ~static_cast<int>(after_what); |
whesse@chromium.org | b6e43bb | 2010-04-14 09:36:28 +0000 | [diff] [blame] | 351 | if (!should_postpone_interrupts(access) && !has_pending_interrupts(access)) { |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 352 | reset_limits(access); |
| 353 | } |
| 354 | } |
| 355 | |
| 356 | |
| 357 | int StackGuard::ArchiveSpacePerThread() { |
| 358 | return sizeof(ThreadLocal); |
| 359 | } |
| 360 | |
| 361 | |
| 362 | char* StackGuard::ArchiveStackGuard(char* to) { |
| 363 | ExecutionAccess access; |
| 364 | memcpy(to, reinterpret_cast<char*>(&thread_local_), sizeof(ThreadLocal)); |
| 365 | ThreadLocal blank; |
| 366 | thread_local_ = blank; |
| 367 | return to + sizeof(ThreadLocal); |
| 368 | } |
| 369 | |
| 370 | |
| 371 | char* StackGuard::RestoreStackGuard(char* from) { |
| 372 | ExecutionAccess access; |
| 373 | memcpy(reinterpret_cast<char*>(&thread_local_), from, sizeof(ThreadLocal)); |
ager@chromium.org | c4c9272 | 2009-11-18 14:12:51 +0000 | [diff] [blame] | 374 | Heap::SetStackLimits(); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 375 | return from + sizeof(ThreadLocal); |
| 376 | } |
| 377 | |
| 378 | |
sgjesse@chromium.org | c514574 | 2009-10-07 09:00:33 +0000 | [diff] [blame] | 379 | static internal::Thread::LocalStorageKey stack_limit_key = |
| 380 | internal::Thread::CreateThreadLocalKey(); |
| 381 | |
| 382 | |
| 383 | void StackGuard::FreeThreadResources() { |
| 384 | Thread::SetThreadLocal( |
| 385 | stack_limit_key, |
ager@chromium.org | c4c9272 | 2009-11-18 14:12:51 +0000 | [diff] [blame] | 386 | reinterpret_cast<void*>(thread_local_.real_climit_)); |
sgjesse@chromium.org | c514574 | 2009-10-07 09:00:33 +0000 | [diff] [blame] | 387 | } |
| 388 | |
| 389 | |
| 390 | void StackGuard::ThreadLocal::Clear() { |
ager@chromium.org | c4c9272 | 2009-11-18 14:12:51 +0000 | [diff] [blame] | 391 | real_jslimit_ = kIllegalLimit; |
sgjesse@chromium.org | c514574 | 2009-10-07 09:00:33 +0000 | [diff] [blame] | 392 | jslimit_ = kIllegalLimit; |
ager@chromium.org | c4c9272 | 2009-11-18 14:12:51 +0000 | [diff] [blame] | 393 | real_climit_ = kIllegalLimit; |
sgjesse@chromium.org | c514574 | 2009-10-07 09:00:33 +0000 | [diff] [blame] | 394 | climit_ = kIllegalLimit; |
| 395 | nesting_ = 0; |
| 396 | postpone_interrupts_nesting_ = 0; |
| 397 | interrupt_flags_ = 0; |
ager@chromium.org | c4c9272 | 2009-11-18 14:12:51 +0000 | [diff] [blame] | 398 | Heap::SetStackLimits(); |
sgjesse@chromium.org | c514574 | 2009-10-07 09:00:33 +0000 | [diff] [blame] | 399 | } |
| 400 | |
| 401 | |
| 402 | void StackGuard::ThreadLocal::Initialize() { |
ager@chromium.org | c4c9272 | 2009-11-18 14:12:51 +0000 | [diff] [blame] | 403 | if (real_climit_ == kIllegalLimit) { |
sgjesse@chromium.org | c514574 | 2009-10-07 09:00:33 +0000 | [diff] [blame] | 404 | // Takes the address of the limit variable in order to find out where |
| 405 | // the top of stack is right now. |
christian.plesner.hansen@gmail.com | 9d58c2b | 2009-10-16 11:48:38 +0000 | [diff] [blame] | 406 | uintptr_t limit = reinterpret_cast<uintptr_t>(&limit) - kLimitSize; |
| 407 | ASSERT(reinterpret_cast<uintptr_t>(&limit) > kLimitSize); |
ager@chromium.org | c4c9272 | 2009-11-18 14:12:51 +0000 | [diff] [blame] | 408 | real_jslimit_ = SimulatorStack::JsLimitFromCLimit(limit); |
sgjesse@chromium.org | c514574 | 2009-10-07 09:00:33 +0000 | [diff] [blame] | 409 | jslimit_ = SimulatorStack::JsLimitFromCLimit(limit); |
ager@chromium.org | c4c9272 | 2009-11-18 14:12:51 +0000 | [diff] [blame] | 410 | real_climit_ = limit; |
sgjesse@chromium.org | c514574 | 2009-10-07 09:00:33 +0000 | [diff] [blame] | 411 | climit_ = limit; |
ager@chromium.org | c4c9272 | 2009-11-18 14:12:51 +0000 | [diff] [blame] | 412 | Heap::SetStackLimits(); |
sgjesse@chromium.org | c514574 | 2009-10-07 09:00:33 +0000 | [diff] [blame] | 413 | } |
| 414 | nesting_ = 0; |
| 415 | postpone_interrupts_nesting_ = 0; |
| 416 | interrupt_flags_ = 0; |
| 417 | } |
| 418 | |
| 419 | |
| 420 | void StackGuard::ClearThread(const ExecutionAccess& lock) { |
| 421 | thread_local_.Clear(); |
| 422 | } |
| 423 | |
| 424 | |
| 425 | void StackGuard::InitThread(const ExecutionAccess& lock) { |
| 426 | thread_local_.Initialize(); |
| 427 | void* stored_limit = Thread::GetThreadLocal(stack_limit_key); |
| 428 | // You should hold the ExecutionAccess lock when you call this. |
| 429 | if (stored_limit != NULL) { |
| 430 | StackGuard::SetStackLimit(reinterpret_cast<intptr_t>(stored_limit)); |
| 431 | } |
| 432 | } |
| 433 | |
| 434 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 435 | // --- C a l l s t o n a t i v e s --- |
| 436 | |
| 437 | #define RETURN_NATIVE_CALL(name, argc, argv, has_pending_exception) \ |
| 438 | do { \ |
| 439 | Object** args[argc] = argv; \ |
| 440 | ASSERT(has_pending_exception != NULL); \ |
| 441 | return Call(Top::name##_fun(), Top::builtins(), argc, args, \ |
| 442 | has_pending_exception); \ |
| 443 | } while (false) |
| 444 | |
| 445 | |
| 446 | Handle<Object> Execution::ToBoolean(Handle<Object> obj) { |
| 447 | // See the similar code in runtime.js:ToBoolean. |
| 448 | if (obj->IsBoolean()) return obj; |
| 449 | bool result = true; |
| 450 | if (obj->IsString()) { |
| 451 | result = Handle<String>::cast(obj)->length() != 0; |
| 452 | } else if (obj->IsNull() || obj->IsUndefined()) { |
| 453 | result = false; |
| 454 | } else if (obj->IsNumber()) { |
| 455 | double value = obj->Number(); |
| 456 | result = !((value == 0) || isnan(value)); |
| 457 | } |
| 458 | return Handle<Object>(Heap::ToBoolean(result)); |
| 459 | } |
| 460 | |
| 461 | |
| 462 | Handle<Object> Execution::ToNumber(Handle<Object> obj, bool* exc) { |
| 463 | RETURN_NATIVE_CALL(to_number, 1, { obj.location() }, exc); |
| 464 | } |
| 465 | |
| 466 | |
| 467 | Handle<Object> Execution::ToString(Handle<Object> obj, bool* exc) { |
| 468 | RETURN_NATIVE_CALL(to_string, 1, { obj.location() }, exc); |
| 469 | } |
| 470 | |
| 471 | |
| 472 | Handle<Object> Execution::ToDetailString(Handle<Object> obj, bool* exc) { |
| 473 | RETURN_NATIVE_CALL(to_detail_string, 1, { obj.location() }, exc); |
| 474 | } |
| 475 | |
| 476 | |
| 477 | Handle<Object> Execution::ToObject(Handle<Object> obj, bool* exc) { |
| 478 | if (obj->IsJSObject()) return obj; |
| 479 | RETURN_NATIVE_CALL(to_object, 1, { obj.location() }, exc); |
| 480 | } |
| 481 | |
| 482 | |
| 483 | Handle<Object> Execution::ToInteger(Handle<Object> obj, bool* exc) { |
| 484 | RETURN_NATIVE_CALL(to_integer, 1, { obj.location() }, exc); |
| 485 | } |
| 486 | |
| 487 | |
| 488 | Handle<Object> Execution::ToUint32(Handle<Object> obj, bool* exc) { |
| 489 | RETURN_NATIVE_CALL(to_uint32, 1, { obj.location() }, exc); |
| 490 | } |
| 491 | |
| 492 | |
| 493 | Handle<Object> Execution::ToInt32(Handle<Object> obj, bool* exc) { |
| 494 | RETURN_NATIVE_CALL(to_int32, 1, { obj.location() }, exc); |
| 495 | } |
| 496 | |
| 497 | |
| 498 | Handle<Object> Execution::NewDate(double time, bool* exc) { |
| 499 | Handle<Object> time_obj = Factory::NewNumber(time); |
| 500 | RETURN_NATIVE_CALL(create_date, 1, { time_obj.location() }, exc); |
| 501 | } |
| 502 | |
| 503 | |
| 504 | #undef RETURN_NATIVE_CALL |
| 505 | |
| 506 | |
ager@chromium.org | b61a0d1 | 2010-10-13 08:35:23 +0000 | [diff] [blame] | 507 | Handle<JSRegExp> Execution::NewJSRegExp(Handle<String> pattern, |
| 508 | Handle<String> flags, |
| 509 | bool* exc) { |
| 510 | Handle<Object> re_obj = RegExpImpl::CreateRegExpLiteral( |
| 511 | Handle<JSFunction>(Top::global_context()->regexp_function()), |
| 512 | pattern, |
| 513 | flags, |
| 514 | exc); |
| 515 | if (*exc) return Handle<JSRegExp>(); |
| 516 | return Handle<JSRegExp>::cast(re_obj); |
| 517 | } |
| 518 | |
| 519 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 520 | Handle<Object> Execution::CharAt(Handle<String> string, uint32_t index) { |
| 521 | int int_index = static_cast<int>(index); |
| 522 | if (int_index < 0 || int_index >= string->length()) { |
| 523 | return Factory::undefined_value(); |
| 524 | } |
| 525 | |
| 526 | Handle<Object> char_at = |
| 527 | GetProperty(Top::builtins(), Factory::char_at_symbol()); |
| 528 | if (!char_at->IsJSFunction()) { |
| 529 | return Factory::undefined_value(); |
| 530 | } |
| 531 | |
| 532 | bool caught_exception; |
| 533 | Handle<Object> index_object = Factory::NewNumberFromInt(int_index); |
| 534 | Object** index_arg[] = { index_object.location() }; |
| 535 | Handle<Object> result = TryCall(Handle<JSFunction>::cast(char_at), |
| 536 | string, |
| 537 | ARRAY_SIZE(index_arg), |
| 538 | index_arg, |
| 539 | &caught_exception); |
| 540 | if (caught_exception) { |
| 541 | return Factory::undefined_value(); |
| 542 | } |
| 543 | return result; |
| 544 | } |
| 545 | |
| 546 | |
| 547 | Handle<JSFunction> Execution::InstantiateFunction( |
| 548 | Handle<FunctionTemplateInfo> data, bool* exc) { |
| 549 | // Fast case: see if the function has already been instantiated |
| 550 | int serial_number = Smi::cast(data->serial_number())->value(); |
lrn@chromium.org | 303ada7 | 2010-10-27 09:33:13 +0000 | [diff] [blame] | 551 | Object* elm = Top::global_context()->function_cache()-> |
| 552 | GetElementNoExceptionThrown(serial_number); |
ager@chromium.org | 3291210 | 2009-01-16 10:38:43 +0000 | [diff] [blame] | 553 | if (elm->IsJSFunction()) return Handle<JSFunction>(JSFunction::cast(elm)); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 554 | // The function has not yet been instantiated in this context; do it. |
| 555 | Object** args[1] = { Handle<Object>::cast(data).location() }; |
| 556 | Handle<Object> result = |
| 557 | Call(Top::instantiate_fun(), Top::builtins(), 1, args, exc); |
| 558 | if (*exc) return Handle<JSFunction>::null(); |
| 559 | return Handle<JSFunction>::cast(result); |
| 560 | } |
| 561 | |
| 562 | |
| 563 | Handle<JSObject> Execution::InstantiateObject(Handle<ObjectTemplateInfo> data, |
| 564 | bool* exc) { |
| 565 | if (data->property_list()->IsUndefined() && |
| 566 | !data->constructor()->IsUndefined()) { |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 567 | // Initialization to make gcc happy. |
| 568 | Object* result = NULL; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 569 | { |
| 570 | HandleScope scope; |
| 571 | Handle<FunctionTemplateInfo> cons_template = |
| 572 | Handle<FunctionTemplateInfo>( |
| 573 | FunctionTemplateInfo::cast(data->constructor())); |
| 574 | Handle<JSFunction> cons = InstantiateFunction(cons_template, exc); |
| 575 | if (*exc) return Handle<JSObject>::null(); |
| 576 | Handle<Object> value = New(cons, 0, NULL, exc); |
| 577 | if (*exc) return Handle<JSObject>::null(); |
| 578 | result = *value; |
| 579 | } |
| 580 | ASSERT(!*exc); |
| 581 | return Handle<JSObject>(JSObject::cast(result)); |
| 582 | } else { |
| 583 | Object** args[1] = { Handle<Object>::cast(data).location() }; |
| 584 | Handle<Object> result = |
| 585 | Call(Top::instantiate_fun(), Top::builtins(), 1, args, exc); |
| 586 | if (*exc) return Handle<JSObject>::null(); |
| 587 | return Handle<JSObject>::cast(result); |
| 588 | } |
| 589 | } |
| 590 | |
| 591 | |
| 592 | void Execution::ConfigureInstance(Handle<Object> instance, |
| 593 | Handle<Object> instance_template, |
| 594 | bool* exc) { |
| 595 | Object** args[2] = { instance.location(), instance_template.location() }; |
| 596 | Execution::Call(Top::configure_instance_fun(), Top::builtins(), 2, args, exc); |
| 597 | } |
| 598 | |
| 599 | |
| 600 | Handle<String> Execution::GetStackTraceLine(Handle<Object> recv, |
| 601 | Handle<JSFunction> fun, |
| 602 | Handle<Object> pos, |
| 603 | Handle<Object> is_global) { |
| 604 | const int argc = 4; |
| 605 | Object** args[argc] = { recv.location(), |
| 606 | Handle<Object>::cast(fun).location(), |
| 607 | pos.location(), |
| 608 | is_global.location() }; |
| 609 | bool caught_exception = false; |
| 610 | Handle<Object> result = TryCall(Top::get_stack_trace_line_fun(), |
| 611 | Top::builtins(), argc, args, |
| 612 | &caught_exception); |
| 613 | if (caught_exception || !result->IsString()) return Factory::empty_symbol(); |
| 614 | return Handle<String>::cast(result); |
| 615 | } |
| 616 | |
| 617 | |
christian.plesner.hansen@gmail.com | 37abdec | 2009-01-06 14:43:28 +0000 | [diff] [blame] | 618 | static Object* RuntimePreempt() { |
| 619 | // Clear the preempt request flag. |
| 620 | StackGuard::Continue(PREEMPT); |
| 621 | |
| 622 | ContextSwitcher::PreemptionReceived(); |
| 623 | |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 624 | #ifdef ENABLE_DEBUGGER_SUPPORT |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 625 | if (Debug::InDebugger()) { |
| 626 | // If currently in the debugger don't do any actual preemption but record |
| 627 | // that preemption occoured while in the debugger. |
| 628 | Debug::PreemptionWhileInDebugger(); |
| 629 | } else { |
| 630 | // Perform preemption. |
christian.plesner.hansen@gmail.com | 37abdec | 2009-01-06 14:43:28 +0000 | [diff] [blame] | 631 | v8::Unlocker unlocker; |
| 632 | Thread::YieldCPU(); |
| 633 | } |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 634 | #else |
| 635 | // Perform preemption. |
| 636 | v8::Unlocker unlocker; |
| 637 | Thread::YieldCPU(); |
| 638 | #endif |
christian.plesner.hansen@gmail.com | 37abdec | 2009-01-06 14:43:28 +0000 | [diff] [blame] | 639 | |
| 640 | return Heap::undefined_value(); |
| 641 | } |
| 642 | |
| 643 | |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 644 | #ifdef ENABLE_DEBUGGER_SUPPORT |
christian.plesner.hansen@gmail.com | 37abdec | 2009-01-06 14:43:28 +0000 | [diff] [blame] | 645 | Object* Execution::DebugBreakHelper() { |
| 646 | // Just continue if breaks are disabled. |
| 647 | if (Debug::disable_break()) { |
| 648 | return Heap::undefined_value(); |
| 649 | } |
| 650 | |
kmillikin@chromium.org | 13bd294 | 2009-12-16 15:36:05 +0000 | [diff] [blame] | 651 | // Ignore debug break during bootstrapping. |
| 652 | if (Bootstrapper::IsActive()) { |
| 653 | return Heap::undefined_value(); |
| 654 | } |
| 655 | |
kasperl@chromium.org | e959c18 | 2009-07-27 08:59:04 +0000 | [diff] [blame] | 656 | { |
| 657 | JavaScriptFrameIterator it; |
| 658 | ASSERT(!it.done()); |
| 659 | Object* fun = it.frame()->function(); |
| 660 | if (fun && fun->IsJSFunction()) { |
kasperl@chromium.org | e959c18 | 2009-07-27 08:59:04 +0000 | [diff] [blame] | 661 | // Don't stop in builtin functions. |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame] | 662 | if (JSFunction::cast(fun)->IsBuiltin()) { |
| 663 | return Heap::undefined_value(); |
kasperl@chromium.org | e959c18 | 2009-07-27 08:59:04 +0000 | [diff] [blame] | 664 | } |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame] | 665 | GlobalObject* global = JSFunction::cast(fun)->context()->global(); |
kasperl@chromium.org | e959c18 | 2009-07-27 08:59:04 +0000 | [diff] [blame] | 666 | // Don't stop in debugger functions. |
| 667 | if (Debug::IsDebugGlobal(global)) { |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame] | 668 | return Heap::undefined_value(); |
kasperl@chromium.org | e959c18 | 2009-07-27 08:59:04 +0000 | [diff] [blame] | 669 | } |
| 670 | } |
| 671 | } |
| 672 | |
sgjesse@chromium.org | 755c5b1 | 2009-05-29 11:04:38 +0000 | [diff] [blame] | 673 | // Collect the break state before clearing the flags. |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 674 | bool debug_command_only = |
| 675 | StackGuard::IsDebugCommand() && !StackGuard::IsDebugBreak(); |
| 676 | |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 677 | // Clear the debug break request flag. |
christian.plesner.hansen@gmail.com | 37abdec | 2009-01-06 14:43:28 +0000 | [diff] [blame] | 678 | StackGuard::Continue(DEBUGBREAK); |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 679 | |
| 680 | ProcessDebugMesssages(debug_command_only); |
| 681 | |
| 682 | // Return to continue execution. |
| 683 | return Heap::undefined_value(); |
| 684 | } |
| 685 | |
| 686 | void Execution::ProcessDebugMesssages(bool debug_command_only) { |
| 687 | // Clear the debug command request flag. |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 688 | StackGuard::Continue(DEBUGCOMMAND); |
| 689 | |
christian.plesner.hansen@gmail.com | 37abdec | 2009-01-06 14:43:28 +0000 | [diff] [blame] | 690 | HandleScope scope; |
| 691 | // Enter the debugger. Just continue if we fail to enter the debugger. |
| 692 | EnterDebugger debugger; |
| 693 | if (debugger.FailedToEnter()) { |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 694 | return; |
christian.plesner.hansen@gmail.com | 37abdec | 2009-01-06 14:43:28 +0000 | [diff] [blame] | 695 | } |
| 696 | |
sgjesse@chromium.org | 755c5b1 | 2009-05-29 11:04:38 +0000 | [diff] [blame] | 697 | // Notify the debug event listeners. Indicate auto continue if the break was |
| 698 | // a debug command break. |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 699 | Debugger::OnDebugBreak(Factory::undefined_value(), debug_command_only); |
christian.plesner.hansen@gmail.com | 37abdec | 2009-01-06 14:43:28 +0000 | [diff] [blame] | 700 | } |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 701 | |
| 702 | |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 703 | #endif |
christian.plesner.hansen@gmail.com | 37abdec | 2009-01-06 14:43:28 +0000 | [diff] [blame] | 704 | |
lrn@chromium.org | 303ada7 | 2010-10-27 09:33:13 +0000 | [diff] [blame] | 705 | MaybeObject* Execution::HandleStackGuardInterrupt() { |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 706 | Counters::stack_interrupts.Increment(); |
| 707 | if (StackGuard::IsRuntimeProfilerTick()) { |
| 708 | Counters::runtime_profiler_ticks.Increment(); |
| 709 | StackGuard::Continue(RUNTIME_PROFILER_TICK); |
| 710 | RuntimeProfiler::OptimizeNow(); |
| 711 | } |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 712 | #ifdef ENABLE_DEBUGGER_SUPPORT |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 713 | if (StackGuard::IsDebugBreak() || StackGuard::IsDebugCommand()) { |
| 714 | DebugBreakHelper(); |
| 715 | } |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 716 | #endif |
christian.plesner.hansen@gmail.com | 37abdec | 2009-01-06 14:43:28 +0000 | [diff] [blame] | 717 | if (StackGuard::IsPreempted()) RuntimePreempt(); |
sgjesse@chromium.org | c81c894 | 2009-08-21 10:54:26 +0000 | [diff] [blame] | 718 | if (StackGuard::IsTerminateExecution()) { |
| 719 | StackGuard::Continue(TERMINATE); |
| 720 | return Top::TerminateExecution(); |
| 721 | } |
christian.plesner.hansen@gmail.com | 37abdec | 2009-01-06 14:43:28 +0000 | [diff] [blame] | 722 | if (StackGuard::IsInterrupted()) { |
christian.plesner.hansen@gmail.com | 37abdec | 2009-01-06 14:43:28 +0000 | [diff] [blame] | 723 | StackGuard::Continue(INTERRUPT); |
| 724 | return Top::StackOverflow(); |
| 725 | } |
| 726 | return Heap::undefined_value(); |
| 727 | } |
| 728 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 729 | } } // namespace v8::internal |