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 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 } | 1056 } |
1057 | 1057 |
1058 WasmDebugInfo* GetDebugInfo(JSObject* wasm) { | 1058 WasmDebugInfo* GetDebugInfo(JSObject* wasm) { |
1059 Object* info = wasm->GetInternalField(kWasmDebugInfo); | 1059 Object* info = wasm->GetInternalField(kWasmDebugInfo); |
1060 if (!info->IsUndefined(wasm->GetIsolate())) return WasmDebugInfo::cast(info); | 1060 if (!info->IsUndefined(wasm->GetIsolate())) return WasmDebugInfo::cast(info); |
1061 Handle<WasmDebugInfo> new_info = WasmDebugInfo::New(handle(wasm)); | 1061 Handle<WasmDebugInfo> new_info = WasmDebugInfo::New(handle(wasm)); |
1062 wasm->SetInternalField(kWasmDebugInfo, *new_info); | 1062 wasm->SetInternalField(kWasmDebugInfo, *new_info); |
1063 return *new_info; | 1063 return *new_info; |
1064 } | 1064 } |
1065 | 1065 |
| 1066 int GetNumberOfFunctions(JSObject* wasm) { |
| 1067 Object* func_names_obj = wasm->GetInternalField(kWasmFunctionNamesArray); |
| 1068 // TODO(clemensh): this looks inside an array constructed elsewhere. Refactor. |
| 1069 return ByteArray::cast(func_names_obj)->get_int(0); |
| 1070 } |
| 1071 |
1066 } // namespace wasm | 1072 } // namespace wasm |
1067 } // namespace internal | 1073 } // namespace internal |
1068 } // namespace v8 | 1074 } // namespace v8 |
OLD | NEW |