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

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

Issue 2591903002: [wasm] sundry trap handler fixes (Closed)
Patch Set: Merge VisitLoad and VisitProtectedLoad 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 | « src/objects-inl.h ('k') | no next file » | 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/assembler-inl.h" 7 #include "src/assembler-inl.h"
8 #include "src/base/adapters.h" 8 #include "src/base/adapters.h"
9 #include "src/base/atomic-utils.h" 9 #include "src/base/atomic-utils.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after
1309 //-------------------------------------------------------------------------- 1309 //--------------------------------------------------------------------------
1310 { 1310 {
1311 for (int i = 0; i < code_table->length(); ++i) { 1311 for (int i = 0; i < code_table->length(); ++i) {
1312 Handle<Code> code = code_table->GetValueChecked<Code>(isolate_, i); 1312 Handle<Code> code = code_table->GetValueChecked<Code>(isolate_, i);
1313 1313
1314 if (code->kind() != Code::WASM_FUNCTION) { 1314 if (code->kind() != Code::WASM_FUNCTION) {
1315 continue; 1315 continue;
1316 } 1316 }
1317 1317
1318 FixedArray* protected_instructions = code->protected_instructions(); 1318 FixedArray* protected_instructions = code->protected_instructions();
1319 1319 DCHECK(protected_instructions != nullptr);
1320 Zone zone(isolate_->allocator(), "Wasm Module"); 1320 Zone zone(isolate_->allocator(), "Wasm Module");
1321 ZoneVector<trap_handler::ProtectedInstructionData> unpacked(&zone); 1321 ZoneVector<trap_handler::ProtectedInstructionData> unpacked(&zone);
1322 for (int i = 0; i < protected_instructions->length(); 1322 for (int i = 0; i < protected_instructions->length();
1323 i += Code::kTrapDataSize) { 1323 i += Code::kTrapDataSize) {
1324 trap_handler::ProtectedInstructionData data; 1324 trap_handler::ProtectedInstructionData data;
1325 data.instr_offset = 1325 data.instr_offset =
1326 protected_instructions 1326 protected_instructions
1327 ->GetValueChecked<Smi>(isolate_, i + Code::kTrapCodeOffset) 1327 ->GetValueChecked<Smi>(isolate_, i + Code::kTrapCodeOffset)
1328 ->value(); 1328 ->value();
1329 data.landing_offset = 1329 data.landing_offset =
(...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after
2298 CHECK(!compiled_module->has_weak_owning_instance()); 2298 CHECK(!compiled_module->has_weak_owning_instance());
2299 } 2299 }
2300 2300
2301 void testing::ValidateOrphanedInstance(Isolate* isolate, 2301 void testing::ValidateOrphanedInstance(Isolate* isolate,
2302 Handle<WasmInstanceObject> instance) { 2302 Handle<WasmInstanceObject> instance) {
2303 DisallowHeapAllocation no_gc; 2303 DisallowHeapAllocation no_gc;
2304 WasmCompiledModule* compiled_module = instance->compiled_module(); 2304 WasmCompiledModule* compiled_module = instance->compiled_module();
2305 CHECK(compiled_module->has_weak_wasm_module()); 2305 CHECK(compiled_module->has_weak_wasm_module());
2306 CHECK(compiled_module->ptr_to_weak_wasm_module()->cleared()); 2306 CHECK(compiled_module->ptr_to_weak_wasm_module()->cleared());
2307 } 2307 }
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698