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

Side by Side Diff: src/assembler.cc

Issue 2378973003: Revert of [wasm] Remove improper assembler check for grow memory. (Closed)
Patch Set: Created 4 years, 2 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 | test/mjsunit/wasm/grow-memory.js » ('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 (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 if (IsWasmMemoryReference(rmode_)) { 344 if (IsWasmMemoryReference(rmode_)) {
345 Address updated_reference; 345 Address updated_reference;
346 DCHECK_GE(wasm_memory_reference(), old_base); 346 DCHECK_GE(wasm_memory_reference(), old_base);
347 updated_reference = new_base + (wasm_memory_reference() - old_base); 347 updated_reference = new_base + (wasm_memory_reference() - old_base);
348 // The reference is not checked here but at runtime. Validity of references 348 // The reference is not checked here but at runtime. Validity of references
349 // may change over time. 349 // may change over time.
350 unchecked_update_wasm_memory_reference(updated_reference, 350 unchecked_update_wasm_memory_reference(updated_reference,
351 icache_flush_mode); 351 icache_flush_mode);
352 } else if (IsWasmMemorySizeReference(rmode_)) { 352 } else if (IsWasmMemorySizeReference(rmode_)) {
353 uint32_t current_size_reference = wasm_memory_size_reference(); 353 uint32_t current_size_reference = wasm_memory_size_reference();
354 DCHECK(old_size == 0 || current_size_reference <= old_size);
354 uint32_t offset = old_size - current_size_reference; 355 uint32_t offset = old_size - current_size_reference;
356 DCHECK_GE(new_size, offset);
355 uint32_t updated_size_reference = new_size - offset; 357 uint32_t updated_size_reference = new_size - offset;
356 unchecked_update_wasm_memory_size(updated_size_reference, 358 unchecked_update_wasm_memory_size(updated_size_reference,
357 icache_flush_mode); 359 icache_flush_mode);
358 } else { 360 } else {
359 UNREACHABLE(); 361 UNREACHABLE();
360 } 362 }
361 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { 363 if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
362 Assembler::FlushICache(isolate_, pc_, sizeof(int64_t)); 364 Assembler::FlushICache(isolate_, pc_, sizeof(int64_t));
363 } 365 }
364 } 366 }
(...skipping 1572 matching lines...) Expand 10 before | Expand all | Expand 10 after
1937 1939
1938 1940
1939 void Assembler::DataAlign(int m) { 1941 void Assembler::DataAlign(int m) {
1940 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m)); 1942 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m));
1941 while ((pc_offset() & (m - 1)) != 0) { 1943 while ((pc_offset() & (m - 1)) != 0) {
1942 db(0); 1944 db(0);
1943 } 1945 }
1944 } 1946 }
1945 } // namespace internal 1947 } // namespace internal
1946 } // namespace v8 1948 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/wasm/grow-memory.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698