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

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

Issue 1155703006: Revert of Embedded constant pools. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/heap/spaces.cc ('k') | src/ia32/assembler-ia32.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 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 // TODO(vitalyr): the assembler does not need an isolate. 505 // TODO(vitalyr): the assembler does not need an isolate.
506 Assembler(Isolate* isolate, void* buffer, int buffer_size); 506 Assembler(Isolate* isolate, void* buffer, int buffer_size);
507 virtual ~Assembler() { } 507 virtual ~Assembler() { }
508 508
509 // GetCode emits any pending (non-emitted) code and fills the descriptor 509 // GetCode emits any pending (non-emitted) code and fills the descriptor
510 // desc. GetCode() is idempotent; it returns the same result if no other 510 // desc. GetCode() is idempotent; it returns the same result if no other
511 // Assembler functions are invoked in between GetCode() calls. 511 // Assembler functions are invoked in between GetCode() calls.
512 void GetCode(CodeDesc* desc); 512 void GetCode(CodeDesc* desc);
513 513
514 // Read/Modify the code target in the branch/call instruction at pc. 514 // Read/Modify the code target in the branch/call instruction at pc.
515 inline static Address target_address_at(Address pc, Address constant_pool); 515 inline static Address target_address_at(Address pc,
516 inline static void set_target_address_at( 516 ConstantPoolArray* constant_pool);
517 Address pc, Address constant_pool, Address target, 517 inline static void set_target_address_at(Address pc,
518 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED); 518 ConstantPoolArray* constant_pool,
519 Address target,
520 ICacheFlushMode icache_flush_mode =
521 FLUSH_ICACHE_IF_NEEDED);
519 static inline Address target_address_at(Address pc, Code* code) { 522 static inline Address target_address_at(Address pc, Code* code) {
520 Address constant_pool = code ? code->constant_pool() : NULL; 523 ConstantPoolArray* constant_pool = code ? code->constant_pool() : NULL;
521 return target_address_at(pc, constant_pool); 524 return target_address_at(pc, constant_pool);
522 } 525 }
523 static inline void set_target_address_at(Address pc, 526 static inline void set_target_address_at(Address pc,
524 Code* code, 527 Code* code,
525 Address target, 528 Address target,
526 ICacheFlushMode icache_flush_mode = 529 ICacheFlushMode icache_flush_mode =
527 FLUSH_ICACHE_IF_NEEDED) { 530 FLUSH_ICACHE_IF_NEEDED) {
528 Address constant_pool = code ? code->constant_pool() : NULL; 531 ConstantPoolArray* constant_pool = code ? code->constant_pool() : NULL;
529 set_target_address_at(pc, constant_pool, target); 532 set_target_address_at(pc, constant_pool, target);
530 } 533 }
531 534
532 // Return the code target address at a call site from the return address 535 // Return the code target address at a call site from the return address
533 // of that call in the instruction stream. 536 // of that call in the instruction stream.
534 inline static Address target_address_from_return_address(Address pc); 537 inline static Address target_address_from_return_address(Address pc);
535 538
536 // Return the code target address of the patch debug break slot 539 // Return the code target address of the patch debug break slot
537 inline static Address break_address_from_return_address(Address pc); 540 inline static Address break_address_from_return_address(Address pc);
538 541
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
1441 void RecordComment(const char* msg); 1444 void RecordComment(const char* msg);
1442 1445
1443 // Record a deoptimization reason that can be used by a log or cpu profiler. 1446 // Record a deoptimization reason that can be used by a log or cpu profiler.
1444 // Use --trace-deopt to enable. 1447 // Use --trace-deopt to enable.
1445 void RecordDeoptReason(const int reason, const SourcePosition position); 1448 void RecordDeoptReason(const int reason, const SourcePosition position);
1446 1449
1447 // Writes a single byte or word of data in the code stream. Used for 1450 // Writes a single byte or word of data in the code stream. Used for
1448 // inline tables, e.g., jump-tables. 1451 // inline tables, e.g., jump-tables.
1449 void db(uint8_t data); 1452 void db(uint8_t data);
1450 void dd(uint32_t data); 1453 void dd(uint32_t data);
1451 void dq(uint64_t data);
1452 void dp(uintptr_t data) { dd(data); }
1453 void dd(Label* label); 1454 void dd(Label* label);
1454 1455
1455 // Check if there is less than kGap bytes available in the buffer. 1456 // Check if there is less than kGap bytes available in the buffer.
1456 // If this is the case, we need to grow the buffer before emitting 1457 // If this is the case, we need to grow the buffer before emitting
1457 // an instruction or relocation information. 1458 // an instruction or relocation information.
1458 inline bool buffer_overflow() const { 1459 inline bool buffer_overflow() const {
1459 return pc_ >= reloc_info_writer.pos() - kGap; 1460 return pc_ >= reloc_info_writer.pos() - kGap;
1460 } 1461 }
1461 1462
1462 // Get the number of bytes available in the buffer. 1463 // Get the number of bytes available in the buffer.
1463 inline int available_space() const { return reloc_info_writer.pos() - pc_; } 1464 inline int available_space() const { return reloc_info_writer.pos() - pc_; }
1464 1465
1465 static bool IsNop(Address addr); 1466 static bool IsNop(Address addr);
1466 1467
1467 PositionsRecorder* positions_recorder() { return &positions_recorder_; } 1468 PositionsRecorder* positions_recorder() { return &positions_recorder_; }
1468 1469
1469 int relocation_writer_size() { 1470 int relocation_writer_size() {
1470 return (buffer_ + buffer_size_) - reloc_info_writer.pos(); 1471 return (buffer_ + buffer_size_) - reloc_info_writer.pos();
1471 } 1472 }
1472 1473
1473 // Avoid overflows for displacements etc. 1474 // Avoid overflows for displacements etc.
1474 static const int kMaximalBufferSize = 512*MB; 1475 static const int kMaximalBufferSize = 512*MB;
1475 1476
1476 byte byte_at(int pos) { return buffer_[pos]; } 1477 byte byte_at(int pos) { return buffer_[pos]; }
1477 void set_byte_at(int pos, byte value) { buffer_[pos] = value; } 1478 void set_byte_at(int pos, byte value) { buffer_[pos] = value; }
1478 1479
1479 void PatchConstantPoolAccessInstruction(int pc_offset, int offset, 1480 // Allocate a constant pool of the correct size for the generated code.
1480 ConstantPoolEntry::Access access, 1481 Handle<ConstantPoolArray> NewConstantPool(Isolate* isolate);
1481 ConstantPoolEntry::Type type) { 1482
1482 // No embedded constant pool support. 1483 // Generate the constant pool for the generated code.
1483 UNREACHABLE(); 1484 void PopulateConstantPool(ConstantPoolArray* constant_pool);
1484 }
1485 1485
1486 protected: 1486 protected:
1487 void emit_sse_operand(XMMRegister reg, const Operand& adr); 1487 void emit_sse_operand(XMMRegister reg, const Operand& adr);
1488 void emit_sse_operand(XMMRegister dst, XMMRegister src); 1488 void emit_sse_operand(XMMRegister dst, XMMRegister src);
1489 void emit_sse_operand(Register dst, XMMRegister src); 1489 void emit_sse_operand(Register dst, XMMRegister src);
1490 void emit_sse_operand(XMMRegister dst, Register src); 1490 void emit_sse_operand(XMMRegister dst, Register src);
1491 1491
1492 byte* addr_at(int pos) { return buffer_ + pos; } 1492 byte* addr_at(int pos) { return buffer_ + pos; }
1493 1493
1494 1494
(...skipping 10 matching lines...) Expand all
1505 inline void emit(uint32_t x); 1505 inline void emit(uint32_t x);
1506 inline void emit(Handle<Object> handle); 1506 inline void emit(Handle<Object> handle);
1507 inline void emit(uint32_t x, 1507 inline void emit(uint32_t x,
1508 RelocInfo::Mode rmode, 1508 RelocInfo::Mode rmode,
1509 TypeFeedbackId id = TypeFeedbackId::None()); 1509 TypeFeedbackId id = TypeFeedbackId::None());
1510 inline void emit(Handle<Code> code, 1510 inline void emit(Handle<Code> code,
1511 RelocInfo::Mode rmode, 1511 RelocInfo::Mode rmode,
1512 TypeFeedbackId id = TypeFeedbackId::None()); 1512 TypeFeedbackId id = TypeFeedbackId::None());
1513 inline void emit(const Immediate& x); 1513 inline void emit(const Immediate& x);
1514 inline void emit_w(const Immediate& x); 1514 inline void emit_w(const Immediate& x);
1515 inline void emit_q(uint64_t x);
1516 1515
1517 // Emit the code-object-relative offset of the label's position 1516 // Emit the code-object-relative offset of the label's position
1518 inline void emit_code_relative_offset(Label* label); 1517 inline void emit_code_relative_offset(Label* label);
1519 1518
1520 // instruction generation 1519 // instruction generation
1521 void emit_arith_b(int op1, int op2, Register dst, int imm8); 1520 void emit_arith_b(int op1, int op2, Register dst, int imm8);
1522 1521
1523 // Emit a basic arithmetic instruction (i.e. first byte of the family is 0x81) 1522 // Emit a basic arithmetic instruction (i.e. first byte of the family is 0x81)
1524 // with a given destination expression and an immediate operand. It attempts 1523 // with a given destination expression and an immediate operand. It attempts
1525 // to use the shortest encoding possible. 1524 // to use the shortest encoding possible.
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
1599 private: 1598 private:
1600 Assembler* assembler_; 1599 Assembler* assembler_;
1601 #ifdef DEBUG 1600 #ifdef DEBUG
1602 int space_before_; 1601 int space_before_;
1603 #endif 1602 #endif
1604 }; 1603 };
1605 1604
1606 } } // namespace v8::internal 1605 } } // namespace v8::internal
1607 1606
1608 #endif // V8_IA32_ASSEMBLER_IA32_H_ 1607 #endif // V8_IA32_ASSEMBLER_IA32_H_
OLDNEW
« no previous file with comments | « src/heap/spaces.cc ('k') | src/ia32/assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698