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

Side by Side Diff: src/isolate.cc

Issue 1605633003: [interpreter] First implementation of stack unwinding. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_int-5
Patch Set: Created 4 years, 11 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
OLDNEW
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 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 stack_slots * kPointerSize; 1109 stack_slots * kPointerSize;
1110 1110
1111 // Gather information from the frame. 1111 // Gather information from the frame.
1112 code = frame->LookupCode(); 1112 code = frame->LookupCode();
1113 handler_sp = return_sp; 1113 handler_sp = return_sp;
1114 handler_fp = frame->fp(); 1114 handler_fp = frame->fp();
1115 break; 1115 break;
1116 } 1116 }
1117 } 1117 }
1118 1118
1119 // For interpreted frame we perform a range lookup in the handler table.
1120 if (frame->is_interpreted() && catchable_by_js) {
1121 InterpretedFrame* js_frame = static_cast<InterpretedFrame*>(frame);
1122 int stack_slots = 0; // Will contain stack slot count of frame.
1123 offset = js_frame->LookupExceptionHandlerInTable(&stack_slots, NULL);
1124 if (offset >= 0) {
1125 // Patch the bytecode offset in the interpreted frame to reflect the
1126 // position of the exception handler. The special builtin below will
1127 // take care of continuing to dispatch at that position.
1128 js_frame->PatchBytecodeOffset(static_cast<int>(offset));
1129 offset = 0;
1130
1131 // Gather information from the frame.
1132 code = *builtins()->InterpreterEnterExceptionHandler();
1133 handler_sp = frame->sp();
1134 handler_fp = frame->fp();
1135 break;
1136 }
1137 }
1138
1119 // For JavaScript frames we perform a range lookup in the handler table. 1139 // For JavaScript frames we perform a range lookup in the handler table.
1120 if (frame->is_java_script() && catchable_by_js) { 1140 if (frame->is_java_script() && catchable_by_js) {
1121 JavaScriptFrame* js_frame = static_cast<JavaScriptFrame*>(frame); 1141 JavaScriptFrame* js_frame = static_cast<JavaScriptFrame*>(frame);
1122 int stack_slots = 0; // Will contain operand stack depth of handler. 1142 int stack_slots = 0; // Will contain operand stack depth of handler.
1123 offset = js_frame->LookupExceptionHandlerInTable(&stack_slots, NULL); 1143 offset = js_frame->LookupExceptionHandlerInTable(&stack_slots, NULL);
1124 if (offset >= 0) { 1144 if (offset >= 0) {
1125 // Compute the stack pointer from the frame pointer. This ensures that 1145 // Compute the stack pointer from the frame pointer. This ensures that
1126 // operand stack slots are dropped for nested statements. Also restore 1146 // operand stack slots are dropped for nested statements. Also restore
1127 // correct context for the handler which is pushed within the try-block. 1147 // correct context for the handler which is pushed within the try-block.
1128 Address return_sp = frame->fp() - 1148 Address return_sp = frame->fp() -
(...skipping 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after
2829 // Then check whether this scope intercepts. 2849 // Then check whether this scope intercepts.
2830 if ((flag & intercept_mask_)) { 2850 if ((flag & intercept_mask_)) {
2831 intercepted_flags_ |= flag; 2851 intercepted_flags_ |= flag;
2832 return true; 2852 return true;
2833 } 2853 }
2834 return false; 2854 return false;
2835 } 2855 }
2836 2856
2837 } // namespace internal 2857 } // namespace internal
2838 } // namespace v8 2858 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698