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/wasm-module.cc

Issue 2113183002: [wasm] Fix possible gc-ing of wasm import code objects (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: better fix Created 4 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 | 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 "src/base/atomic-utils.h" 5 #include "src/base/atomic-utils.h"
6 #include "src/macro-assembler.h" 6 #include "src/macro-assembler.h"
7 #include "src/objects.h" 7 #include "src/objects.h"
8 #include "src/property-descriptor.h" 8 #include "src/property-descriptor.h"
9 #include "src/v8.h" 9 #include "src/v8.h"
10 10
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 Code* target = 365 Code* target =
366 Code::GetCodeFromTargetAddress(it.rinfo()->target_address()); 366 Code::GetCodeFromTargetAddress(it.rinfo()->target_address());
367 if (target->kind() == kind && 367 if (target->kind() == kind &&
368 target->constant_pool_offset() >= kPlaceholderMarker) { 368 target->constant_pool_offset() >= kPlaceholderMarker) {
369 // Patch direct calls to placeholder code objects. 369 // Patch direct calls to placeholder code objects.
370 uint32_t index = target->constant_pool_offset() - kPlaceholderMarker; 370 uint32_t index = target->constant_pool_offset() - kPlaceholderMarker;
371 CHECK(index < code_targets.size()); 371 CHECK(index < code_targets.size());
372 Handle<Code> new_target = code_targets[index]; 372 Handle<Code> new_target = code_targets[index];
373 if (target != *new_target) { 373 if (target != *new_target) {
374 it.rinfo()->set_target_address(new_target->instruction_start(), 374 it.rinfo()->set_target_address(new_target->instruction_start(),
375 SKIP_WRITE_BARRIER, SKIP_ICACHE_FLUSH); 375 UPDATE_WRITE_BARRIER,
376 SKIP_ICACHE_FLUSH);
376 modified = true; 377 modified = true;
377 } 378 }
378 } 379 }
379 } 380 }
380 } 381 }
381 return modified; 382 return modified;
382 } 383 }
383 384
384 void LinkModuleFunctions(Isolate* isolate, 385 void LinkModuleFunctions(Isolate* isolate,
385 std::vector<Handle<Code>>& functions) { 386 std::vector<Handle<Code>>& functions) {
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after
1385 return static_cast<int32_t>(HeapNumber::cast(*result)->value()); 1386 return static_cast<int32_t>(HeapNumber::cast(*result)->value());
1386 } 1387 }
1387 thrower.Error("WASM.compileRun() failed: Return value should be number"); 1388 thrower.Error("WASM.compileRun() failed: Return value should be number");
1388 return -1; 1389 return -1;
1389 } 1390 }
1390 1391
1391 } // namespace testing 1392 } // namespace testing
1392 } // namespace wasm 1393 } // namespace wasm
1393 } // namespace internal 1394 } // namespace internal
1394 } // namespace v8 1395 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698