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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 // Get the receiver of the function from the stack into r1. | 202 // Get the receiver of the function from the stack into r1. |
203 __ ldr(r1, MemOperand(sp, argc * kPointerSize)); | 203 __ ldr(r1, MemOperand(sp, argc * kPointerSize)); |
204 // Check that the receiver isn't a smi. | 204 // Check that the receiver isn't a smi. |
205 __ tst(r1, Operand(kSmiTagMask)); | 205 __ tst(r1, Operand(kSmiTagMask)); |
206 __ b(eq, &miss); | 206 __ b(eq, &miss); |
207 | 207 |
208 // Do the right check and compute the holder register. | 208 // Do the right check and compute the holder register. |
209 Register reg = | 209 Register reg = |
210 __ CheckMaps(JSObject::cast(object), r1, holder, r3, r2, &miss); | 210 __ CheckMaps(JSObject::cast(object), r1, holder, r3, r2, &miss); |
211 | 211 |
212 // Get the properties array of the holder and get the function from the field. | 212 // Adjust for the number of properties stored in the holder. |
213 int offset = index * kPointerSize + Array::kHeaderSize; | 213 index -= holder->map()->inobject_properties(); |
214 __ ldr(r1, FieldMemOperand(reg, JSObject::kPropertiesOffset)); | 214 if (index < 0) { |
215 __ ldr(r1, FieldMemOperand(r1, offset)); | 215 // Get the property straight out of the holder. |
| 216 int offset = holder->map()->instance_size() + (index * kPointerSize); |
| 217 __ ldr(r1, FieldMemOperand(reg, offset)); |
| 218 } else { |
| 219 // Get the properties array of the holder and get the function from |
| 220 // the field. |
| 221 int offset = index * kPointerSize + Array::kHeaderSize; |
| 222 __ ldr(r1, FieldMemOperand(reg, JSObject::kPropertiesOffset)); |
| 223 __ ldr(r1, FieldMemOperand(r1, offset)); |
| 224 } |
216 | 225 |
217 // Check that the function really is a function. | 226 // Check that the function really is a function. |
218 __ tst(r1, Operand(kSmiTagMask)); | 227 __ tst(r1, Operand(kSmiTagMask)); |
219 __ b(eq, &miss); | 228 __ b(eq, &miss); |
220 // Get the map. | 229 // Get the map. |
221 __ ldr(r2, FieldMemOperand(r1, HeapObject::kMapOffset)); | 230 __ ldr(r2, FieldMemOperand(r1, HeapObject::kMapOffset)); |
222 __ ldrb(r2, FieldMemOperand(r2, Map::kInstanceTypeOffset)); | 231 __ ldrb(r2, FieldMemOperand(r2, Map::kInstanceTypeOffset)); |
223 __ cmp(r2, Operand(JS_FUNCTION_TYPE)); | 232 __ cmp(r2, Operand(JS_FUNCTION_TYPE)); |
224 __ b(ne, &miss); | 233 __ b(ne, &miss); |
225 | 234 |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 String* name) { | 835 String* name) { |
827 UNIMPLEMENTED(); | 836 UNIMPLEMENTED(); |
828 return Heap::undefined_value(); | 837 return Heap::undefined_value(); |
829 } | 838 } |
830 | 839 |
831 | 840 |
832 | 841 |
833 #undef __ | 842 #undef __ |
834 | 843 |
835 } } // namespace v8::internal | 844 } } // namespace v8::internal |
OLD | NEW |