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

Side by Side Diff: src/isolate.cc

Issue 10555004: Fix external exceptions in external try-catch handlers. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 927 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 938
939 Failure* Isolate::ThrowIllegalOperation() { 939 Failure* Isolate::ThrowIllegalOperation() {
940 return Throw(heap_.illegal_access_symbol()); 940 return Throw(heap_.illegal_access_symbol());
941 } 941 }
942 942
943 943
944 void Isolate::ScheduleThrow(Object* exception) { 944 void Isolate::ScheduleThrow(Object* exception) {
945 // When scheduling a throw we first throw the exception to get the 945 // When scheduling a throw we first throw the exception to get the
946 // error reporting if it is uncaught before rescheduling it. 946 // error reporting if it is uncaught before rescheduling it.
947 Throw(exception); 947 Throw(exception);
948 thread_local_top()->scheduled_exception_ = pending_exception(); 948 PropagatePendingExceptionToExternalTryCatch();
949 thread_local_top()->external_caught_exception_ = false; 949 if (has_pending_exception()) {
950 clear_pending_exception(); 950 thread_local_top()->scheduled_exception_ = pending_exception();
951 thread_local_top()->external_caught_exception_ = false;
952 clear_pending_exception();
953 }
951 } 954 }
952 955
953 956
954 Failure* Isolate::PromoteScheduledException() { 957 Failure* Isolate::PromoteScheduledException() {
955 MaybeObject* thrown = scheduled_exception(); 958 MaybeObject* thrown = scheduled_exception();
956 clear_scheduled_exception(); 959 clear_scheduled_exception();
957 // Re-throw the exception to avoid getting repeated error reporting. 960 // Re-throw the exception to avoid getting repeated error reporting.
958 return ReThrow(thrown); 961 return ReThrow(thrown);
959 } 962 }
960 963
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after
1961 1964
1962 #ifdef DEBUG 1965 #ifdef DEBUG
1963 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ 1966 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \
1964 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); 1967 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_);
1965 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) 1968 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET)
1966 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) 1969 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET)
1967 #undef ISOLATE_FIELD_OFFSET 1970 #undef ISOLATE_FIELD_OFFSET
1968 #endif 1971 #endif
1969 1972
1970 } } // namespace v8::internal 1973 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698