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

Side by Side Diff: src/arm/ic-arm.cc

Issue 6992072: Implement set trap for proxies, and revamp class hierarchy in preparation (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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_OBJECT_OR_FUNCTION_CLASS_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 ASSERT(LAST_TYPE == LAST_OBJECT_OR_FUNCTION_CLASS_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 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1205 // Check that the receiver does not require access checks. We need 1205 // Check that the receiver does not require access checks. We need
1206 // to do this because this generic stub does not perform map checks. 1206 // to do this because this generic stub does not perform map checks.
1207 __ ldrb(ip, FieldMemOperand(r4, Map::kBitFieldOffset)); 1207 __ ldrb(ip, FieldMemOperand(r4, Map::kBitFieldOffset));
1208 __ tst(ip, Operand(1 << Map::kIsAccessCheckNeeded)); 1208 __ tst(ip, Operand(1 << Map::kIsAccessCheckNeeded));
1209 __ b(ne, &slow); 1209 __ b(ne, &slow);
1210 // Check if the object is a JS array or not. 1210 // Check if the object is a JS array or not.
1211 __ ldrb(r4, FieldMemOperand(r4, Map::kInstanceTypeOffset)); 1211 __ ldrb(r4, FieldMemOperand(r4, Map::kInstanceTypeOffset));
1212 __ cmp(r4, Operand(JS_ARRAY_TYPE)); 1212 __ cmp(r4, Operand(JS_ARRAY_TYPE));
1213 __ b(eq, &array); 1213 __ b(eq, &array);
1214 // Check that the object is some kind of JS object. 1214 // Check that the object is some kind of JS object.
1215 __ cmp(r4, Operand(FIRST_JS_OBJECT_TYPE)); 1215 __ cmp(r4, Operand(FIRST_JS_RECEIVER_TYPE));
1216 __ b(lt, &slow); 1216 __ b(lt, &slow);
1217 __ cmp(r4, Operand(JS_PROXY_TYPE));
1218 __ b(eq, &slow);
1219 __ cmp(r4, Operand(JS_FUNCTION_PROXY_TYPE));
1220 __ b(eq, &slow);
1217 1221
1218 // Object case: Check key against length in the elements array. 1222 // Object case: Check key against length in the elements array.
1219 __ ldr(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); 1223 __ ldr(elements, FieldMemOperand(receiver, JSObject::kElementsOffset));
1220 // Check that the object is in fast mode and writable. 1224 // Check that the object is in fast mode and writable.
1221 __ ldr(r4, FieldMemOperand(elements, HeapObject::kMapOffset)); 1225 __ ldr(r4, FieldMemOperand(elements, HeapObject::kMapOffset));
1222 __ LoadRoot(ip, Heap::kFixedArrayMapRootIndex); 1226 __ LoadRoot(ip, Heap::kFixedArrayMapRootIndex);
1223 __ cmp(r4, ip); 1227 __ cmp(r4, ip);
1224 __ b(ne, &slow); 1228 __ b(ne, &slow);
1225 // Check array bounds. Both the key and the length of FixedArray are smis. 1229 // Check array bounds. Both the key and the length of FixedArray are smis.
1226 __ ldr(ip, FieldMemOperand(elements, FixedArray::kLengthOffset)); 1230 __ ldr(ip, FieldMemOperand(elements, FixedArray::kLengthOffset));
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
1535 Register reg = Assembler::GetRn(instr_at_patch); 1539 Register reg = Assembler::GetRn(instr_at_patch);
1536 patcher.masm()->tst(reg, Operand(kSmiTagMask)); 1540 patcher.masm()->tst(reg, Operand(kSmiTagMask));
1537 patcher.EmitCondition(eq); 1541 patcher.EmitCondition(eq);
1538 } 1542 }
1539 } 1543 }
1540 1544
1541 1545
1542 } } // namespace v8::internal 1546 } } // namespace v8::internal
1543 1547
1544 #endif // V8_TARGET_ARCH_ARM 1548 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698