OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/base/atomic-utils.h" | 5 #include "src/base/atomic-utils.h" |
6 #include "src/macro-assembler.h" | 6 #include "src/macro-assembler.h" |
7 #include "src/objects.h" | 7 #include "src/objects.h" |
8 #include "src/property-descriptor.h" | 8 #include "src/property-descriptor.h" |
9 #include "src/v8.h" | 9 #include "src/v8.h" |
10 | 10 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 os << (module.max_mem_pages * module.kPageSize) << " max mem"; | 81 os << (module.max_mem_pages * module.kPageSize) << " max mem"; |
82 os << module.functions.size() << " functions"; | 82 os << module.functions.size() << " functions"; |
83 os << module.functions.size() << " globals"; | 83 os << module.functions.size() << " globals"; |
84 os << module.functions.size() << " data segments"; | 84 os << module.functions.size() << " data segments"; |
85 return os; | 85 return os; |
86 } | 86 } |
87 | 87 |
88 std::ostream& operator<<(std::ostream& os, const WasmFunction& function) { | 88 std::ostream& operator<<(std::ostream& os, const WasmFunction& function) { |
89 os << "WASM function with signature " << *function.sig; | 89 os << "WASM function with signature " << *function.sig; |
90 | 90 |
91 os << " locals: "; | |
92 if (function.local_i32_count) os << function.local_i32_count << " i32s "; | |
93 if (function.local_i64_count) os << function.local_i64_count << " i64s "; | |
94 if (function.local_f32_count) os << function.local_f32_count << " f32s "; | |
95 if (function.local_f64_count) os << function.local_f64_count << " f64s "; | |
96 | |
97 os << " code bytes: " | 91 os << " code bytes: " |
98 << (function.code_end_offset - function.code_start_offset); | 92 << (function.code_end_offset - function.code_start_offset); |
99 return os; | 93 return os; |
100 } | 94 } |
101 | 95 |
102 std::ostream& operator<<(std::ostream& os, const WasmFunctionName& pair) { | 96 std::ostream& operator<<(std::ostream& os, const WasmFunctionName& pair) { |
103 os << "#" << pair.function_->func_index << ":"; | 97 os << "#" << pair.function_->func_index << ":"; |
104 if (pair.function_->name_offset > 0) { | 98 if (pair.function_->name_offset > 0) { |
105 if (pair.module_) { | 99 if (pair.module_) { |
106 WasmName name = pair.module_->GetName(pair.function_->name_offset, | 100 WasmName name = pair.module_->GetName(pair.function_->name_offset, |
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
988 wasm->GetInternalField(kWasmFunctionNamesArray), wasm->GetIsolate()); | 982 wasm->GetInternalField(kWasmFunctionNamesArray), wasm->GetIsolate()); |
989 if (func_names_arr_obj->IsUndefined()) | 983 if (func_names_arr_obj->IsUndefined()) |
990 return func_names_arr_obj; // Return undefined. | 984 return func_names_arr_obj; // Return undefined. |
991 return GetWasmFunctionNameFromTable( | 985 return GetWasmFunctionNameFromTable( |
992 Handle<ByteArray>::cast(func_names_arr_obj), func_index); | 986 Handle<ByteArray>::cast(func_names_arr_obj), func_index); |
993 } | 987 } |
994 | 988 |
995 } // namespace wasm | 989 } // namespace wasm |
996 } // namespace internal | 990 } // namespace internal |
997 } // namespace v8 | 991 } // namespace v8 |
OLD | NEW |