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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
377 | 377 |
378 // The maximum pc delta that will use the short encoding. | 378 // The maximum pc delta that will use the short encoding. |
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 CELL, | |
388 // To relocate pointers into the wasm memory embedded in wasm code | 387 // To relocate pointers into the wasm memory embedded in wasm code |
389 WASM_MEMORY_REFERENCE, | 388 WASM_MEMORY_REFERENCE, |
389 WASM_MEMORY_SIZE_REFERENCE, | |
gdeepti
2016/04/26 08:09:36
Removing wasm RelocInfo modes from the shareable r
| |
390 CELL, | |
390 | 391 |
391 // Everything after runtime_entry (inclusive) is not GC'ed. | 392 // Everything after runtime_entry (inclusive) is not GC'ed. |
392 RUNTIME_ENTRY, | 393 RUNTIME_ENTRY, |
393 COMMENT, | 394 COMMENT, |
394 POSITION, // See comment for kNoPosition above. | 395 POSITION, // See comment for kNoPosition above. |
395 STATEMENT_POSITION, // See comment for kNoPosition above. | 396 STATEMENT_POSITION, // See comment for kNoPosition above. |
396 | 397 |
397 // Additional code inserted for debug break slot. | 398 // Additional code inserted for debug break slot. |
398 DEBUG_BREAK_SLOT_AT_POSITION, | 399 DEBUG_BREAK_SLOT_AT_POSITION, |
399 DEBUG_BREAK_SLOT_AT_RETURN, | 400 DEBUG_BREAK_SLOT_AT_RETURN, |
(...skipping 23 matching lines...) Expand all Loading... | |
423 // Pseudo-types | 424 // Pseudo-types |
424 NUMBER_OF_MODES, | 425 NUMBER_OF_MODES, |
425 NONE32, // never recorded 32-bit value | 426 NONE32, // never recorded 32-bit value |
426 NONE64, // never recorded 64-bit value | 427 NONE64, // never recorded 64-bit value |
427 CODE_AGE_SEQUENCE, // Not stored in RelocInfo array, used explictly by | 428 CODE_AGE_SEQUENCE, // Not stored in RelocInfo array, used explictly by |
428 // code aging. | 429 // code aging. |
429 | 430 |
430 FIRST_REAL_RELOC_MODE = CODE_TARGET, | 431 FIRST_REAL_RELOC_MODE = CODE_TARGET, |
431 LAST_REAL_RELOC_MODE = VENEER_POOL, | 432 LAST_REAL_RELOC_MODE = VENEER_POOL, |
432 LAST_CODE_ENUM = DEBUGGER_STATEMENT, | 433 LAST_CODE_ENUM = DEBUGGER_STATEMENT, |
433 LAST_GCED_ENUM = WASM_MEMORY_REFERENCE, | 434 LAST_GCED_ENUM = WASM_MEMORY_SIZE_REFERENCE, |
434 FIRST_SHAREABLE_RELOC_MODE = CELL, | 435 FIRST_SHAREABLE_RELOC_MODE = CELL, |
435 }; | 436 }; |
436 | 437 |
437 STATIC_ASSERT(NUMBER_OF_MODES <= kBitsPerInt); | 438 STATIC_ASSERT(NUMBER_OF_MODES <= kBitsPerInt); |
438 | 439 |
439 explicit RelocInfo(Isolate* isolate) : isolate_(isolate) { | 440 explicit RelocInfo(Isolate* isolate) : isolate_(isolate) { |
440 DCHECK_NOT_NULL(isolate); | 441 DCHECK_NOT_NULL(isolate); |
441 } | 442 } |
442 | 443 |
443 RelocInfo(Isolate* isolate, byte* pc, Mode rmode, intptr_t data, Code* host) | 444 RelocInfo(Isolate* isolate, byte* pc, Mode rmode, intptr_t data, Code* host) |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
514 } | 515 } |
515 static inline bool IsCodeAgeSequence(Mode mode) { | 516 static inline bool IsCodeAgeSequence(Mode mode) { |
516 return mode == CODE_AGE_SEQUENCE; | 517 return mode == CODE_AGE_SEQUENCE; |
517 } | 518 } |
518 static inline bool IsGeneratorContinuation(Mode mode) { | 519 static inline bool IsGeneratorContinuation(Mode mode) { |
519 return mode == GENERATOR_CONTINUATION; | 520 return mode == GENERATOR_CONTINUATION; |
520 } | 521 } |
521 static inline bool IsWasmMemoryReference(Mode mode) { | 522 static inline bool IsWasmMemoryReference(Mode mode) { |
522 return mode == WASM_MEMORY_REFERENCE; | 523 return mode == WASM_MEMORY_REFERENCE; |
523 } | 524 } |
525 static inline bool IsWasmMemorySizeReference(Mode mode) { | |
526 return mode == WASM_MEMORY_SIZE_REFERENCE; | |
527 } | |
524 static inline int ModeMask(Mode mode) { return 1 << mode; } | 528 static inline int ModeMask(Mode mode) { return 1 << mode; } |
525 | 529 |
526 // Accessors | 530 // Accessors |
527 Isolate* isolate() const { return isolate_; } | 531 Isolate* isolate() const { return isolate_; } |
528 byte* pc() const { return pc_; } | 532 byte* pc() const { return pc_; } |
529 void set_pc(byte* pc) { pc_ = pc; } | 533 void set_pc(byte* pc) { pc_ = pc; } |
530 Mode rmode() const { return rmode_; } | 534 Mode rmode() const { return rmode_; } |
531 intptr_t data() const { return data_; } | 535 intptr_t data() const { return data_; } |
532 Code* host() const { return host_; } | 536 Code* host() const { return host_; } |
533 void set_host(Code* host) { host_ = host; } | 537 void set_host(Code* host) { host_ = host; } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
575 UPDATE_WRITE_BARRIER, | 579 UPDATE_WRITE_BARRIER, |
576 ICacheFlushMode icache_flush_mode = | 580 ICacheFlushMode icache_flush_mode = |
577 FLUSH_ICACHE_IF_NEEDED)); | 581 FLUSH_ICACHE_IF_NEEDED)); |
578 INLINE(Handle<Object> code_age_stub_handle(Assembler* origin)); | 582 INLINE(Handle<Object> code_age_stub_handle(Assembler* origin)); |
579 INLINE(Code* code_age_stub()); | 583 INLINE(Code* code_age_stub()); |
580 INLINE(void set_code_age_stub(Code* stub, | 584 INLINE(void set_code_age_stub(Code* stub, |
581 ICacheFlushMode icache_flush_mode = | 585 ICacheFlushMode icache_flush_mode = |
582 FLUSH_ICACHE_IF_NEEDED)); | 586 FLUSH_ICACHE_IF_NEEDED)); |
583 | 587 |
584 INLINE(Address wasm_memory_reference()); | 588 INLINE(Address wasm_memory_reference()); |
589 INLINE(int32_t wasm_memory_size_reference()); | |
585 INLINE(void update_wasm_memory_reference( | 590 INLINE(void update_wasm_memory_reference( |
586 Address old_base, Address new_base, size_t old_size, size_t new_size, | 591 Address old_base, Address new_base, int32_t old_size, int32_t new_size, |
587 ICacheFlushMode icache_flush_mode = SKIP_ICACHE_FLUSH)); | 592 ICacheFlushMode icache_flush_mode = SKIP_ICACHE_FLUSH)); |
588 // Returns the address of the constant pool entry where the target address | 593 // Returns the address of the constant pool entry where the target address |
589 // is held. This should only be called if IsInConstantPool returns true. | 594 // is held. This should only be called if IsInConstantPool returns true. |
590 INLINE(Address constant_pool_entry_address()); | 595 INLINE(Address constant_pool_entry_address()); |
591 | 596 |
592 // Read the address of the word containing the target_address in an | 597 // Read the address of the word containing the target_address in an |
593 // instruction stream. What this means exactly is architecture-independent. | 598 // instruction stream. What this means exactly is architecture-independent. |
594 // The only architecture-independent user of this function is the serializer. | 599 // The only architecture-independent user of this function is the serializer. |
595 // The serializer uses it to find out how many raw bytes of instruction to | 600 // The serializer uses it to find out how many raw bytes of instruction to |
596 // output before the next target. Architecture-independent code shouldn't | 601 // output before the next target. Architecture-independent code shouldn't |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1326 std::vector<ConstantPoolEntry> shared_entries; | 1331 std::vector<ConstantPoolEntry> shared_entries; |
1327 }; | 1332 }; |
1328 | 1333 |
1329 Label emitted_label_; // Records pc_offset of emitted pool | 1334 Label emitted_label_; // Records pc_offset of emitted pool |
1330 PerTypeEntryInfo info_[ConstantPoolEntry::NUMBER_OF_TYPES]; | 1335 PerTypeEntryInfo info_[ConstantPoolEntry::NUMBER_OF_TYPES]; |
1331 }; | 1336 }; |
1332 | 1337 |
1333 } // namespace internal | 1338 } // namespace internal |
1334 } // namespace v8 | 1339 } // namespace v8 |
1335 #endif // V8_ASSEMBLER_H_ | 1340 #endif // V8_ASSEMBLER_H_ |
OLD | NEW |