| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |