Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Side by Side Diff: src/wasm/wasm-module.cc

Issue 2230063002: [wasm] Experimental: Add support for multiple non-homogeneous tables Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/wasm/wasm-module.h ('k') | test/cctest/wasm/test-run-wasm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/macro-assembler.h" 8 #include "src/macro-assembler.h"
9 #include "src/objects.h" 9 #include "src/objects.h"
10 #include "src/property-descriptor.h" 10 #include "src/property-descriptor.h"
(...skipping 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after
1558 const std::vector<Handle<Code>>* code_table) { 1558 const std::vector<Handle<Code>>* code_table) {
1559 uint32_t max_size = table->length() / 2; 1559 uint32_t max_size = table->length() / 2;
1560 for (uint32_t i = max_size; i < max_size + table_size; ++i) { 1560 for (uint32_t i = max_size; i < max_size + table_size; ++i) {
1561 int index = Smi::cast(table->get(static_cast<int>(i)))->value(); 1561 int index = Smi::cast(table->get(static_cast<int>(i)))->value();
1562 DCHECK_GE(index, 0); 1562 DCHECK_GE(index, 0);
1563 DCHECK_LT(static_cast<size_t>(index), code_table->size()); 1563 DCHECK_LT(static_cast<size_t>(index), code_table->size());
1564 table->set(static_cast<int>(i), *(*code_table)[index]); 1564 table->set(static_cast<int>(i), *(*code_table)[index]);
1565 } 1565 }
1566 } 1566 }
1567 1567
1568 bool isAnyFuncType(FunctionSig* sig) {
1569 return sig->return_count() == 0 && sig->parameter_count() == 1 &&
1570 sig->GetParam(0) == kAstStmt;
1571 }
1572
1568 int GetNumberOfFunctions(JSObject* wasm) { 1573 int GetNumberOfFunctions(JSObject* wasm) {
1569 Object* func_names_obj = wasm->GetInternalField(kWasmFunctionNamesArray); 1574 Object* func_names_obj = wasm->GetInternalField(kWasmFunctionNamesArray);
1570 // TODO(clemensh): this looks inside an array constructed elsewhere. Refactor. 1575 // TODO(clemensh): this looks inside an array constructed elsewhere. Refactor.
1571 return ByteArray::cast(func_names_obj)->get_int(0); 1576 return ByteArray::cast(func_names_obj)->get_int(0);
1572 } 1577 }
1573 1578
1574 namespace testing { 1579 namespace testing {
1575 1580
1576 int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start, 1581 int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start,
1577 const byte* module_end, bool asm_js) { 1582 const byte* module_end, bool asm_js) {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
1640 return static_cast<int32_t>(HeapNumber::cast(*result)->value()); 1645 return static_cast<int32_t>(HeapNumber::cast(*result)->value());
1641 } 1646 }
1642 thrower.Error("WASM.compileRun() failed: Return value should be number"); 1647 thrower.Error("WASM.compileRun() failed: Return value should be number");
1643 return -1; 1648 return -1;
1644 } 1649 }
1645 1650
1646 } // namespace testing 1651 } // namespace testing
1647 } // namespace wasm 1652 } // namespace wasm
1648 } // namespace internal 1653 } // namespace internal
1649 } // namespace v8 1654 } // namespace v8
OLDNEW
« no previous file with comments | « src/wasm/wasm-module.h ('k') | test/cctest/wasm/test-run-wasm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698