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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 NONE); | 598 NONE); |
599 } | 599 } |
600 return stack_frame; | 600 return stack_frame; |
601 } | 601 } |
602 | 602 |
603 Handle<JSObject> NewStackFrameObject(WasmFrame* frame) { | 603 Handle<JSObject> NewStackFrameObject(WasmFrame* frame) { |
604 Handle<JSObject> stack_frame = | 604 Handle<JSObject> stack_frame = |
605 factory()->NewJSObject(isolate_->object_function()); | 605 factory()->NewJSObject(isolate_->object_function()); |
606 | 606 |
607 if (!function_key_.is_null()) { | 607 if (!function_key_.is_null()) { |
608 Object* wasm_object = frame->wasm_obj(); | 608 Handle<String> name = wasm::GetWasmFunctionName( |
609 Handle<String> name; | 609 isolate_, handle(frame->wasm_obj(), isolate_), |
610 if (!wasm_object->IsUndefined(isolate_)) { | 610 frame->function_index()); |
611 Handle<JSObject> wasm = handle(JSObject::cast(wasm_object)); | |
612 wasm::GetWasmFunctionName(wasm, frame->function_index()) | |
613 .ToHandle(&name); | |
614 } | |
615 if (name.is_null()) { | |
616 name = isolate_->factory()->NewStringFromStaticChars("<WASM UNNAMED>"); | |
617 } | |
618 JSObject::AddProperty(stack_frame, function_key_, name, NONE); | 611 JSObject::AddProperty(stack_frame, function_key_, name, NONE); |
619 } | 612 } |
620 // Encode the function index as line number. | 613 // Encode the function index as line number. |
621 if (!line_key_.is_null()) { | 614 if (!line_key_.is_null()) { |
622 JSObject::AddProperty( | 615 JSObject::AddProperty( |
623 stack_frame, line_key_, | 616 stack_frame, line_key_, |
624 isolate_->factory()->NewNumberFromInt(frame->function_index()), NONE); | 617 isolate_->factory()->NewNumberFromInt(frame->function_index()), NONE); |
625 } | 618 } |
626 // Encode the byte offset as column. | 619 // Encode the byte offset as column. |
627 if (!column_key_.is_null()) { | 620 if (!column_key_.is_null()) { |
(...skipping 2435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3063 // Then check whether this scope intercepts. | 3056 // Then check whether this scope intercepts. |
3064 if ((flag & intercept_mask_)) { | 3057 if ((flag & intercept_mask_)) { |
3065 intercepted_flags_ |= flag; | 3058 intercepted_flags_ |= flag; |
3066 return true; | 3059 return true; |
3067 } | 3060 } |
3068 return false; | 3061 return false; |
3069 } | 3062 } |
3070 | 3063 |
3071 } // namespace internal | 3064 } // namespace internal |
3072 } // namespace v8 | 3065 } // namespace v8 |
OLD | NEW |