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

Side by Side Diff: test/cctest/wasm/test-wasm-function-name-table.cc

Issue 1974933002: [wasm] Remove the use of the "external" bit on OldFunctions section. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove unused variable. Created 4 years, 7 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.cc ('k') | test/cctest/wasm/wasm-run-utils.h » ('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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/wasm/wasm-function-name-table.h" 5 #include "src/wasm/wasm-function-name-table.h"
6 #include "src/wasm/wasm-module.h" 6 #include "src/wasm/wasm-module.h"
7 7
8 #include "test/cctest/cctest.h" 8 #include "test/cctest/cctest.h"
9 9
10 using namespace v8::internal; 10 using namespace v8::internal;
(...skipping 22 matching lines...) Expand all
33 33
34 uint32_t func_index = 0; 34 uint32_t func_index = 0;
35 for (Vector<const char> name : names) { 35 for (Vector<const char> name : names) {
36 size_t name_offset = all_names.size(); 36 size_t name_offset = all_names.size();
37 all_names.insert(all_names.end(), name.start(), 37 all_names.insert(all_names.end(), name.start(),
38 name.start() + name.length()); 38 name.start() + name.length());
39 // Make every second function name null-terminated. 39 // Make every second function name null-terminated.
40 if (func_index % 2) all_names.push_back('\0'); 40 if (func_index % 2) all_names.push_back('\0');
41 module.functions.push_back( 41 module.functions.push_back(
42 {nullptr, 0, 0, static_cast<uint32_t>(name_offset), 42 {nullptr, 0, 0, static_cast<uint32_t>(name_offset),
43 static_cast<uint32_t>(name.length()), 0, 0, 0, 0, 0, 0, false, false}); 43 static_cast<uint32_t>(name.length()), 0, 0, 0, 0, 0, 0, false});
44 ++func_index; 44 ++func_index;
45 } 45 }
46 46
47 module.module_start = reinterpret_cast<byte *>(all_names.data()); 47 module.module_start = reinterpret_cast<byte *>(all_names.data());
48 module.module_end = module.module_start + all_names.size(); 48 module.module_end = module.module_start + all_names.size();
49 49
50 Handle<Object> wasm_function_name_table = 50 Handle<Object> wasm_function_name_table =
51 BuildFunctionNamesTable(isolate, &module); 51 BuildFunctionNamesTable(isolate, &module);
52 CHECK(wasm_function_name_table->IsByteArray()); 52 CHECK(wasm_function_name_table->IsByteArray());
53 53
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 101
102 TEST(ThreeUnnamedFunctions) { 102 TEST(ThreeUnnamedFunctions) {
103 const char *names[] = {"", "", ""}; 103 const char *names[] = {"", "", ""};
104 testFunctionNameTable(ArrayVector(names)); 104 testFunctionNameTable(ArrayVector(names));
105 } 105 }
106 106
107 TEST(UTF8Names) { 107 TEST(UTF8Names) {
108 const char *names[] = {"↱fun↰", "↺", "alpha:α beta:β"}; 108 const char *names[] = {"↱fun↰", "↺", "alpha:α beta:β"};
109 testFunctionNameTable(ArrayVector(names)); 109 testFunctionNameTable(ArrayVector(names));
110 } 110 }
OLDNEW
« no previous file with comments | « src/wasm/wasm-module.cc ('k') | test/cctest/wasm/wasm-run-utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698