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

Unified Diff: runtime/vm/code_patcher_x64.cc

Issue 12646012: Improve code (less code, slightly faster) for polymorphic calls, by loading the argument descriptor… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/code_patcher_ia32.cc ('k') | runtime/vm/flow_graph_compiler_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_patcher_x64.cc
===================================================================
--- runtime/vm/code_patcher_x64.cc (revision 20234)
+++ runtime/vm/code_patcher_x64.cc (working copy)
@@ -86,7 +86,7 @@
// The expected pattern of a dart static call:
-// mov R10, arguments_descriptor_array (10 bytes)
+// mov R10, arguments_descriptor_array (10 bytes) (optional in polym. calls)
// mov R11, target_address (10 bytes)
// call R11 (3 bytes)
// <- return address
@@ -95,28 +95,27 @@
explicit StaticCall(uword return_address)
: start_(return_address - kCallPatternSize) {
ASSERT(IsValid(return_address));
- ASSERT((kCallPatternSize - 10) == Assembler::kCallExternalLabelSize);
+ ASSERT(kCallPatternSize == Assembler::kCallExternalLabelSize);
}
- static const int kCallPatternSize = 23;
+ static const int kCallPatternSize = 13;
static bool IsValid(uword return_address) {
uint8_t* code_bytes =
reinterpret_cast<uint8_t*>(return_address - kCallPatternSize);
- return (code_bytes[00] == 0x49) && (code_bytes[01] == 0xBA) &&
- (code_bytes[10] == 0x49) && (code_bytes[11] == 0xBB) &&
- (code_bytes[20] == 0x41) && (code_bytes[21] == 0xFF) &&
- (code_bytes[22] == 0xD3);
+ return (code_bytes[00] == 0x49) && (code_bytes[01] == 0xBB) &&
+ (code_bytes[10] == 0x41) && (code_bytes[11] == 0xFF) &&
+ (code_bytes[12] == 0xD3);
}
uword target() const {
- return *reinterpret_cast<uword*>(start_ + 10 + 2);
+ return *reinterpret_cast<uword*>(start_ + 2);
}
void set_target(uword target) const {
- uword* target_addr = reinterpret_cast<uword*>(start_ + 10 + 2);
+ uword* target_addr = reinterpret_cast<uword*>(start_ + 2);
*target_addr = target;
- CPU::FlushICache(start_ + 10, 2 + 8);
+ CPU::FlushICache(start_, 2 + 8);
}
private:
« no previous file with comments | « runtime/vm/code_patcher_ia32.cc ('k') | runtime/vm/flow_graph_compiler_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698