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

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

Issue 2347333002: [wasm] Fix for cloning module heap size value (Closed)
Patch Set: the fix 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/regress/wasm/regression-647649.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 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/code-stubs.h" 8 #include "src/code-stubs.h"
9 9
10 #include "src/macro-assembler.h" 10 #include "src/macro-assembler.h"
(...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after
1290 case Code::JS_TO_WASM_FUNCTION: 1290 case Code::JS_TO_WASM_FUNCTION:
1291 case Code::WASM_FUNCTION: { 1291 case Code::WASM_FUNCTION: {
1292 Handle<Code> code = factory->CopyCode(orig_code); 1292 Handle<Code> code = factory->CopyCode(orig_code);
1293 code_table->set(i, *code); 1293 code_table->set(i, *code);
1294 break; 1294 break;
1295 } 1295 }
1296 default: 1296 default:
1297 UNREACHABLE(); 1297 UNREACHABLE();
1298 } 1298 }
1299 } 1299 }
1300 Handle<HeapNumber> size_as_object = factory->NewHeapNumber(
1301 static_cast<double>(
1302 compiled_module->GetValueChecked<HeapNumber>(isolate, kMemSize)
1303 ->value()),
1304 MUTABLE, TENURED);
1305 compiled_module->set(kMemSize, *size_as_object);
1300 RecordStats(isolate, code_table); 1306 RecordStats(isolate, code_table);
1301 } else { 1307 } else {
1302 // There was no owner, so we can reuse the original. 1308 // There was no owner, so we can reuse the original.
1303 compiled_module = original; 1309 compiled_module = original;
1304 } 1310 }
1305 compiled_module->set(kCodeTable, *code_table); 1311 compiled_module->set(kCodeTable, *code_table);
1306 } 1312 }
1307 1313
1308 //-------------------------------------------------------------------------- 1314 //--------------------------------------------------------------------------
1309 // Allocate the instance object. 1315 // Allocate the instance object.
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
1849 FixedArray* compiled_module = 1855 FixedArray* compiled_module =
1850 FixedArray::cast(instance->GetInternalField(kWasmCompiledModule)); 1856 FixedArray::cast(instance->GetInternalField(kWasmCompiledModule));
1851 CHECK_NOT_NULL(GetModuleObject(compiled_module)); 1857 CHECK_NOT_NULL(GetModuleObject(compiled_module));
1852 CHECK(GetModuleObject(compiled_module)->cleared()); 1858 CHECK(GetModuleObject(compiled_module)->cleared());
1853 } 1859 }
1854 1860
1855 } // namespace testing 1861 } // namespace testing
1856 } // namespace wasm 1862 } // namespace wasm
1857 } // namespace internal 1863 } // namespace internal
1858 } // namespace v8 1864 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/wasm/regression-647649.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698