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

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

Issue 2977543002: [wasm] Allow full u32 range for table maximum in WebAssembly.Table constructor. (Closed)
Patch Set: [wasm] Allow full u32 range for table maximum in WebAssembly.Table constructor. Created 3 years, 5 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 | « no previous file | src/wasm/wasm-js.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 2017 the V8 project authors. All rights reserved. 1 // Copyright 2017 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/module-compiler.h> 5 #include <src/wasm/module-compiler.h>
6 6
7 #include <atomic> 7 #include <atomic>
8 8
9 #include "src/asmjs/asm-js.h" 9 #include "src/asmjs/asm-js.h"
10 #include "src/assembler-inl.h" 10 #include "src/assembler-inl.h"
(...skipping 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after
1333 int imported_cur_size = table_instance.js_wrappers->length(); 1333 int imported_cur_size = table_instance.js_wrappers->length();
1334 if (imported_cur_size < static_cast<int>(table.min_size)) { 1334 if (imported_cur_size < static_cast<int>(table.min_size)) {
1335 thrower_->LinkError( 1335 thrower_->LinkError(
1336 "table import %d is smaller than minimum %d, got %u", index, 1336 "table import %d is smaller than minimum %d, got %u", index,
1337 table.min_size, imported_cur_size); 1337 table.min_size, imported_cur_size);
1338 return -1; 1338 return -1;
1339 } 1339 }
1340 1340
1341 if (table.has_max) { 1341 if (table.has_max) {
1342 int64_t imported_max_size = 1342 int64_t imported_max_size =
1343 table_instance.table_object->maximum_length(); 1343 table_instance.table_object->maximum_length()->Number();
1344 if (imported_max_size < 0) { 1344 if (imported_max_size < 0) {
1345 thrower_->LinkError( 1345 thrower_->LinkError(
1346 "table import %d has no maximum length, expected %d", index, 1346 "table import %d has no maximum length, expected %d", index,
1347 table.max_size); 1347 table.max_size);
1348 return -1; 1348 return -1;
1349 } 1349 }
1350 if (imported_max_size > table.max_size) { 1350 if (imported_max_size > table.max_size) {
1351 thrower_->LinkError( 1351 thrower_->LinkError(
1352 "table import %d has maximum larger than maximum %d, " 1352 "table import %d has maximum larger than maximum %d, "
1353 "got %" PRIx64, 1353 "got %" PRIx64,
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after
2353 HandleScope scope(job_->isolate_); 2353 HandleScope scope(job_->isolate_);
2354 Handle<WasmModuleObject> result = 2354 Handle<WasmModuleObject> result =
2355 WasmModuleObject::New(job_->isolate_, job_->compiled_module_); 2355 WasmModuleObject::New(job_->isolate_, job_->compiled_module_);
2356 // {job_} is deleted in AsyncCompileSucceeded, therefore the {return}. 2356 // {job_} is deleted in AsyncCompileSucceeded, therefore the {return}.
2357 return job_->AsyncCompileSucceeded(result); 2357 return job_->AsyncCompileSucceeded(result);
2358 } 2358 }
2359 }; 2359 };
2360 } // namespace wasm 2360 } // namespace wasm
2361 } // namespace internal 2361 } // namespace internal
2362 } // namespace v8 2362 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/wasm/wasm-js.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698