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

Side by Side Diff: src/assembler.h

Issue 2056633002: [wasm] Separate compilation from instantiation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: feedback Created 4 years, 6 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/arm64/assembler-arm64.cc ('k') | src/assembler.cc » ('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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 explicit RelocInfo(Isolate* isolate) : isolate_(isolate) { 442 explicit RelocInfo(Isolate* isolate) : isolate_(isolate) {
443 DCHECK_NOT_NULL(isolate); 443 DCHECK_NOT_NULL(isolate);
444 } 444 }
445 445
446 RelocInfo(Isolate* isolate, byte* pc, Mode rmode, intptr_t data, Code* host) 446 RelocInfo(Isolate* isolate, byte* pc, Mode rmode, intptr_t data, Code* host)
447 : isolate_(isolate), pc_(pc), rmode_(rmode), data_(data), host_(host) { 447 : isolate_(isolate), pc_(pc), rmode_(rmode), data_(data), host_(host) {
448 DCHECK_NOT_NULL(isolate); 448 DCHECK_NOT_NULL(isolate);
449 } 449 }
450 450
451 static inline bool IsRealRelocMode(Mode mode) { 451 static inline bool IsRealRelocMode(Mode mode) {
452 return mode >= FIRST_REAL_RELOC_MODE && 452 return mode >= FIRST_REAL_RELOC_MODE && mode <= LAST_REAL_RELOC_MODE;
453 mode <= LAST_REAL_RELOC_MODE;
454 } 453 }
455 static inline bool IsCodeTarget(Mode mode) { 454 static inline bool IsCodeTarget(Mode mode) {
456 return mode <= LAST_CODE_ENUM; 455 return mode <= LAST_CODE_ENUM;
457 } 456 }
458 static inline bool IsEmbeddedObject(Mode mode) { 457 static inline bool IsEmbeddedObject(Mode mode) {
459 return mode == EMBEDDED_OBJECT; 458 return mode == EMBEDDED_OBJECT;
460 } 459 }
461 static inline bool IsCell(Mode mode) { return mode == CELL; } 460 static inline bool IsCell(Mode mode) { return mode == CELL; }
462 static inline bool IsRuntimeEntry(Mode mode) { 461 static inline bool IsRuntimeEntry(Mode mode) {
463 return mode == RUNTIME_ENTRY; 462 return mode == RUNTIME_ENTRY;
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 void update_wasm_memory_reference( 564 void update_wasm_memory_reference(
566 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size, 565 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size,
567 ICacheFlushMode icache_flush_mode = SKIP_ICACHE_FLUSH); 566 ICacheFlushMode icache_flush_mode = SKIP_ICACHE_FLUSH);
568 void update_wasm_global_reference( 567 void update_wasm_global_reference(
569 Address old_base, Address new_base, 568 Address old_base, Address new_base,
570 ICacheFlushMode icache_flush_mode = SKIP_ICACHE_FLUSH); 569 ICacheFlushMode icache_flush_mode = SKIP_ICACHE_FLUSH);
571 570
572 // this relocation applies to; 571 // this relocation applies to;
573 // can only be called if IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) 572 // can only be called if IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)
574 INLINE(Address target_address()); 573 INLINE(Address target_address());
575 INLINE(void set_target_address(Address target, 574 INLINE(void set_target_address(
576 WriteBarrierMode write_barrier_mode = 575 Address target,
577 UPDATE_WRITE_BARRIER, 576 WriteBarrierMode write_barrier_mode = UPDATE_WRITE_BARRIER,
578 ICacheFlushMode icache_flush_mode = 577 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED));
579 FLUSH_ICACHE_IF_NEEDED));
580 INLINE(Object* target_object()); 578 INLINE(Object* target_object());
581 INLINE(Handle<Object> target_object_handle(Assembler* origin)); 579 INLINE(Handle<Object> target_object_handle(Assembler* origin));
582 INLINE(void set_target_object(Object* target, 580 INLINE(void set_target_object(
583 WriteBarrierMode write_barrier_mode = 581 Object* target,
584 UPDATE_WRITE_BARRIER, 582 WriteBarrierMode write_barrier_mode = UPDATE_WRITE_BARRIER,
585 ICacheFlushMode icache_flush_mode = 583 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED));
586 FLUSH_ICACHE_IF_NEEDED));
587 INLINE(Address target_runtime_entry(Assembler* origin)); 584 INLINE(Address target_runtime_entry(Assembler* origin));
588 INLINE(void set_target_runtime_entry(Address target, 585 INLINE(void set_target_runtime_entry(
589 WriteBarrierMode write_barrier_mode = 586 Address target,
590 UPDATE_WRITE_BARRIER, 587 WriteBarrierMode write_barrier_mode = UPDATE_WRITE_BARRIER,
591 ICacheFlushMode icache_flush_mode = 588 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED));
592 FLUSH_ICACHE_IF_NEEDED));
593 INLINE(Cell* target_cell()); 589 INLINE(Cell* target_cell());
594 INLINE(Handle<Cell> target_cell_handle()); 590 INLINE(Handle<Cell> target_cell_handle());
595 INLINE(void set_target_cell(Cell* cell, 591 INLINE(void set_target_cell(
596 WriteBarrierMode write_barrier_mode = 592 Cell* cell, WriteBarrierMode write_barrier_mode = UPDATE_WRITE_BARRIER,
597 UPDATE_WRITE_BARRIER, 593 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED));
598 ICacheFlushMode icache_flush_mode =
599 FLUSH_ICACHE_IF_NEEDED));
600 INLINE(Handle<Object> code_age_stub_handle(Assembler* origin)); 594 INLINE(Handle<Object> code_age_stub_handle(Assembler* origin));
601 INLINE(Code* code_age_stub()); 595 INLINE(Code* code_age_stub());
602 INLINE(void set_code_age_stub(Code* stub, 596 INLINE(void set_code_age_stub(
603 ICacheFlushMode icache_flush_mode = 597 Code* stub, ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED));
604 FLUSH_ICACHE_IF_NEEDED));
605 598
606 // Returns the address of the constant pool entry where the target address 599 // Returns the address of the constant pool entry where the target address
607 // is held. This should only be called if IsInConstantPool returns true. 600 // is held. This should only be called if IsInConstantPool returns true.
608 INLINE(Address constant_pool_entry_address()); 601 INLINE(Address constant_pool_entry_address());
609 602
610 // Read the address of the word containing the target_address in an 603 // Read the address of the word containing the target_address in an
611 // instruction stream. What this means exactly is architecture-independent. 604 // instruction stream. What this means exactly is architecture-independent.
612 // The only architecture-independent user of this function is the serializer. 605 // The only architecture-independent user of this function is the serializer.
613 // The serializer uses it to find out how many raw bytes of instruction to 606 // The serializer uses it to find out how many raw bytes of instruction to
614 // output before the next target. Architecture-independent code shouldn't 607 // output before the next target. Architecture-independent code shouldn't
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 static const int kCodeTargetMask = (1 << (LAST_CODE_ENUM + 1)) - 1; 668 static const int kCodeTargetMask = (1 << (LAST_CODE_ENUM + 1)) - 1;
676 static const int kPositionMask = 1 << POSITION | 1 << STATEMENT_POSITION; 669 static const int kPositionMask = 1 << POSITION | 1 << STATEMENT_POSITION;
677 static const int kDataMask = 670 static const int kDataMask =
678 (1 << CODE_TARGET_WITH_ID) | kPositionMask | (1 << COMMENT); 671 (1 << CODE_TARGET_WITH_ID) | kPositionMask | (1 << COMMENT);
679 static const int kDebugBreakSlotMask = 1 << DEBUG_BREAK_SLOT_AT_POSITION | 672 static const int kDebugBreakSlotMask = 1 << DEBUG_BREAK_SLOT_AT_POSITION |
680 1 << DEBUG_BREAK_SLOT_AT_RETURN | 673 1 << DEBUG_BREAK_SLOT_AT_RETURN |
681 1 << DEBUG_BREAK_SLOT_AT_CALL; 674 1 << DEBUG_BREAK_SLOT_AT_CALL;
682 static const int kApplyMask; // Modes affected by apply. Depends on arch. 675 static const int kApplyMask; // Modes affected by apply. Depends on arch.
683 676
684 private: 677 private:
678 void unchecked_update_wasm_memory_reference(Address address,
679 ICacheFlushMode flush_mode);
680 void unchecked_update_wasm_memory_size(uint32_t size,
681 ICacheFlushMode flush_mode);
682
685 Isolate* isolate_; 683 Isolate* isolate_;
686 // On ARM, note that pc_ is the address of the constant pool entry 684 // On ARM, note that pc_ is the address of the constant pool entry
687 // to be relocated and not the address of the instruction 685 // to be relocated and not the address of the instruction
688 // referencing the constant pool entry (except when rmode_ == 686 // referencing the constant pool entry (except when rmode_ ==
689 // comment). 687 // comment).
690 byte* pc_; 688 byte* pc_;
691 Mode rmode_; 689 Mode rmode_;
692 intptr_t data_; 690 intptr_t data_;
693 Code* host_; 691 Code* host_;
694 friend class RelocIterator; 692 friend class RelocIterator;
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
1352 std::vector<ConstantPoolEntry> shared_entries; 1350 std::vector<ConstantPoolEntry> shared_entries;
1353 }; 1351 };
1354 1352
1355 Label emitted_label_; // Records pc_offset of emitted pool 1353 Label emitted_label_; // Records pc_offset of emitted pool
1356 PerTypeEntryInfo info_[ConstantPoolEntry::NUMBER_OF_TYPES]; 1354 PerTypeEntryInfo info_[ConstantPoolEntry::NUMBER_OF_TYPES];
1357 }; 1355 };
1358 1356
1359 } // namespace internal 1357 } // namespace internal
1360 } // namespace v8 1358 } // namespace v8
1361 #endif // V8_ASSEMBLER_H_ 1359 #endif // V8_ASSEMBLER_H_
OLDNEW
« no previous file with comments | « src/arm64/assembler-arm64.cc ('k') | src/assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698