OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/isolate.h" | 5 #include "src/isolate.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include <fstream> // NOLINT(readability/streams) | 9 #include <fstream> // NOLINT(readability/streams) |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1273 context = Context::cast(Memory::Object_at(return_sp - kPointerSize)); | 1273 context = Context::cast(Memory::Object_at(return_sp - kPointerSize)); |
1274 | 1274 |
1275 // Gather information from the frame. | 1275 // Gather information from the frame. |
1276 code = frame->LookupCode(); | 1276 code = frame->LookupCode(); |
1277 handler_sp = return_sp; | 1277 handler_sp = return_sp; |
1278 handler_fp = frame->fp(); | 1278 handler_fp = frame->fp(); |
1279 break; | 1279 break; |
1280 } | 1280 } |
1281 } | 1281 } |
1282 | 1282 |
1283 if (frame->is_stub() && catchable_by_js) { | |
1284 StubFrame* stub_frame = StubFrame::cast(frame); | |
1285 int stack_depth = 0; | |
1286 int code_offset = | |
1287 stub_frame->LookupExceptionHandlerInTable(&stack_depth, nullptr); | |
1288 if (code_offset >= 0) { | |
1289 Address return_sp = frame->fp() - | |
1290 StandardFrameConstants::kFixedFrameSizeFromFp - | |
1291 stack_depth * kPointerSize; | |
1292 STATIC_ASSERT(TryBlockConstant::kElementCount == 1); | |
1293 Object* maybe_context = Memory::Object_at(return_sp - kPointerSize); | |
1294 context = maybe_context->IsContext() ? Context::cast(maybe_context) | |
1295 : raw_native_context(); | |
caitp
2016/08/18 03:08:57
I'm not sure about this:
For TFJ builtins, it loo
| |
1296 | |
1297 code = frame->LookupCode(); | |
1298 handler_sp = return_sp; | |
1299 handler_fp = frame->fp(); | |
1300 offset = code_offset; | |
caitp
2016/08/18 03:08:57
Without setting the offset, the stub is restarted
| |
1301 break; | |
1302 } | |
1303 } | |
1304 | |
1283 RemoveMaterializedObjectsOnUnwind(frame); | 1305 RemoveMaterializedObjectsOnUnwind(frame); |
1284 } | 1306 } |
1285 | 1307 |
1286 // Handler must exist. | 1308 // Handler must exist. |
1287 CHECK(code != nullptr); | 1309 CHECK(code != nullptr); |
1288 | 1310 |
1289 // Store information to be consumed by the CEntryStub. | 1311 // Store information to be consumed by the CEntryStub. |
1290 thread_local_top()->pending_handler_context_ = context; | 1312 thread_local_top()->pending_handler_context_ = context; |
1291 thread_local_top()->pending_handler_code_ = code; | 1313 thread_local_top()->pending_handler_code_ = code; |
1292 thread_local_top()->pending_handler_offset_ = offset; | 1314 thread_local_top()->pending_handler_offset_ = offset; |
(...skipping 1903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3196 // Then check whether this scope intercepts. | 3218 // Then check whether this scope intercepts. |
3197 if ((flag & intercept_mask_)) { | 3219 if ((flag & intercept_mask_)) { |
3198 intercepted_flags_ |= flag; | 3220 intercepted_flags_ |= flag; |
3199 return true; | 3221 return true; |
3200 } | 3222 } |
3201 return false; | 3223 return false; |
3202 } | 3224 } |
3203 | 3225 |
3204 } // namespace internal | 3226 } // namespace internal |
3205 } // namespace v8 | 3227 } // namespace v8 |
OLD | NEW |