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

Unified Diff: src/ic-ia32.cc

Issue 16409: Inline array loads in loops directly in the code instead of always... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 12 years 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
« src/d8.cc ('K') | « src/ic-arm.cc ('k') | src/stub-cache-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic-ia32.cc
===================================================================
--- src/ic-ia32.cc (revision 1003)
+++ src/ic-ia32.cc (working copy)
@@ -733,6 +733,27 @@
}
+void KeyedLoadIC::PatchInlinedMapCheck(Address address, Object* value) {
+ static const byte kTestEaxByte = 0xA9;
+ Address test_instruction_address = address + 4; // 4 = stub address
+ // The keyed load has a fast inlined case if the IC call instruction
+ // is immediately followed by a test instruction.
+ if (*test_instruction_address == kTestEaxByte) {
+ // Fetch the offset from the call instruction to the map cmp
+ // instruction. This offset is stored in the last 4 bytes of the
+ // 5 byte test instruction.
+ Address offset_address = test_instruction_address + 1;
+ int offset_value = *(reinterpret_cast<int*>(offset_address));
+ // Compute the map address. The operand-immediate compare
+ // instruction is two bytes larger than a call instruction so we
+ // add 2 to get to the map address.
+ Address map_address = address + offset_value + 2;
+ // patch the map check.
+ (*(reinterpret_cast<Object**>(map_address))) = value;
+ }
+}
+
+
// Defined in ic.cc.
Object* KeyedLoadIC_Miss(Arguments args);
« src/d8.cc ('K') | « src/ic-arm.cc ('k') | src/stub-cache-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698