| 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 <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "src/base/atomic-utils.h" | 7 #include "src/base/atomic-utils.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 | 9 |
| 10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
| (...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1463 } | 1463 } |
| 1464 WasmIndirectFunctionTable& table = | 1464 WasmIndirectFunctionTable& table = |
| 1465 module_->function_tables[num_imported_tables]; | 1465 module_->function_tables[num_imported_tables]; |
| 1466 TableInstance& table_instance = table_instances_[num_imported_tables]; | 1466 TableInstance& table_instance = table_instances_[num_imported_tables]; |
| 1467 table_instance.table_object = Handle<JSObject>::cast(value); | 1467 table_instance.table_object = Handle<JSObject>::cast(value); |
| 1468 table_instance.js_wrappers = WasmJs::GetWasmTableFunctions( | 1468 table_instance.js_wrappers = WasmJs::GetWasmTableFunctions( |
| 1469 isolate_, table_instance.table_object); | 1469 isolate_, table_instance.table_object); |
| 1470 | 1470 |
| 1471 // TODO(titzer): import table size must match exactly for now. | 1471 // TODO(titzer): import table size must match exactly for now. |
| 1472 int table_size = table_instance.js_wrappers->length(); | 1472 int table_size = table_instance.js_wrappers->length(); |
| 1473 if (table_size != table.min_size) { | 1473 if (table_size != static_cast<int>(table.min_size)) { |
| 1474 thrower_->TypeError( | 1474 thrower_->TypeError( |
| 1475 "table import %d is wrong size (%d), expected %u", index, | 1475 "table import %d is wrong size (%d), expected %u", index, |
| 1476 table_size, table.min_size); | 1476 table_size, table.min_size); |
| 1477 return -1; | 1477 return -1; |
| 1478 } | 1478 } |
| 1479 | 1479 |
| 1480 // Allocate a new dispatch table. | 1480 // Allocate a new dispatch table. |
| 1481 table_instance.dispatch_table = | 1481 table_instance.dispatch_table = |
| 1482 isolate_->factory()->NewFixedArray(table_size * 2); | 1482 isolate_->factory()->NewFixedArray(table_size * 2); |
| 1483 for (int i = 0; i < table_size * 2; ++i) { | 1483 for (int i = 0; i < table_size * 2; ++i) { |
| (...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2250 CHECK_NOT_NULL(result.val); | 2250 CHECK_NOT_NULL(result.val); |
| 2251 module = const_cast<WasmModule*>(result.val); | 2251 module = const_cast<WasmModule*>(result.val); |
| 2252 } | 2252 } |
| 2253 | 2253 |
| 2254 Handle<WasmModuleWrapper> module_wrapper = | 2254 Handle<WasmModuleWrapper> module_wrapper = |
| 2255 WasmModuleWrapper::New(isolate, module); | 2255 WasmModuleWrapper::New(isolate, module); |
| 2256 | 2256 |
| 2257 compiled_module->set_module_wrapper(module_wrapper); | 2257 compiled_module->set_module_wrapper(module_wrapper); |
| 2258 DCHECK(WasmCompiledModule::IsWasmCompiledModule(*compiled_module)); | 2258 DCHECK(WasmCompiledModule::IsWasmCompiledModule(*compiled_module)); |
| 2259 } | 2259 } |
| OLD | NEW |