Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Unified Diff: src/isolate.h

Issue 227163008: Change exception type to Object. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.h
diff --git a/src/isolate.h b/src/isolate.h
index 67edad3fa7df7dae3ec2072338116566b83d3d9a..7035b06f84f0bf6c4c9d61d8001ac2d96994335b 100644
--- a/src/isolate.h
+++ b/src/isolate.h
@@ -292,7 +292,7 @@ class ThreadLocalTop BASE_EMBEDDED {
// lookups.
Context* context_;
ThreadId thread_id_;
- MaybeObject* pending_exception_;
+ Object* pending_exception_;
bool has_pending_message_;
bool rethrowing_message_;
Object* pending_message_obj_;
@@ -302,7 +302,7 @@ class ThreadLocalTop BASE_EMBEDDED {
// Use a separate value for scheduled exceptions to preserve the
// invariants that hold about pending_exception. We may want to
// unify them later.
- MaybeObject* scheduled_exception_;
+ Object* scheduled_exception_;
bool external_caught_exception_;
SaveContext* save_context_;
v8::TryCatch* catcher_;
@@ -608,24 +608,28 @@ class Isolate {
THREAD_LOCAL_TOP_ACCESSOR(ThreadId, thread_id)
// Interface to pending exception.
- MaybeObject* pending_exception() {
+ Object* pending_exception() {
ASSERT(has_pending_exception());
+ ASSERT(!thread_local_top_.pending_exception_->IsFailure());
return thread_local_top_.pending_exception_;
}
- void set_pending_exception(MaybeObject* exception) {
+ void set_pending_exception(Object* exception) {
+ ASSERT(!exception->IsFailure());
thread_local_top_.pending_exception_ = exception;
}
void clear_pending_exception() {
+ ASSERT(!thread_local_top_.pending_exception_->IsFailure());
thread_local_top_.pending_exception_ = heap_.the_hole_value();
}
- MaybeObject** pending_exception_address() {
+ Object** pending_exception_address() {
return &thread_local_top_.pending_exception_;
}
bool has_pending_exception() {
+ ASSERT(!thread_local_top_.pending_exception_->IsFailure());
return !thread_local_top_.pending_exception_->IsTheHole();
}
@@ -648,7 +652,7 @@ class Isolate {
THREAD_LOCAL_TOP_ACCESSOR(v8::TryCatch*, catcher)
- MaybeObject** scheduled_exception_address() {
+ Object** scheduled_exception_address() {
return &thread_local_top_.scheduled_exception_;
}
@@ -665,20 +669,23 @@ class Isolate {
&thread_local_top_.pending_message_script_);
}
- MaybeObject* scheduled_exception() {
+ Object* scheduled_exception() {
ASSERT(has_scheduled_exception());
+ ASSERT(!thread_local_top_.scheduled_exception_->IsFailure());
return thread_local_top_.scheduled_exception_;
}
bool has_scheduled_exception() {
+ ASSERT(!thread_local_top_.scheduled_exception_->IsFailure());
return thread_local_top_.scheduled_exception_ != heap_.the_hole_value();
}
void clear_scheduled_exception() {
+ ASSERT(!thread_local_top_.scheduled_exception_->IsFailure());
thread_local_top_.scheduled_exception_ = heap_.the_hole_value();
}
bool IsExternallyCaught();
- bool is_catchable_by_javascript(MaybeObject* exception) {
+ bool is_catchable_by_javascript(Object* exception) {
return exception != heap()->termination_exception();
}
@@ -737,8 +744,7 @@ class Isolate {
// Scope currently can only be used for regular exceptions, not
// failures like OOM or termination exception.
isolate_(isolate),
- pending_exception_(isolate_->pending_exception()->ToObjectUnchecked(),
- isolate_),
+ pending_exception_(isolate_->pending_exception(), isolate_),
catcher_(isolate_->catcher())
{ }
@@ -819,7 +825,7 @@ class Isolate {
// Re-throw an exception. This involves no error reporting since
// error reporting was handled when the exception was thrown
// originally.
- Failure* ReThrow(MaybeObject* exception);
+ Failure* ReThrow(Object* exception);
void ScheduleThrow(Object* exception);
// Re-set pending message, script and positions reported to the TryCatch
// back to the TLS for re-use when rethrowing.
« no previous file with comments | « no previous file | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698