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 21 matching lines...) Expand all Loading... |
32 #include "src/profiler/cpu-profiler.h" | 32 #include "src/profiler/cpu-profiler.h" |
33 #include "src/profiler/sampler.h" | 33 #include "src/profiler/sampler.h" |
34 #include "src/prototype.h" | 34 #include "src/prototype.h" |
35 #include "src/regexp/regexp-stack.h" | 35 #include "src/regexp/regexp-stack.h" |
36 #include "src/runtime-profiler.h" | 36 #include "src/runtime-profiler.h" |
37 #include "src/simulator.h" | 37 #include "src/simulator.h" |
38 #include "src/snapshot/deserializer.h" | 38 #include "src/snapshot/deserializer.h" |
39 #include "src/v8.h" | 39 #include "src/v8.h" |
40 #include "src/version.h" | 40 #include "src/version.h" |
41 #include "src/vm-state-inl.h" | 41 #include "src/vm-state-inl.h" |
42 | 42 #include "src/wasm/wasm-module.h" |
43 | 43 |
44 namespace v8 { | 44 namespace v8 { |
45 namespace internal { | 45 namespace internal { |
46 | 46 |
47 base::Atomic32 ThreadId::highest_thread_id_ = 0; | 47 base::Atomic32 ThreadId::highest_thread_id_ = 0; |
48 | 48 |
49 int ThreadId::AllocateThreadId() { | 49 int ThreadId::AllocateThreadId() { |
50 int new_id = base::NoBarrier_AtomicIncrement(&highest_thread_id_, 1); | 50 int new_id = base::NoBarrier_AtomicIncrement(&highest_thread_id_, 1); |
51 return new_id; | 51 return new_id; |
52 } | 52 } |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 NONE); | 609 NONE); |
610 } | 610 } |
611 return stack_frame; | 611 return stack_frame; |
612 } | 612 } |
613 | 613 |
614 Handle<JSObject> NewStackFrameObject(WasmFrame* frame) { | 614 Handle<JSObject> NewStackFrameObject(WasmFrame* frame) { |
615 Handle<JSObject> stack_frame = | 615 Handle<JSObject> stack_frame = |
616 factory()->NewJSObject(isolate_->object_function()); | 616 factory()->NewJSObject(isolate_->object_function()); |
617 | 617 |
618 if (!function_key_.is_null()) { | 618 if (!function_key_.is_null()) { |
619 Handle<Object> fun_name = handle(frame->function_name(), isolate_); | 619 Object* wasm_object = frame->wasm_obj(); |
620 if (fun_name->IsUndefined()) | 620 Handle<String> name; |
621 fun_name = isolate_->factory()->InternalizeUtf8String( | 621 if (!wasm_object->IsUndefined()) { |
622 Vector<const char>("<WASM>")); | 622 Handle<JSObject> wasm = handle(JSObject::cast(wasm_object)); |
623 JSObject::AddProperty(stack_frame, function_key_, fun_name, NONE); | 623 wasm::GetWasmFunctionName(wasm, frame->function_index()) |
| 624 .ToHandle(&name); |
| 625 } |
| 626 if (name.is_null()) { |
| 627 name = isolate_->factory()->NewStringFromStaticChars("<WASM UNNAMED>"); |
| 628 } |
| 629 JSObject::AddProperty(stack_frame, function_key_, name, NONE); |
624 } | 630 } |
625 // Encode the function index as line number. | 631 // Encode the function index as line number. |
626 if (!line_key_.is_null()) { | 632 if (!line_key_.is_null()) { |
627 JSObject::AddProperty( | 633 JSObject::AddProperty( |
628 stack_frame, line_key_, | 634 stack_frame, line_key_, |
629 isolate_->factory()->NewNumberFromInt(frame->function_index()), NONE); | 635 isolate_->factory()->NewNumberFromInt(frame->function_index()), NONE); |
630 } | 636 } |
631 // Encode the byte offset as column. | 637 // Encode the byte offset as column. |
632 if (!column_key_.is_null()) { | 638 if (!column_key_.is_null()) { |
633 Code* code = frame->LookupCode(); | 639 Code* code = frame->LookupCode(); |
(...skipping 2428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3062 // Then check whether this scope intercepts. | 3068 // Then check whether this scope intercepts. |
3063 if ((flag & intercept_mask_)) { | 3069 if ((flag & intercept_mask_)) { |
3064 intercepted_flags_ |= flag; | 3070 intercepted_flags_ |= flag; |
3065 return true; | 3071 return true; |
3066 } | 3072 } |
3067 return false; | 3073 return false; |
3068 } | 3074 } |
3069 | 3075 |
3070 } // namespace internal | 3076 } // namespace internal |
3071 } // namespace v8 | 3077 } // namespace v8 |
OLD | NEW |