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

Side by Side Diff: test/cctest/wasm/wasm-run-utils.h

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
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 #ifndef WASM_RUN_UTILS_H 5 #ifndef WASM_RUN_UTILS_H
6 #define WASM_RUN_UTILS_H 6 #define WASM_RUN_UTILS_H
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 #include <string.h> 10 #include <string.h>
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 rng.NextBytes(raw, end - raw); 161 rng.NextBytes(raw, end - raw);
162 } 162 }
163 163
164 uint32_t AddFunction(FunctionSig* sig, Handle<Code> code) { 164 uint32_t AddFunction(FunctionSig* sig, Handle<Code> code) {
165 if (module->functions.size() == 0) { 165 if (module->functions.size() == 0) {
166 // TODO(titzer): Reserving space here to avoid the underlying WasmFunction 166 // TODO(titzer): Reserving space here to avoid the underlying WasmFunction
167 // structs from moving. 167 // structs from moving.
168 module->functions.reserve(kMaxFunctions); 168 module->functions.reserve(kMaxFunctions);
169 } 169 }
170 uint32_t index = static_cast<uint32_t>(module->functions.size()); 170 uint32_t index = static_cast<uint32_t>(module->functions.size());
171 module->functions.push_back( 171 module->functions.push_back({sig, index, 0, 0, 0, 0, 0, 0, 0, 0, 0, false});
172 {sig, index, 0, 0, 0, 0, 0, 0, 0, 0, 0, false, false});
173 instance->function_code.push_back(code); 172 instance->function_code.push_back(code);
174 DCHECK_LT(index, kMaxFunctions); // limited for testing. 173 DCHECK_LT(index, kMaxFunctions); // limited for testing.
175 return index; 174 return index;
176 } 175 }
177 176
178 uint32_t AddJsFunction(FunctionSig* sig, const char* source) { 177 uint32_t AddJsFunction(FunctionSig* sig, const char* source) {
179 Handle<JSFunction> jsfunc = Handle<JSFunction>::cast(v8::Utils::OpenHandle( 178 Handle<JSFunction> jsfunc = Handle<JSFunction>::cast(v8::Utils::OpenHandle(
180 *v8::Local<v8::Function>::Cast(CompileRun(source)))); 179 *v8::Local<v8::Function>::Cast(CompileRun(source))));
181 uint32_t index = AddFunction(sig, Handle<Code>::null()); 180 uint32_t index = AddFunction(sig, Handle<Code>::null());
182 Isolate* isolate = module->shared_isolate; 181 Isolate* isolate = module->shared_isolate;
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 if (p1 == MachineType::None()) return 1; 653 if (p1 == MachineType::None()) return 1;
655 if (p2 == MachineType::None()) return 2; 654 if (p2 == MachineType::None()) return 2;
656 if (p3 == MachineType::None()) return 3; 655 if (p3 == MachineType::None()) return 3;
657 return 4; 656 return 4;
658 } 657 }
659 }; 658 };
660 659
661 } // namespace 660 } // namespace
662 661
663 #endif 662 #endif
OLDNEW
« no previous file with comments | « test/cctest/wasm/test-wasm-function-name-table.cc ('k') | test/unittests/wasm/ast-decoder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698