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

Side by Side Diff: src/assembler.cc

Issue 2250913002: [v8] Move all the RelocInfo::set_target_address function into one place. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Forget to modify assembler-arm64-inl.h Created 4 years, 4 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 | « src/assembler.h ('k') | src/ia32/assembler-ia32-inl.h » ('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 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 reinterpret_cast<uintptr_t>(wasm_global_reference())); 381 reinterpret_cast<uintptr_t>(wasm_global_reference()));
382 updated_reference = new_base + (wasm_global_reference() - old_base); 382 updated_reference = new_base + (wasm_global_reference() - old_base);
383 DCHECK(reinterpret_cast<uintptr_t>(new_base) <= 383 DCHECK(reinterpret_cast<uintptr_t>(new_base) <=
384 reinterpret_cast<uintptr_t>(updated_reference)); 384 reinterpret_cast<uintptr_t>(updated_reference));
385 unchecked_update_wasm_memory_reference(updated_reference, icache_flush_mode); 385 unchecked_update_wasm_memory_reference(updated_reference, icache_flush_mode);
386 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { 386 if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
387 Assembler::FlushICache(isolate_, pc_, sizeof(int32_t)); 387 Assembler::FlushICache(isolate_, pc_, sizeof(int32_t));
388 } 388 }
389 } 389 }
390 390
391 void RelocInfo::set_target_address(Address target,
392 WriteBarrierMode write_barrier_mode,
393 ICacheFlushMode icache_flush_mode) {
394 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_));
395 Assembler::set_target_address_at(isolate_, pc_, host_, target,
396 icache_flush_mode);
397 if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != NULL &&
398 IsCodeTarget(rmode_)) {
399 Object* target_code = Code::GetCodeFromTargetAddress(target);
400 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(
401 host(), this, HeapObject::cast(target_code));
402 }
403 }
404
391 uint32_t RelocInfoWriter::WriteLongPCJump(uint32_t pc_delta) { 405 uint32_t RelocInfoWriter::WriteLongPCJump(uint32_t pc_delta) {
392 // Return if the pc_delta can fit in kSmallPCDeltaBits bits. 406 // Return if the pc_delta can fit in kSmallPCDeltaBits bits.
393 // Otherwise write a variable length PC jump for the bits that do 407 // Otherwise write a variable length PC jump for the bits that do
394 // not fit in the kSmallPCDeltaBits bits. 408 // not fit in the kSmallPCDeltaBits bits.
395 if (is_uintn(pc_delta, kSmallPCDeltaBits)) return pc_delta; 409 if (is_uintn(pc_delta, kSmallPCDeltaBits)) return pc_delta;
396 WriteMode(RelocInfo::PC_JUMP); 410 WriteMode(RelocInfo::PC_JUMP);
397 uint32_t pc_jump = pc_delta >> kSmallPCDeltaBits; 411 uint32_t pc_jump = pc_delta >> kSmallPCDeltaBits;
398 DCHECK(pc_jump > 0); 412 DCHECK(pc_jump > 0);
399 // Write kChunkBits size chunks of the pc_jump. 413 // Write kChunkBits size chunks of the pc_jump.
400 for (; pc_jump > 0; pc_jump = pc_jump >> kChunkBits) { 414 for (; pc_jump > 0; pc_jump = pc_jump >> kChunkBits) {
(...skipping 1543 matching lines...) Expand 10 before | Expand all | Expand 10 after
1944 1958
1945 1959
1946 void Assembler::DataAlign(int m) { 1960 void Assembler::DataAlign(int m) {
1947 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m)); 1961 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m));
1948 while ((pc_offset() & (m - 1)) != 0) { 1962 while ((pc_offset() & (m - 1)) != 0) {
1949 db(0); 1963 db(0);
1950 } 1964 }
1951 } 1965 }
1952 } // namespace internal 1966 } // namespace internal
1953 } // namespace v8 1967 } // namespace v8
OLDNEW
« no previous file with comments | « src/assembler.h ('k') | src/ia32/assembler-ia32-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698