OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // Scratch registers: | 76 // Scratch registers: |
77 // t0: used to holds the receiver map. | 77 // t0: used to holds the receiver map. |
78 // t1: used to holds the receiver instance type, receiver bit mask and | 78 // t1: used to holds the receiver instance type, receiver bit mask and |
79 // elements map. | 79 // elements map. |
80 | 80 |
81 // Check that the receiver isn't a smi. | 81 // Check that the receiver isn't a smi. |
82 __ tst(receiver, Operand(kSmiTagMask)); | 82 __ tst(receiver, Operand(kSmiTagMask)); |
83 __ b(eq, miss); | 83 __ b(eq, miss); |
84 | 84 |
85 // Check that the receiver is a valid JS object. | 85 // Check that the receiver is a valid JS object. |
86 __ CompareObjectType(receiver, t0, t1, FIRST_JS_OBJECT_TYPE); | 86 __ CompareObjectType(receiver, t0, t1, FIRST_SPEC_OBJECT_TYPE); |
87 __ b(lt, miss); | 87 __ b(lt, miss); |
88 | 88 |
89 // If this assert fails, we have to check upper bound too. | 89 // If this assert fails, we have to check upper bound too. |
90 ASSERT(LAST_TYPE == JS_FUNCTION_TYPE); | 90 STATIC_ASSERT(LAST_TYPE == LAST_SPEC_OBJECT_TYPE); |
91 | 91 |
92 GenerateGlobalInstanceTypeCheck(masm, t1, miss); | 92 GenerateGlobalInstanceTypeCheck(masm, t1, miss); |
93 | 93 |
94 // Check that the global object does not require access checks. | 94 // Check that the global object does not require access checks. |
95 __ ldrb(t1, FieldMemOperand(t0, Map::kBitFieldOffset)); | 95 __ ldrb(t1, FieldMemOperand(t0, Map::kBitFieldOffset)); |
96 __ tst(t1, Operand((1 << Map::kIsAccessCheckNeeded) | | 96 __ tst(t1, Operand((1 << Map::kIsAccessCheckNeeded) | |
97 (1 << Map::kHasNamedInterceptor))); | 97 (1 << Map::kHasNamedInterceptor))); |
98 __ b(ne, miss); | 98 __ b(ne, miss); |
99 | 99 |
100 __ ldr(elements, FieldMemOperand(receiver, JSObject::kPropertiesOffset)); | 100 __ ldr(elements, FieldMemOperand(receiver, JSObject::kPropertiesOffset)); |
(...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1225 __ ldr(r4, FieldMemOperand(receiver, HeapObject::kMapOffset)); | 1225 __ ldr(r4, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
1226 // Check that the receiver does not require access checks. We need | 1226 // Check that the receiver does not require access checks. We need |
1227 // to do this because this generic stub does not perform map checks. | 1227 // to do this because this generic stub does not perform map checks. |
1228 __ ldrb(ip, FieldMemOperand(r4, Map::kBitFieldOffset)); | 1228 __ ldrb(ip, FieldMemOperand(r4, Map::kBitFieldOffset)); |
1229 __ tst(ip, Operand(1 << Map::kIsAccessCheckNeeded)); | 1229 __ tst(ip, Operand(1 << Map::kIsAccessCheckNeeded)); |
1230 __ b(ne, &slow); | 1230 __ b(ne, &slow); |
1231 // Check if the object is a JS array or not. | 1231 // Check if the object is a JS array or not. |
1232 __ ldrb(r4, FieldMemOperand(r4, Map::kInstanceTypeOffset)); | 1232 __ ldrb(r4, FieldMemOperand(r4, Map::kInstanceTypeOffset)); |
1233 __ cmp(r4, Operand(JS_ARRAY_TYPE)); | 1233 __ cmp(r4, Operand(JS_ARRAY_TYPE)); |
1234 __ b(eq, &array); | 1234 __ b(eq, &array); |
1235 // Check that the object is some kind of JS object. | 1235 // Check that the object is some kind of JSObject. |
1236 __ cmp(r4, Operand(FIRST_JS_OBJECT_TYPE)); | 1236 __ cmp(r4, Operand(FIRST_JS_RECEIVER_TYPE)); |
1237 __ b(lt, &slow); | 1237 __ b(lt, &slow); |
| 1238 __ cmp(r4, Operand(JS_PROXY_TYPE)); |
| 1239 __ b(eq, &slow); |
| 1240 __ cmp(r4, Operand(JS_FUNCTION_PROXY_TYPE)); |
| 1241 __ b(eq, &slow); |
1238 | 1242 |
1239 // Object case: Check key against length in the elements array. | 1243 // Object case: Check key against length in the elements array. |
1240 __ ldr(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); | 1244 __ ldr(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); |
1241 // Check that the object is in fast mode and writable. | 1245 // Check that the object is in fast mode and writable. |
1242 __ ldr(r4, FieldMemOperand(elements, HeapObject::kMapOffset)); | 1246 __ ldr(r4, FieldMemOperand(elements, HeapObject::kMapOffset)); |
1243 __ LoadRoot(ip, Heap::kFixedArrayMapRootIndex); | 1247 __ LoadRoot(ip, Heap::kFixedArrayMapRootIndex); |
1244 __ cmp(r4, ip); | 1248 __ cmp(r4, ip); |
1245 __ b(ne, &slow); | 1249 __ b(ne, &slow); |
1246 // Check array bounds. Both the key and the length of FixedArray are smis. | 1250 // Check array bounds. Both the key and the length of FixedArray are smis. |
1247 __ ldr(ip, FieldMemOperand(elements, FixedArray::kLengthOffset)); | 1251 __ ldr(ip, FieldMemOperand(elements, FixedArray::kLengthOffset)); |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1556 Register reg = Assembler::GetRn(instr_at_patch); | 1560 Register reg = Assembler::GetRn(instr_at_patch); |
1557 patcher.masm()->tst(reg, Operand(kSmiTagMask)); | 1561 patcher.masm()->tst(reg, Operand(kSmiTagMask)); |
1558 patcher.EmitCondition(eq); | 1562 patcher.EmitCondition(eq); |
1559 } | 1563 } |
1560 } | 1564 } |
1561 | 1565 |
1562 | 1566 |
1563 } } // namespace v8::internal | 1567 } } // namespace v8::internal |
1564 | 1568 |
1565 #endif // V8_TARGET_ARCH_ARM | 1569 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |