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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
242 ASSERT(has_scheduled_exception()); | 242 ASSERT(has_scheduled_exception()); |
243 return thread_local_.scheduled_exception_; | 243 return thread_local_.scheduled_exception_; |
244 } | 244 } |
245 static bool has_scheduled_exception() { | 245 static bool has_scheduled_exception() { |
246 return !thread_local_.scheduled_exception_->IsTheHole(); | 246 return !thread_local_.scheduled_exception_->IsTheHole(); |
247 } | 247 } |
248 static void clear_scheduled_exception() { | 248 static void clear_scheduled_exception() { |
249 thread_local_.scheduled_exception_ = Heap::the_hole_value(); | 249 thread_local_.scheduled_exception_ = Heap::the_hole_value(); |
250 } | 250 } |
251 | 251 |
252 static void setup_external_caught() { | 252 static bool IsExternallyCaught(); |
253 thread_local_.external_caught_exception_ = | |
254 has_pending_exception() && | |
255 (thread_local_.catcher_ != NULL) && | |
256 (try_catch_handler() == thread_local_.catcher_); | |
257 } | |
258 | 253 |
259 static void SetCaptureStackTraceForUncaughtExceptions( | 254 static void SetCaptureStackTraceForUncaughtExceptions( |
260 bool capture, | 255 bool capture, |
261 int frame_limit, | 256 int frame_limit, |
262 StackTrace::StackTraceOptions options); | 257 StackTrace::StackTraceOptions options); |
263 | 258 |
264 // Tells whether the current context has experienced an out of memory | 259 // Tells whether the current context has experienced an out of memory |
265 // exception. | 260 // exception. |
266 static bool is_out_of_memory(); | 261 static bool is_out_of_memory(); |
267 | 262 |
263 static bool is_catchable_by_javascript(MaybeObject* exception) { | |
264 return | |
Mads Ager (chromium)
2011/02/16 09:17:49
Why the extra line? I would probably do:
return (
antonm
2011/02/16 11:40:44
I find it more aesthetically pleasing to have this
| |
265 (exception != Failure::OutOfMemoryException()) && | |
266 (exception != Heap::termination_exception()); | |
267 } | |
268 | |
268 // JS execution stack (see frames.h). | 269 // JS execution stack (see frames.h). |
269 static Address c_entry_fp(ThreadLocalTop* thread) { | 270 static Address c_entry_fp(ThreadLocalTop* thread) { |
270 return thread->c_entry_fp_; | 271 return thread->c_entry_fp_; |
271 } | 272 } |
272 static Address handler(ThreadLocalTop* thread) { return thread->handler_; } | 273 static Address handler(ThreadLocalTop* thread) { return thread->handler_; } |
273 | 274 |
274 static inline Address* c_entry_fp_address() { | 275 static inline Address* c_entry_fp_address() { |
275 return &thread_local_.c_entry_fp_; | 276 return &thread_local_.c_entry_fp_; |
276 } | 277 } |
277 static inline Address* handler_address() { return &thread_local_.handler_; } | 278 static inline Address* handler_address() { return &thread_local_.handler_; } |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
390 static void ReportPendingMessages(); | 391 static void ReportPendingMessages(); |
391 static Failure* ThrowIllegalOperation(); | 392 static Failure* ThrowIllegalOperation(); |
392 | 393 |
393 // Promote a scheduled exception to pending. Asserts has_scheduled_exception. | 394 // Promote a scheduled exception to pending. Asserts has_scheduled_exception. |
394 static Failure* PromoteScheduledException(); | 395 static Failure* PromoteScheduledException(); |
395 static void DoThrow(MaybeObject* exception, | 396 static void DoThrow(MaybeObject* exception, |
396 MessageLocation* location, | 397 MessageLocation* location, |
397 const char* message); | 398 const char* message); |
398 // Checks if exception should be reported and finds out if it's | 399 // Checks if exception should be reported and finds out if it's |
399 // caught externally. | 400 // caught externally. |
400 static bool ShouldReportException(bool* is_caught_externally, | 401 static bool ShouldReportException(bool* can_be_caught_externally, |
401 bool catchable_by_javascript); | 402 bool catchable_by_javascript); |
402 | 403 |
403 // Attempts to compute the current source location, storing the | 404 // Attempts to compute the current source location, storing the |
404 // result in the target out parameter. | 405 // result in the target out parameter. |
405 static void ComputeLocation(MessageLocation* target); | 406 static void ComputeLocation(MessageLocation* target); |
406 | 407 |
407 // Override command line flag. | 408 // Override command line flag. |
408 static void TraceException(bool flag); | 409 static void TraceException(bool flag); |
409 | 410 |
410 // Out of resource exception helpers. | 411 // Out of resource exception helpers. |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
599 static void Unlock() { Top::break_access_->Unlock(); } | 600 static void Unlock() { Top::break_access_->Unlock(); } |
600 | 601 |
601 static bool TryLock() { | 602 static bool TryLock() { |
602 return Top::break_access_->TryLock(); | 603 return Top::break_access_->TryLock(); |
603 } | 604 } |
604 }; | 605 }; |
605 | 606 |
606 } } // namespace v8::internal | 607 } } // namespace v8::internal |
607 | 608 |
608 #endif // V8_TOP_H_ | 609 #endif // V8_TOP_H_ |
OLD | NEW |