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

Side by Side Diff: src/x64/assembler-x64.h

Issue 1131783003: Embedded constant pools. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix debug-mode Arm issue. Created 5 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/snapshot/serialize.cc ('k') | src/x64/assembler-x64.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 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 // Assembler functions are invoked in between GetCode() calls. 528 // Assembler functions are invoked in between GetCode() calls.
529 void GetCode(CodeDesc* desc); 529 void GetCode(CodeDesc* desc);
530 530
531 // Read/Modify the code target in the relative branch/call instruction at pc. 531 // Read/Modify the code target in the relative branch/call instruction at pc.
532 // On the x64 architecture, we use relative jumps with a 32-bit displacement 532 // On the x64 architecture, we use relative jumps with a 32-bit displacement
533 // to jump to other Code objects in the Code space in the heap. 533 // to jump to other Code objects in the Code space in the heap.
534 // Jumps to C functions are done indirectly through a 64-bit register holding 534 // Jumps to C functions are done indirectly through a 64-bit register holding
535 // the absolute address of the target. 535 // the absolute address of the target.
536 // These functions convert between absolute Addresses of Code objects and 536 // These functions convert between absolute Addresses of Code objects and
537 // the relative displacements stored in the code. 537 // the relative displacements stored in the code.
538 static inline Address target_address_at(Address pc, 538 static inline Address target_address_at(Address pc, Address constant_pool);
539 ConstantPoolArray* constant_pool); 539 static inline void set_target_address_at(
540 static inline void set_target_address_at(Address pc, 540 Address pc, Address constant_pool, Address target,
541 ConstantPoolArray* constant_pool, 541 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED);
542 Address target,
543 ICacheFlushMode icache_flush_mode =
544 FLUSH_ICACHE_IF_NEEDED) ;
545 static inline Address target_address_at(Address pc, Code* code) { 542 static inline Address target_address_at(Address pc, Code* code) {
546 ConstantPoolArray* constant_pool = code ? code->constant_pool() : NULL; 543 Address constant_pool = code ? code->constant_pool() : NULL;
547 return target_address_at(pc, constant_pool); 544 return target_address_at(pc, constant_pool);
548 } 545 }
549 static inline void set_target_address_at(Address pc, 546 static inline void set_target_address_at(Address pc,
550 Code* code, 547 Code* code,
551 Address target, 548 Address target,
552 ICacheFlushMode icache_flush_mode = 549 ICacheFlushMode icache_flush_mode =
553 FLUSH_ICACHE_IF_NEEDED) { 550 FLUSH_ICACHE_IF_NEEDED) {
554 ConstantPoolArray* constant_pool = code ? code->constant_pool() : NULL; 551 Address constant_pool = code ? code->constant_pool() : NULL;
555 set_target_address_at(pc, constant_pool, target, icache_flush_mode); 552 set_target_address_at(pc, constant_pool, target, icache_flush_mode);
556 } 553 }
557 554
558 // Return the code target address at a call site from the return address 555 // Return the code target address at a call site from the return address
559 // of that call in the instruction stream. 556 // of that call in the instruction stream.
560 static inline Address target_address_from_return_address(Address pc); 557 static inline Address target_address_from_return_address(Address pc);
561 558
562 // Return the code target address of the patch debug break slot 559 // Return the code target address of the patch debug break slot
563 inline static Address break_address_from_return_address(Address pc); 560 inline static Address break_address_from_return_address(Address pc);
564 561
(...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after
1621 void RecordDebugBreakSlot(); 1618 void RecordDebugBreakSlot();
1622 1619
1623 // Record a comment relocation entry that can be used by a disassembler. 1620 // Record a comment relocation entry that can be used by a disassembler.
1624 // Use --code-comments to enable. 1621 // Use --code-comments to enable.
1625 void RecordComment(const char* msg); 1622 void RecordComment(const char* msg);
1626 1623
1627 // Record a deoptimization reason that can be used by a log or cpu profiler. 1624 // Record a deoptimization reason that can be used by a log or cpu profiler.
1628 // Use --trace-deopt to enable. 1625 // Use --trace-deopt to enable.
1629 void RecordDeoptReason(const int reason, const SourcePosition position); 1626 void RecordDeoptReason(const int reason, const SourcePosition position);
1630 1627
1631 // Allocate a constant pool of the correct size for the generated code. 1628 void PatchConstantPoolAccessInstruction(int pc_offset, int offset,
1632 Handle<ConstantPoolArray> NewConstantPool(Isolate* isolate); 1629 ConstantPoolEntry::Access access,
1633 1630 ConstantPoolEntry::Type type) {
1634 // Generate the constant pool for the generated code. 1631 // No embedded constant pool support.
1635 void PopulateConstantPool(ConstantPoolArray* constant_pool); 1632 UNREACHABLE();
1633 }
1636 1634
1637 // Writes a single word of data in the code stream. 1635 // Writes a single word of data in the code stream.
1638 // Used for inline tables, e.g., jump-tables. 1636 // Used for inline tables, e.g., jump-tables.
1639 void db(uint8_t data); 1637 void db(uint8_t data);
1640 void dd(uint32_t data); 1638 void dd(uint32_t data);
1639 void dq(uint64_t data);
1640 void dp(uintptr_t data) { dq(data); }
1641 void dq(Label* label); 1641 void dq(Label* label);
1642 1642
1643 PositionsRecorder* positions_recorder() { return &positions_recorder_; } 1643 PositionsRecorder* positions_recorder() { return &positions_recorder_; }
1644 1644
1645 // Check if there is less than kGap bytes available in the buffer. 1645 // Check if there is less than kGap bytes available in the buffer.
1646 // If this is the case, we need to grow the buffer before emitting 1646 // If this is the case, we need to grow the buffer before emitting
1647 // an instruction or relocation information. 1647 // an instruction or relocation information.
1648 inline bool buffer_overflow() const { 1648 inline bool buffer_overflow() const {
1649 return pc_ >= reloc_info_writer.pos() - kGap; 1649 return pc_ >= reloc_info_writer.pos() - kGap;
1650 } 1650 }
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
2156 private: 2156 private:
2157 Assembler* assembler_; 2157 Assembler* assembler_;
2158 #ifdef DEBUG 2158 #ifdef DEBUG
2159 int space_before_; 2159 int space_before_;
2160 #endif 2160 #endif
2161 }; 2161 };
2162 2162
2163 } } // namespace v8::internal 2163 } } // namespace v8::internal
2164 2164
2165 #endif // V8_X64_ASSEMBLER_X64_H_ 2165 #endif // V8_X64_ASSEMBLER_X64_H_
OLDNEW
« no previous file with comments | « src/snapshot/serialize.cc ('k') | src/x64/assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698