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

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

Issue 284153004: Avoid flushing the icache unnecessarily when updating target addresses in code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix intenting Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « src/objects.cc ('k') | src/x64/assembler-x64-inl.h » ('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 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 // On the x64 architecture, we use relative jumps with a 32-bit displacement 511 // On the x64 architecture, we use relative jumps with a 32-bit displacement
512 // to jump to other Code objects in the Code space in the heap. 512 // to jump to other Code objects in the Code space in the heap.
513 // Jumps to C functions are done indirectly through a 64-bit register holding 513 // Jumps to C functions are done indirectly through a 64-bit register holding
514 // the absolute address of the target. 514 // the absolute address of the target.
515 // These functions convert between absolute Addresses of Code objects and 515 // These functions convert between absolute Addresses of Code objects and
516 // the relative displacements stored in the code. 516 // the relative displacements stored in the code.
517 static inline Address target_address_at(Address pc, 517 static inline Address target_address_at(Address pc,
518 ConstantPoolArray* constant_pool); 518 ConstantPoolArray* constant_pool);
519 static inline void set_target_address_at(Address pc, 519 static inline void set_target_address_at(Address pc,
520 ConstantPoolArray* constant_pool, 520 ConstantPoolArray* constant_pool,
521 Address target); 521 Address target,
522 ICacheFlushMode icache_flush_mode =
523 FLUSH_ICACHE_IF_NEEDED) ;
522 static inline Address target_address_at(Address pc, Code* code) { 524 static inline Address target_address_at(Address pc, Code* code) {
523 ConstantPoolArray* constant_pool = code ? code->constant_pool() : NULL; 525 ConstantPoolArray* constant_pool = code ? code->constant_pool() : NULL;
524 return target_address_at(pc, constant_pool); 526 return target_address_at(pc, constant_pool);
525 } 527 }
526 static inline void set_target_address_at(Address pc, 528 static inline void set_target_address_at(Address pc,
527 Code* code, 529 Code* code,
528 Address target) { 530 Address target,
531 ICacheFlushMode icache_flush_mode =
532 FLUSH_ICACHE_IF_NEEDED) {
529 ConstantPoolArray* constant_pool = code ? code->constant_pool() : NULL; 533 ConstantPoolArray* constant_pool = code ? code->constant_pool() : NULL;
530 set_target_address_at(pc, constant_pool, target); 534 set_target_address_at(pc, constant_pool, target, icache_flush_mode);
531 } 535 }
532 536
533 // Return the code target address at a call site from the return address 537 // Return the code target address at a call site from the return address
534 // of that call in the instruction stream. 538 // of that call in the instruction stream.
535 static inline Address target_address_from_return_address(Address pc); 539 static inline Address target_address_from_return_address(Address pc);
536 540
537 // This sets the branch destination (which is in the instruction on x64). 541 // This sets the branch destination (which is in the instruction on x64).
538 // This is for calls and branches within generated code. 542 // This is for calls and branches within generated code.
539 inline static void deserialization_set_special_target_at( 543 inline static void deserialization_set_special_target_at(
540 Address instruction_payload, Code* code, Address target) { 544 Address instruction_payload, Code* code, Address target) {
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after
1576 private: 1580 private:
1577 Assembler* assembler_; 1581 Assembler* assembler_;
1578 #ifdef DEBUG 1582 #ifdef DEBUG
1579 int space_before_; 1583 int space_before_;
1580 #endif 1584 #endif
1581 }; 1585 };
1582 1586
1583 } } // namespace v8::internal 1587 } } // namespace v8::internal
1584 1588
1585 #endif // V8_X64_ASSEMBLER_X64_H_ 1589 #endif // V8_X64_ASSEMBLER_X64_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/x64/assembler-x64-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698