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

Side by Side Diff: src/isolate.cc

Issue 9372016: Simplify handler pushing. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 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 | « src/ia32/macro-assembler-ia32.cc ('k') | src/macro-assembler.h » ('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 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after
1016 } 1016 }
1017 } 1017 }
1018 } 1018 }
1019 1019
1020 1020
1021 bool Isolate::ShouldReportException(bool* can_be_caught_externally, 1021 bool Isolate::ShouldReportException(bool* can_be_caught_externally,
1022 bool catchable_by_javascript) { 1022 bool catchable_by_javascript) {
1023 // Find the top-most try-catch handler. 1023 // Find the top-most try-catch handler.
1024 StackHandler* handler = 1024 StackHandler* handler =
1025 StackHandler::FromAddress(Isolate::handler(thread_local_top())); 1025 StackHandler::FromAddress(Isolate::handler(thread_local_top()));
1026 while (handler != NULL && !handler->is_try_catch()) { 1026 while (handler != NULL && !handler->is_catch()) {
1027 handler = handler->next(); 1027 handler = handler->next();
1028 } 1028 }
1029 1029
1030 // Get the address of the external handler so we can compare the address to 1030 // Get the address of the external handler so we can compare the address to
1031 // determine which one is closer to the top of the stack. 1031 // determine which one is closer to the top of the stack.
1032 Address external_handler_address = 1032 Address external_handler_address =
1033 thread_local_top()->try_catch_handler_address(); 1033 thread_local_top()->try_catch_handler_address();
1034 1034
1035 // The exception has been externally caught if and only if there is 1035 // The exception has been externally caught if and only if there is
1036 // an external handler which is on top of the top-most try-catch 1036 // an external handler which is on top of the top-most try-catch
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1186 // handler. 1186 // handler.
1187 // There should be no try-catch blocks as they would prohibit us from 1187 // There should be no try-catch blocks as they would prohibit us from
1188 // finding external catcher in the first place (see catcher_ check above). 1188 // finding external catcher in the first place (see catcher_ check above).
1189 // 1189 //
1190 // Note, that finally clause would rethrow an exception unless it's 1190 // Note, that finally clause would rethrow an exception unless it's
1191 // aborted by jumps in control flow like return, break, etc. and we'll 1191 // aborted by jumps in control flow like return, break, etc. and we'll
1192 // have another chances to set proper v8::TryCatch. 1192 // have another chances to set proper v8::TryCatch.
1193 StackHandler* handler = 1193 StackHandler* handler =
1194 StackHandler::FromAddress(Isolate::handler(thread_local_top())); 1194 StackHandler::FromAddress(Isolate::handler(thread_local_top()));
1195 while (handler != NULL && handler->address() < external_handler_address) { 1195 while (handler != NULL && handler->address() < external_handler_address) {
1196 ASSERT(!handler->is_try_catch()); 1196 ASSERT(!handler->is_catch());
1197 if (handler->is_try_finally()) return false; 1197 if (handler->is_finally()) return false;
1198 1198
1199 handler = handler->next(); 1199 handler = handler->next();
1200 } 1200 }
1201 1201
1202 return true; 1202 return true;
1203 } 1203 }
1204 1204
1205 1205
1206 void Isolate::ReportPendingMessages() { 1206 void Isolate::ReportPendingMessages() {
1207 ASSERT(has_pending_exception()); 1207 ASSERT(has_pending_exception());
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after
1950 1950
1951 #ifdef DEBUG 1951 #ifdef DEBUG
1952 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ 1952 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \
1953 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); 1953 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_);
1954 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) 1954 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET)
1955 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) 1955 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET)
1956 #undef ISOLATE_FIELD_OFFSET 1956 #undef ISOLATE_FIELD_OFFSET
1957 #endif 1957 #endif
1958 1958
1959 } } // namespace v8::internal 1959 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/macro-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698