Chromium Code Reviews| 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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 507 Handle<FixedArray> signature_tables = | 507 Handle<FixedArray> signature_tables = |
| 508 factory->NewFixedArray(function_table_count, TENURED); | 508 factory->NewFixedArray(function_table_count, TENURED); |
| 509 for (int i = 0; i < function_table_count; ++i) { | 509 for (int i = 0; i < function_table_count; ++i) { |
| 510 temp_instance.function_tables[i] = factory->NewFixedArray(1, TENURED); | 510 temp_instance.function_tables[i] = factory->NewFixedArray(1, TENURED); |
| 511 temp_instance.signature_tables[i] = factory->NewFixedArray(1, TENURED); | 511 temp_instance.signature_tables[i] = factory->NewFixedArray(1, TENURED); |
| 512 function_tables->set(i, *temp_instance.function_tables[i]); | 512 function_tables->set(i, *temp_instance.function_tables[i]); |
| 513 signature_tables->set(i, *temp_instance.signature_tables[i]); | 513 signature_tables->set(i, *temp_instance.signature_tables[i]); |
| 514 } | 514 } |
| 515 | 515 |
| 516 HistogramTimerScope wasm_compile_module_time_scope( | 516 HistogramTimerScope wasm_compile_module_time_scope( |
| 517 isolate_->counters()->wasm_compile_module_time()); | 517 module_->origin == ModuleOrigin::kWasmOrigin |
|
bbudge
2017/03/24 19:19:01
Since we'll be doing this check all over the place
Karl
2017/03/24 21:19:58
Part of the problem is that the origin field is NO
| |
| 518 ? isolate_->counters()->wasm_compile_wasm_module_time() | |
| 519 : isolate_->counters()->wasm_compile_asm_module_time()); | |
| 518 | 520 |
| 519 ModuleBytesEnv module_env(module_, &temp_instance, wire_bytes); | 521 ModuleBytesEnv module_env(module_, &temp_instance, wire_bytes); |
| 520 | 522 |
| 521 // The {code_table} array contains import wrappers and functions (which | 523 // The {code_table} array contains import wrappers and functions (which |
| 522 // are both included in {functions.size()}, and export wrappers. | 524 // are both included in {functions.size()}, and export wrappers. |
| 523 int code_table_size = static_cast<int>(module_->functions.size() + | 525 int code_table_size = static_cast<int>(module_->functions.size() + |
| 524 module_->num_exported_functions); | 526 module_->num_exported_functions); |
| 525 Handle<FixedArray> code_table = | 527 Handle<FixedArray> code_table = |
| 526 factory->NewFixedArray(static_cast<int>(code_table_size), TENURED); | 528 factory->NewFixedArray(static_cast<int>(code_table_size), TENURED); |
| 527 | 529 |
| (...skipping 2681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3209 callee_compiled->instruction_start()); | 3211 callee_compiled->instruction_start()); |
| 3210 } | 3212 } |
| 3211 DCHECK_EQ(non_compiled_functions.size(), idx); | 3213 DCHECK_EQ(non_compiled_functions.size(), idx); |
| 3212 } | 3214 } |
| 3213 | 3215 |
| 3214 Code* ret = | 3216 Code* ret = |
| 3215 Code::cast(compiled_module->code_table()->get(func_to_return_idx)); | 3217 Code::cast(compiled_module->code_table()->get(func_to_return_idx)); |
| 3216 DCHECK_EQ(Code::WASM_FUNCTION, ret->kind()); | 3218 DCHECK_EQ(Code::WASM_FUNCTION, ret->kind()); |
| 3217 return handle(ret, isolate); | 3219 return handle(ret, isolate); |
| 3218 } | 3220 } |
| OLD | NEW |