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