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 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1292 if (RelocInfo::IsWasmMemoryReference(mode) || | 1292 if (RelocInfo::IsWasmMemoryReference(mode) || |
1293 RelocInfo::IsWasmMemorySizeReference(mode)) { | 1293 RelocInfo::IsWasmMemorySizeReference(mode)) { |
1294 it.rinfo()->update_wasm_memory_reference(old_start, new_start, old_size, | 1294 it.rinfo()->update_wasm_memory_reference(old_start, new_start, old_size, |
1295 new_size); | 1295 new_size); |
1296 } | 1296 } |
1297 } | 1297 } |
1298 } | 1298 } |
1299 return true; | 1299 return true; |
1300 } | 1300 } |
1301 | 1301 |
| 1302 int GetNumberOfFunctions(JSObject* wasm) { |
| 1303 Object* func_names_obj = wasm->GetInternalField(kWasmFunctionNamesArray); |
| 1304 // TODO(clemensh): this looks inside an array constructed elsewhere. Refactor. |
| 1305 return ByteArray::cast(func_names_obj)->get_int(0); |
| 1306 } |
| 1307 |
1302 namespace testing { | 1308 namespace testing { |
1303 | 1309 |
1304 int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start, | 1310 int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start, |
1305 const byte* module_end, bool asm_js) { | 1311 const byte* module_end, bool asm_js) { |
1306 HandleScope scope(isolate); | 1312 HandleScope scope(isolate); |
1307 Zone zone(isolate->allocator()); | 1313 Zone zone(isolate->allocator()); |
1308 ErrorThrower thrower(isolate, "CompileAndRunWasmModule"); | 1314 ErrorThrower thrower(isolate, "CompileAndRunWasmModule"); |
1309 | 1315 |
1310 // Decode the module, but don't verify function bodies, since we'll | 1316 // Decode the module, but don't verify function bodies, since we'll |
1311 // be compiling them anyway. | 1317 // be compiling them anyway. |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1368 return static_cast<int32_t>(HeapNumber::cast(*result)->value()); | 1374 return static_cast<int32_t>(HeapNumber::cast(*result)->value()); |
1369 } | 1375 } |
1370 thrower.Error("WASM.compileRun() failed: Return value should be number"); | 1376 thrower.Error("WASM.compileRun() failed: Return value should be number"); |
1371 return -1; | 1377 return -1; |
1372 } | 1378 } |
1373 | 1379 |
1374 } // namespace testing | 1380 } // namespace testing |
1375 } // namespace wasm | 1381 } // namespace wasm |
1376 } // namespace internal | 1382 } // namespace internal |
1377 } // namespace v8 | 1383 } // namespace v8 |
OLD | NEW |