OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
9 #include "src/debug/debug-frames.h" | 9 #include "src/debug/debug-frames.h" |
10 #include "src/debug/liveedit.h" | 10 #include "src/debug/liveedit.h" |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 CONVERT_NUMBER_CHECKED(int, index, Int32, args[1]); | 264 CONVERT_NUMBER_CHECKED(int, index, Int32, args[1]); |
265 Heap* heap = isolate->heap(); | 265 Heap* heap = isolate->heap(); |
266 | 266 |
267 // Find the relevant frame with the requested index. | 267 // Find the relevant frame with the requested index. |
268 StackFrame::Id id = isolate->debug()->break_frame_id(); | 268 StackFrame::Id id = isolate->debug()->break_frame_id(); |
269 if (id == StackFrame::NO_ID) { | 269 if (id == StackFrame::NO_ID) { |
270 // If there are no JavaScript stack frames return undefined. | 270 // If there are no JavaScript stack frames return undefined. |
271 return heap->undefined_value(); | 271 return heap->undefined_value(); |
272 } | 272 } |
273 | 273 |
274 JavaScriptFrameIterator it(isolate, id); | 274 StackTraceFrameIterator it(isolate, id); |
275 int inlined_jsframe_index = | 275 int inlined_jsframe_index = |
276 DebugFrameHelper::FindIndexedNonNativeFrame(&it, index); | 276 DebugFrameHelper::FindIndexedNonNativeFrame(&it, index); |
277 if (inlined_jsframe_index == -1) return heap->undefined_value(); | 277 // Liveedit is not supported on Wasm. |
| 278 if (inlined_jsframe_index == -1 || it.is_wasm()) { |
| 279 return heap->undefined_value(); |
| 280 } |
278 // We don't really care what the inlined frame index is, since we are | 281 // We don't really care what the inlined frame index is, since we are |
279 // throwing away the entire frame anyways. | 282 // throwing away the entire frame anyways. |
280 const char* error_message = LiveEdit::RestartFrame(it.frame()); | 283 const char* error_message = LiveEdit::RestartFrame(it.javascript_frame()); |
281 if (error_message) { | 284 if (error_message) { |
282 return *(isolate->factory()->InternalizeUtf8String(error_message)); | 285 return *(isolate->factory()->InternalizeUtf8String(error_message)); |
283 } | 286 } |
284 return heap->true_value(); | 287 return heap->true_value(); |
285 } | 288 } |
286 } // namespace internal | 289 } // namespace internal |
287 } // namespace v8 | 290 } // namespace v8 |
OLD | NEW |