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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 static const int kMaxSmallPCDelta; | 379 static const int kMaxSmallPCDelta; |
380 | 380 |
381 enum Mode { | 381 enum Mode { |
382 // Please note the order is important (see IsCodeTarget, IsGCRelocMode). | 382 // Please note the order is important (see IsCodeTarget, IsGCRelocMode). |
383 CODE_TARGET, // Code target which is not any of the above. | 383 CODE_TARGET, // Code target which is not any of the above. |
384 CODE_TARGET_WITH_ID, | 384 CODE_TARGET_WITH_ID, |
385 DEBUGGER_STATEMENT, // Code target for the debugger statement. | 385 DEBUGGER_STATEMENT, // Code target for the debugger statement. |
386 EMBEDDED_OBJECT, | 386 EMBEDDED_OBJECT, |
387 // To relocate pointers into the wasm memory embedded in wasm code | 387 // To relocate pointers into the wasm memory embedded in wasm code |
388 WASM_MEMORY_REFERENCE, | 388 WASM_MEMORY_REFERENCE, |
| 389 WASM_GLOBAL_REFERENCE, |
389 WASM_MEMORY_SIZE_REFERENCE, | 390 WASM_MEMORY_SIZE_REFERENCE, |
390 CELL, | 391 CELL, |
391 | 392 |
392 // Everything after runtime_entry (inclusive) is not GC'ed. | 393 // Everything after runtime_entry (inclusive) is not GC'ed. |
393 RUNTIME_ENTRY, | 394 RUNTIME_ENTRY, |
394 COMMENT, | 395 COMMENT, |
395 POSITION, // See comment for kNoPosition above. | 396 POSITION, // See comment for kNoPosition above. |
396 STATEMENT_POSITION, // See comment for kNoPosition above. | 397 STATEMENT_POSITION, // See comment for kNoPosition above. |
397 | 398 |
398 // Additional code inserted for debug break slot. | 399 // Additional code inserted for debug break slot. |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 } | 523 } |
523 static inline bool IsGeneratorContinuation(Mode mode) { | 524 static inline bool IsGeneratorContinuation(Mode mode) { |
524 return mode == GENERATOR_CONTINUATION; | 525 return mode == GENERATOR_CONTINUATION; |
525 } | 526 } |
526 static inline bool IsWasmMemoryReference(Mode mode) { | 527 static inline bool IsWasmMemoryReference(Mode mode) { |
527 return mode == WASM_MEMORY_REFERENCE; | 528 return mode == WASM_MEMORY_REFERENCE; |
528 } | 529 } |
529 static inline bool IsWasmMemorySizeReference(Mode mode) { | 530 static inline bool IsWasmMemorySizeReference(Mode mode) { |
530 return mode == WASM_MEMORY_SIZE_REFERENCE; | 531 return mode == WASM_MEMORY_SIZE_REFERENCE; |
531 } | 532 } |
| 533 static inline bool IsWasmGlobalReference(Mode mode) { |
| 534 return mode == WASM_GLOBAL_REFERENCE; |
| 535 } |
532 static inline int ModeMask(Mode mode) { return 1 << mode; } | 536 static inline int ModeMask(Mode mode) { return 1 << mode; } |
533 | 537 |
534 // Accessors | 538 // Accessors |
535 Isolate* isolate() const { return isolate_; } | 539 Isolate* isolate() const { return isolate_; } |
536 byte* pc() const { return pc_; } | 540 byte* pc() const { return pc_; } |
537 void set_pc(byte* pc) { pc_ = pc; } | 541 void set_pc(byte* pc) { pc_ = pc; } |
538 Mode rmode() const { return rmode_; } | 542 Mode rmode() const { return rmode_; } |
539 intptr_t data() const { return data_; } | 543 intptr_t data() const { return data_; } |
540 Code* host() const { return host_; } | 544 Code* host() const { return host_; } |
541 void set_host(Code* host) { host_ = host; } | 545 void set_host(Code* host) { host_ = host; } |
542 | 546 |
543 // Apply a relocation by delta bytes. When the code object is moved, PC | 547 // Apply a relocation by delta bytes. When the code object is moved, PC |
544 // relative addresses have to be updated as well as absolute addresses | 548 // relative addresses have to be updated as well as absolute addresses |
545 // inside the code (internal references). | 549 // inside the code (internal references). |
546 // Do not forget to flush the icache afterwards! | 550 // Do not forget to flush the icache afterwards! |
547 INLINE(void apply(intptr_t delta)); | 551 INLINE(void apply(intptr_t delta)); |
548 | 552 |
549 // Is the pointer this relocation info refers to coded like a plain pointer | 553 // Is the pointer this relocation info refers to coded like a plain pointer |
550 // or is it strange in some way (e.g. relative or patched into a series of | 554 // or is it strange in some way (e.g. relative or patched into a series of |
551 // instructions). | 555 // instructions). |
552 bool IsCodedSpecially(); | 556 bool IsCodedSpecially(); |
553 | 557 |
554 // If true, the pointer this relocation info refers to is an entry in the | 558 // If true, the pointer this relocation info refers to is an entry in the |
555 // constant pool, otherwise the pointer is embedded in the instruction stream. | 559 // constant pool, otherwise the pointer is embedded in the instruction stream. |
556 bool IsInConstantPool(); | 560 bool IsInConstantPool(); |
557 | 561 |
558 Address wasm_memory_reference(); | 562 Address wasm_memory_reference(); |
| 563 Address wasm_global_reference(); |
559 uint32_t wasm_memory_size_reference(); | 564 uint32_t wasm_memory_size_reference(); |
560 void update_wasm_memory_reference( | 565 void update_wasm_memory_reference( |
561 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size, | 566 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size, |
562 ICacheFlushMode icache_flush_mode = SKIP_ICACHE_FLUSH); | 567 ICacheFlushMode icache_flush_mode = SKIP_ICACHE_FLUSH); |
| 568 void update_wasm_global_reference( |
| 569 Address old_base, Address new_base, |
| 570 ICacheFlushMode icache_flush_mode = SKIP_ICACHE_FLUSH); |
563 | 571 |
564 // this relocation applies to; | 572 // this relocation applies to; |
565 // can only be called if IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) | 573 // can only be called if IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) |
566 INLINE(Address target_address()); | 574 INLINE(Address target_address()); |
567 INLINE(void set_target_address(Address target, | 575 INLINE(void set_target_address(Address target, |
568 WriteBarrierMode write_barrier_mode = | 576 WriteBarrierMode write_barrier_mode = |
569 UPDATE_WRITE_BARRIER, | 577 UPDATE_WRITE_BARRIER, |
570 ICacheFlushMode icache_flush_mode = | 578 ICacheFlushMode icache_flush_mode = |
571 FLUSH_ICACHE_IF_NEEDED)); | 579 FLUSH_ICACHE_IF_NEEDED)); |
572 INLINE(Object* target_object()); | 580 INLINE(Object* target_object()); |
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1340 std::vector<ConstantPoolEntry> shared_entries; | 1348 std::vector<ConstantPoolEntry> shared_entries; |
1341 }; | 1349 }; |
1342 | 1350 |
1343 Label emitted_label_; // Records pc_offset of emitted pool | 1351 Label emitted_label_; // Records pc_offset of emitted pool |
1344 PerTypeEntryInfo info_[ConstantPoolEntry::NUMBER_OF_TYPES]; | 1352 PerTypeEntryInfo info_[ConstantPoolEntry::NUMBER_OF_TYPES]; |
1345 }; | 1353 }; |
1346 | 1354 |
1347 } // namespace internal | 1355 } // namespace internal |
1348 } // namespace v8 | 1356 } // namespace v8 |
1349 #endif // V8_ASSEMBLER_H_ | 1357 #endif // V8_ASSEMBLER_H_ |
OLD | NEW |