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/assembler-inl.h" | 7 #include "src/assembler-inl.h" |
8 #include "src/base/adapters.h" | 8 #include "src/base/adapters.h" |
9 #include "src/base/atomic-utils.h" | 9 #include "src/base/atomic-utils.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1308 //-------------------------------------------------------------------------- | 1308 //-------------------------------------------------------------------------- |
1309 if (function_table_count > 0) | 1309 if (function_table_count > 0) |
1310 InitializeTables(code_table, instance, &code_specialization); | 1310 InitializeTables(code_table, instance, &code_specialization); |
1311 | 1311 |
1312 //-------------------------------------------------------------------------- | 1312 //-------------------------------------------------------------------------- |
1313 // Set up the memory for the new instance. | 1313 // Set up the memory for the new instance. |
1314 //-------------------------------------------------------------------------- | 1314 //-------------------------------------------------------------------------- |
1315 MaybeHandle<JSArrayBuffer> old_memory; | 1315 MaybeHandle<JSArrayBuffer> old_memory; |
1316 | 1316 |
1317 uint32_t min_mem_pages = module_->min_mem_pages; | 1317 uint32_t min_mem_pages = module_->min_mem_pages; |
1318 isolate_->counters()->wasm_min_mem_pages_count()->AddSample(min_mem_pages); | 1318 (module_->is_wasm() ? isolate_->counters()->wasm_wasm_min_mem_pages_count() |
| 1319 : isolate_->counters()->wasm_asm_min_mem_pages_count()) |
| 1320 ->AddSample(min_mem_pages); |
1319 | 1321 |
1320 if (!memory_.is_null()) { | 1322 if (!memory_.is_null()) { |
1321 // Set externally passed ArrayBuffer non neuterable. | 1323 // Set externally passed ArrayBuffer non neuterable. |
1322 memory_->set_is_neuterable(false); | 1324 memory_->set_is_neuterable(false); |
1323 | 1325 |
1324 DCHECK_IMPLIES(EnableGuardRegions(), | 1326 DCHECK_IMPLIES(EnableGuardRegions(), |
1325 module_->is_asm_js() || memory_->has_guard_region()); | 1327 module_->is_asm_js() || memory_->has_guard_region()); |
1326 } else if (min_mem_pages > 0) { | 1328 } else if (min_mem_pages > 0) { |
1327 memory_ = AllocateMemory(min_mem_pages); | 1329 memory_ = AllocateMemory(min_mem_pages); |
1328 if (memory_.is_null()) return {}; // failed to allocate memory | 1330 if (memory_.is_null()) return {}; // failed to allocate memory |
(...skipping 1886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3215 callee_compiled->instruction_start()); | 3217 callee_compiled->instruction_start()); |
3216 } | 3218 } |
3217 DCHECK_EQ(non_compiled_functions.size(), idx); | 3219 DCHECK_EQ(non_compiled_functions.size(), idx); |
3218 } | 3220 } |
3219 | 3221 |
3220 Code* ret = | 3222 Code* ret = |
3221 Code::cast(compiled_module->code_table()->get(func_to_return_idx)); | 3223 Code::cast(compiled_module->code_table()->get(func_to_return_idx)); |
3222 DCHECK_EQ(Code::WASM_FUNCTION, ret->kind()); | 3224 DCHECK_EQ(Code::WASM_FUNCTION, ret->kind()); |
3223 return handle(ret, isolate); | 3225 return handle(ret, isolate); |
3224 } | 3226 } |
OLD | NEW |