OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 21 matching lines...) Expand all Loading... |
32 #include "runtime.h" | 32 #include "runtime.h" |
33 #include "stub-cache.h" | 33 #include "stub-cache.h" |
34 | 34 |
35 namespace v8 { namespace internal { | 35 namespace v8 { namespace internal { |
36 | 36 |
37 | 37 |
38 // ---------------------------------------------------------------------------- | 38 // ---------------------------------------------------------------------------- |
39 // Static IC stub generators. | 39 // Static IC stub generators. |
40 // | 40 // |
41 | 41 |
42 #define __ masm-> | 42 #define __ DEFINE_MASM(masm) |
43 | 43 |
44 | 44 |
45 // Helper function used from LoadIC/CallIC GenerateNormal. | 45 // Helper function used from LoadIC/CallIC GenerateNormal. |
46 static void GenerateDictionaryLoad(MacroAssembler* masm, | 46 static void GenerateDictionaryLoad(MacroAssembler* masm, |
47 Label* miss, | 47 Label* miss, |
48 Register t0, | 48 Register t0, |
49 Register t1) { | 49 Register t1) { |
50 // Register use: | 50 // Register use: |
51 // | 51 // |
52 // t0 - used to hold the property dictionary. | 52 // t0 - used to hold the property dictionary. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 Array::kHeaderSize + Dictionary::kElementsStartIndex * kPointerSize; | 89 Array::kHeaderSize + Dictionary::kElementsStartIndex * kPointerSize; |
90 | 90 |
91 // Generate an unrolled loop that performs a few probes before | 91 // Generate an unrolled loop that performs a few probes before |
92 // giving up. Measurements done on Gmail indicate that 2 probes | 92 // giving up. Measurements done on Gmail indicate that 2 probes |
93 // cover ~93% of loads from dictionaries. | 93 // cover ~93% of loads from dictionaries. |
94 static const int kProbes = 4; | 94 static const int kProbes = 4; |
95 for (int i = 0; i < kProbes; i++) { | 95 for (int i = 0; i < kProbes; i++) { |
96 // Compute the masked index: (hash + i + i * i) & mask. | 96 // Compute the masked index: (hash + i + i * i) & mask. |
97 __ ldr(t1, FieldMemOperand(r2, String::kLengthOffset)); | 97 __ ldr(t1, FieldMemOperand(r2, String::kLengthOffset)); |
98 __ mov(t1, Operand(t1, LSR, String::kHashShift)); | 98 __ mov(t1, Operand(t1, LSR, String::kHashShift)); |
99 if (i > 0) __ add(t1, t1, Operand(Dictionary::GetProbeOffset(i))); | 99 if (i > 0) { |
| 100 __ add(t1, t1, Operand(Dictionary::GetProbeOffset(i))); |
| 101 } |
100 __ and_(t1, t1, Operand(r3)); | 102 __ and_(t1, t1, Operand(r3)); |
101 | 103 |
102 // Scale the index by multiplying by the element size. | 104 // Scale the index by multiplying by the element size. |
103 ASSERT(Dictionary::kElementSize == 3); | 105 ASSERT(Dictionary::kElementSize == 3); |
104 __ add(t1, t1, Operand(t1, LSL, 1)); // t1 = t1 * 3 | 106 __ add(t1, t1, Operand(t1, LSL, 1)); // t1 = t1 * 3 |
105 | 107 |
106 // Check if the key is identical to the name. | 108 // Check if the key is identical to the name. |
107 __ add(t1, t0, Operand(t1, LSL, 2)); | 109 __ add(t1, t0, Operand(t1, LSL, 2)); |
108 __ ldr(ip, FieldMemOperand(t1, kElementsStartOffset)); | 110 __ ldr(ip, FieldMemOperand(t1, kElementsStartOffset)); |
109 __ cmp(r2, Operand(ip)); | 111 __ cmp(r2, Operand(ip)); |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 | 792 |
791 // Perform tail call to the entry. | 793 // Perform tail call to the entry. |
792 __ TailCallRuntime(f, 3); | 794 __ TailCallRuntime(f, 3); |
793 } | 795 } |
794 | 796 |
795 | 797 |
796 #undef __ | 798 #undef __ |
797 | 799 |
798 | 800 |
799 } } // namespace v8::internal | 801 } } // namespace v8::internal |
OLD | NEW |