| 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 thread_local_.scheduled_exception_ = Heap::the_hole_value(); | 220 thread_local_.scheduled_exception_ = Heap::the_hole_value(); |
| 221 } | 221 } |
| 222 | 222 |
| 223 static void setup_external_caught() { | 223 static void setup_external_caught() { |
| 224 thread_local_.external_caught_exception_ = | 224 thread_local_.external_caught_exception_ = |
| 225 has_pending_exception() && | 225 has_pending_exception() && |
| 226 (thread_local_.catcher_ != NULL) && | 226 (thread_local_.catcher_ != NULL) && |
| 227 (try_catch_handler() == thread_local_.catcher_); | 227 (try_catch_handler() == thread_local_.catcher_); |
| 228 } | 228 } |
| 229 | 229 |
| 230 static void SetCaptureStackTraceForUncaughtExceptions( |
| 231 bool capture, |
| 232 int frame_limit, |
| 233 StackTrace::StackTraceOptions options); |
| 234 |
| 230 // Tells whether the current context has experienced an out of memory | 235 // Tells whether the current context has experienced an out of memory |
| 231 // exception. | 236 // exception. |
| 232 static bool is_out_of_memory(); | 237 static bool is_out_of_memory(); |
| 233 | 238 |
| 234 // JS execution stack (see frames.h). | 239 // JS execution stack (see frames.h). |
| 235 static Address c_entry_fp(ThreadLocalTop* thread) { | 240 static Address c_entry_fp(ThreadLocalTop* thread) { |
| 236 return thread->c_entry_fp_; | 241 return thread->c_entry_fp_; |
| 237 } | 242 } |
| 238 static Address handler(ThreadLocalTop* thread) { return thread->handler_; } | 243 static Address handler(ThreadLocalTop* thread) { return thread->handler_; } |
| 239 | 244 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 259 static void MarkCompactEpilogue(bool is_compacting); | 264 static void MarkCompactEpilogue(bool is_compacting); |
| 260 static void MarkCompactPrologue(bool is_compacting, | 265 static void MarkCompactPrologue(bool is_compacting, |
| 261 char* archived_thread_data); | 266 char* archived_thread_data); |
| 262 static void MarkCompactEpilogue(bool is_compacting, | 267 static void MarkCompactEpilogue(bool is_compacting, |
| 263 char* archived_thread_data); | 268 char* archived_thread_data); |
| 264 static void PrintCurrentStackTrace(FILE* out); | 269 static void PrintCurrentStackTrace(FILE* out); |
| 265 static void PrintStackTrace(FILE* out, char* thread_data); | 270 static void PrintStackTrace(FILE* out, char* thread_data); |
| 266 static void PrintStack(StringStream* accumulator); | 271 static void PrintStack(StringStream* accumulator); |
| 267 static void PrintStack(); | 272 static void PrintStack(); |
| 268 static Handle<String> StackTraceString(); | 273 static Handle<String> StackTraceString(); |
| 269 static Local<StackTrace> CaptureCurrentStackTrace( | 274 static Handle<JSArray> CaptureCurrentStackTrace( |
| 270 int frame_limit, | 275 int frame_limit, |
| 271 StackTrace::StackTraceOptions options); | 276 StackTrace::StackTraceOptions options); |
| 272 | 277 |
| 273 // Returns if the top context may access the given global object. If | 278 // Returns if the top context may access the given global object. If |
| 274 // the result is false, the pending exception is guaranteed to be | 279 // the result is false, the pending exception is guaranteed to be |
| 275 // set. | 280 // set. |
| 276 static bool MayNamedAccess(JSObject* receiver, | 281 static bool MayNamedAccess(JSObject* receiver, |
| 277 Object* key, | 282 Object* key, |
| 278 v8::AccessType type); | 283 v8::AccessType type); |
| 279 static bool MayIndexedAccess(JSObject* receiver, | 284 static bool MayIndexedAccess(JSObject* receiver, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 295 static void ReportPendingMessages(); | 300 static void ReportPendingMessages(); |
| 296 static Failure* ThrowIllegalOperation(); | 301 static Failure* ThrowIllegalOperation(); |
| 297 | 302 |
| 298 // Promote a scheduled exception to pending. Asserts has_scheduled_exception. | 303 // Promote a scheduled exception to pending. Asserts has_scheduled_exception. |
| 299 static Object* PromoteScheduledException(); | 304 static Object* PromoteScheduledException(); |
| 300 static void DoThrow(Object* exception, | 305 static void DoThrow(Object* exception, |
| 301 MessageLocation* location, | 306 MessageLocation* location, |
| 302 const char* message); | 307 const char* message); |
| 303 static bool ShouldReturnException(bool* is_caught_externally, | 308 static bool ShouldReturnException(bool* is_caught_externally, |
| 304 bool catchable_by_javascript); | 309 bool catchable_by_javascript); |
| 305 static void ReportUncaughtException(Handle<Object> exception, | |
| 306 MessageLocation* location, | |
| 307 Handle<String> stack_trace); | |
| 308 | 310 |
| 309 // Attempts to compute the current source location, storing the | 311 // Attempts to compute the current source location, storing the |
| 310 // result in the target out parameter. | 312 // result in the target out parameter. |
| 311 static void ComputeLocation(MessageLocation* target); | 313 static void ComputeLocation(MessageLocation* target); |
| 312 | 314 |
| 313 // Override command line flag. | 315 // Override command line flag. |
| 314 static void TraceException(bool flag); | 316 static void TraceException(bool flag); |
| 315 | 317 |
| 316 // Out of resource exception helpers. | 318 // Out of resource exception helpers. |
| 317 static Failure* StackOverflow(); | 319 static Failure* StackOverflow(); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 | 454 |
| 453 class ExecutionAccess BASE_EMBEDDED { | 455 class ExecutionAccess BASE_EMBEDDED { |
| 454 public: | 456 public: |
| 455 ExecutionAccess(); | 457 ExecutionAccess(); |
| 456 ~ExecutionAccess(); | 458 ~ExecutionAccess(); |
| 457 }; | 459 }; |
| 458 | 460 |
| 459 } } // namespace v8::internal | 461 } } // namespace v8::internal |
| 460 | 462 |
| 461 #endif // V8_TOP_H_ | 463 #endif // V8_TOP_H_ |
| OLD | NEW |