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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 // TODO(vitalyr): the assembler does not need an isolate. | 506 // TODO(vitalyr): the assembler does not need an isolate. |
507 Assembler(Isolate* isolate, void* buffer, int buffer_size); | 507 Assembler(Isolate* isolate, void* buffer, int buffer_size); |
508 virtual ~Assembler() { } | 508 virtual ~Assembler() { } |
509 | 509 |
510 // GetCode emits any pending (non-emitted) code and fills the descriptor | 510 // GetCode emits any pending (non-emitted) code and fills the descriptor |
511 // desc. GetCode() is idempotent; it returns the same result if no other | 511 // desc. GetCode() is idempotent; it returns the same result if no other |
512 // Assembler functions are invoked in between GetCode() calls. | 512 // Assembler functions are invoked in between GetCode() calls. |
513 void GetCode(CodeDesc* desc); | 513 void GetCode(CodeDesc* desc); |
514 | 514 |
515 // Read/Modify the code target in the branch/call instruction at pc. | 515 // Read/Modify the code target in the branch/call instruction at pc. |
516 inline static Address target_address_at(Address pc, | 516 inline static Address target_address_at(Address pc, Address constant_pool); |
517 ConstantPoolArray* constant_pool); | 517 inline static void set_target_address_at( |
518 inline static void set_target_address_at(Address pc, | 518 Address pc, Address constant_pool, Address target, |
519 ConstantPoolArray* constant_pool, | 519 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED); |
520 Address target, | |
521 ICacheFlushMode icache_flush_mode = | |
522 FLUSH_ICACHE_IF_NEEDED); | |
523 static inline Address target_address_at(Address pc, Code* code) { | 520 static inline Address target_address_at(Address pc, Code* code) { |
524 ConstantPoolArray* constant_pool = code ? code->constant_pool() : NULL; | 521 Address constant_pool = code ? code->constant_pool() : NULL; |
525 return target_address_at(pc, constant_pool); | 522 return target_address_at(pc, constant_pool); |
526 } | 523 } |
527 static inline void set_target_address_at(Address pc, | 524 static inline void set_target_address_at(Address pc, |
528 Code* code, | 525 Code* code, |
529 Address target, | 526 Address target, |
530 ICacheFlushMode icache_flush_mode = | 527 ICacheFlushMode icache_flush_mode = |
531 FLUSH_ICACHE_IF_NEEDED) { | 528 FLUSH_ICACHE_IF_NEEDED) { |
532 ConstantPoolArray* constant_pool = code ? code->constant_pool() : NULL; | 529 Address constant_pool = code ? code->constant_pool() : NULL; |
533 set_target_address_at(pc, constant_pool, target); | 530 set_target_address_at(pc, constant_pool, target); |
534 } | 531 } |
535 | 532 |
536 // Return the code target address at a call site from the return address | 533 // Return the code target address at a call site from the return address |
537 // of that call in the instruction stream. | 534 // of that call in the instruction stream. |
538 inline static Address target_address_from_return_address(Address pc); | 535 inline static Address target_address_from_return_address(Address pc); |
539 | 536 |
540 // Return the code target address of the patch debug break slot | 537 // Return the code target address of the patch debug break slot |
541 inline static Address break_address_from_return_address(Address pc); | 538 inline static Address break_address_from_return_address(Address pc); |
542 | 539 |
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1439 private: | 1436 private: |
1440 Assembler* assembler_; | 1437 Assembler* assembler_; |
1441 #ifdef DEBUG | 1438 #ifdef DEBUG |
1442 int space_before_; | 1439 int space_before_; |
1443 #endif | 1440 #endif |
1444 }; | 1441 }; |
1445 | 1442 |
1446 } } // namespace v8::internal | 1443 } } // namespace v8::internal |
1447 | 1444 |
1448 #endif // V8_IA32_ASSEMBLER_IA32_H_ | 1445 #endif // V8_IA32_ASSEMBLER_IA32_H_ |
OLD | NEW |