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

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

Issue 2587913005: [wasm] Freeze exports object (Closed)
Patch Set: No IfDebug<T> type :( Created 4 years 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/add-getters.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/adapters.h" 7 #include "src/base/adapters.h"
8 #include "src/base/atomic-utils.h" 8 #include "src/base/atomic-utils.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/compiler/wasm-compiler.h" 10 #include "src/compiler/wasm-compiler.h"
(...skipping 1828 matching lines...) Expand 10 before | Expand all | Expand 10 after
1839 } 1839 }
1840 } 1840 }
1841 v8::Maybe<bool> status = JSReceiver::DefineOwnProperty( 1841 v8::Maybe<bool> status = JSReceiver::DefineOwnProperty(
1842 isolate_, exports_object, name, &desc, Object::THROW_ON_ERROR); 1842 isolate_, exports_object, name, &desc, Object::THROW_ON_ERROR);
1843 if (!status.IsJust()) { 1843 if (!status.IsJust()) {
1844 thrower_->LinkError("export of %.*s failed.", name->length(), 1844 thrower_->LinkError("export of %.*s failed.", name->length(),
1845 name->ToCString().get()); 1845 name->ToCString().get());
1846 return; 1846 return;
1847 } 1847 }
1848 } 1848 }
1849
1850 if (module_->origin == kWasmOrigin) {
1851 v8::Maybe<bool> success = JSReceiver::SetIntegrityLevel(
1852 exports_object, FROZEN, Object::DONT_THROW);
1853 DCHECK(success.FromMaybe(false));
1854 USE(success);
1855 }
1849 } 1856 }
1850 1857
1851 void InitializeTables(Handle<FixedArray> code_table, 1858 void InitializeTables(Handle<FixedArray> code_table,
1852 Handle<WasmInstanceObject> instance) { 1859 Handle<WasmInstanceObject> instance) {
1853 Handle<FixedArray> old_function_tables = 1860 Handle<FixedArray> old_function_tables =
1854 compiled_module_->function_tables(); 1861 compiled_module_->function_tables();
1855 int function_table_count = 1862 int function_table_count =
1856 static_cast<int>(module_->function_tables.size()); 1863 static_cast<int>(module_->function_tables.size());
1857 Handle<FixedArray> new_function_tables = 1864 Handle<FixedArray> new_function_tables =
1858 isolate_->factory()->NewFixedArray(function_table_count); 1865 isolate_->factory()->NewFixedArray(function_table_count);
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
2308 CHECK(!compiled_module->has_weak_owning_instance()); 2315 CHECK(!compiled_module->has_weak_owning_instance());
2309 } 2316 }
2310 2317
2311 void testing::ValidateOrphanedInstance(Isolate* isolate, 2318 void testing::ValidateOrphanedInstance(Isolate* isolate,
2312 Handle<WasmInstanceObject> instance) { 2319 Handle<WasmInstanceObject> instance) {
2313 DisallowHeapAllocation no_gc; 2320 DisallowHeapAllocation no_gc;
2314 WasmCompiledModule* compiled_module = instance->get_compiled_module(); 2321 WasmCompiledModule* compiled_module = instance->get_compiled_module();
2315 CHECK(compiled_module->has_weak_wasm_module()); 2322 CHECK(compiled_module->has_weak_wasm_module());
2316 CHECK(compiled_module->ptr_to_weak_wasm_module()->cleared()); 2323 CHECK(compiled_module->ptr_to_weak_wasm_module()->cleared());
2317 } 2324 }
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/wasm/add-getters.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698