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

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

Issue 7024041: MIPS: port Implement set trap for proxies, and revamp class hierarchy in preparation (Closed)
Patch Set: Created 9 years, 6 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
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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 // Scratch registers: 73 // Scratch registers:
74 // scratch0: used to holds the receiver map. 74 // scratch0: used to holds the receiver map.
75 // scratch1: used to holds the receiver instance type, receiver bit mask 75 // scratch1: used to holds the receiver instance type, receiver bit mask
76 // and elements map. 76 // and elements map.
77 77
78 // Check that the receiver isn't a smi. 78 // Check that the receiver isn't a smi.
79 __ JumpIfSmi(receiver, miss); 79 __ JumpIfSmi(receiver, miss);
80 80
81 // Check that the receiver is a valid JS object. 81 // Check that the receiver is a valid JS object.
82 __ GetObjectType(receiver, scratch0, scratch1); 82 __ GetObjectType(receiver, scratch0, scratch1);
83 __ Branch(miss, lt, scratch1, Operand(FIRST_JS_OBJECT_TYPE)); 83 __ Branch(miss, lt, scratch1, Operand(FIRST_SPEC_OBJECT_TYPE));
84 84
85 // If this assert fails, we have to check upper bound too. 85 // If this assert fails, we have to check upper bound too.
86 ASSERT(LAST_TYPE == JS_FUNCTION_TYPE); 86 STATIC_ASSERT(LAST_TYPE == LAST_SPEC_OBJECT_TYPE);
87 87
88 GenerateGlobalInstanceTypeCheck(masm, scratch1, miss); 88 GenerateGlobalInstanceTypeCheck(masm, scratch1, miss);
89 89
90 // Check that the global object does not require access checks. 90 // Check that the global object does not require access checks.
91 __ lbu(scratch1, FieldMemOperand(scratch0, Map::kBitFieldOffset)); 91 __ lbu(scratch1, FieldMemOperand(scratch0, Map::kBitFieldOffset));
92 __ And(scratch1, scratch1, Operand((1 << Map::kIsAccessCheckNeeded) | 92 __ And(scratch1, scratch1, Operand((1 << Map::kIsAccessCheckNeeded) |
93 (1 << Map::kHasNamedInterceptor))); 93 (1 << Map::kHasNamedInterceptor)));
94 __ Branch(miss, ne, scratch1, Operand(zero_reg)); 94 __ Branch(miss, ne, scratch1, Operand(zero_reg));
95 95
96 __ lw(elements, FieldMemOperand(receiver, JSObject::kPropertiesOffset)); 96 __ lw(elements, FieldMemOperand(receiver, JSObject::kPropertiesOffset));
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 __ lw(t3, FieldMemOperand(receiver, HeapObject::kMapOffset)); 1167 __ lw(t3, FieldMemOperand(receiver, HeapObject::kMapOffset));
1168 // Check that the receiver does not require access checks. We need 1168 // Check that the receiver does not require access checks. We need
1169 // to do this because this generic stub does not perform map checks. 1169 // to do this because this generic stub does not perform map checks.
1170 __ lbu(t0, FieldMemOperand(t3, Map::kBitFieldOffset)); 1170 __ lbu(t0, FieldMemOperand(t3, Map::kBitFieldOffset));
1171 __ And(t0, t0, Operand(1 << Map::kIsAccessCheckNeeded)); 1171 __ And(t0, t0, Operand(1 << Map::kIsAccessCheckNeeded));
1172 __ Branch(&slow, ne, t0, Operand(zero_reg)); 1172 __ Branch(&slow, ne, t0, Operand(zero_reg));
1173 // Check if the object is a JS array or not. 1173 // Check if the object is a JS array or not.
1174 __ lbu(t3, FieldMemOperand(t3, Map::kInstanceTypeOffset)); 1174 __ lbu(t3, FieldMemOperand(t3, Map::kInstanceTypeOffset));
1175 1175
1176 __ Branch(&array, eq, t3, Operand(JS_ARRAY_TYPE)); 1176 __ Branch(&array, eq, t3, Operand(JS_ARRAY_TYPE));
1177 // Check that the object is some kind of JS object. 1177 // Check that the object is some kind of JSObject.
1178 __ Branch(&slow, lt, t3, Operand(FIRST_JS_OBJECT_TYPE)); 1178 __ Branch(&slow, lt, t3, Operand(FIRST_JS_RECEIVER_TYPE));
1179 __ Branch(&slow, eq, t3, Operand(JS_PROXY_TYPE));
1180 __ Branch(&slow, eq, t3, Operand(JS_FUNCTION_PROXY_TYPE));
1179 1181
1180 // Object case: Check key against length in the elements array. 1182 // Object case: Check key against length in the elements array.
1181 __ lw(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); 1183 __ lw(elements, FieldMemOperand(receiver, JSObject::kElementsOffset));
1182 // Check that the object is in fast mode and writable. 1184 // Check that the object is in fast mode and writable.
1183 __ lw(t3, FieldMemOperand(elements, HeapObject::kMapOffset)); 1185 __ lw(t3, FieldMemOperand(elements, HeapObject::kMapOffset));
1184 __ LoadRoot(t0, Heap::kFixedArrayMapRootIndex); 1186 __ LoadRoot(t0, Heap::kFixedArrayMapRootIndex);
1185 __ Branch(&slow, ne, t3, Operand(t0)); 1187 __ Branch(&slow, ne, t3, Operand(t0));
1186 // Check array bounds. Both the key and the length of FixedArray are smis. 1188 // Check array bounds. Both the key and the length of FixedArray are smis.
1187 __ lw(t0, FieldMemOperand(elements, FixedArray::kLengthOffset)); 1189 __ lw(t0, FieldMemOperand(elements, FixedArray::kLengthOffset));
1188 __ Branch(&fast, lo, key, Operand(t0)); 1190 __ Branch(&fast, lo, key, Operand(t0));
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
1572 Register reg = Register::from_code(Assembler::GetRs(instr_at_patch)); 1574 Register reg = Register::from_code(Assembler::GetRs(instr_at_patch));
1573 patcher.masm()->andi(at, reg, kSmiTagMask); 1575 patcher.masm()->andi(at, reg, kSmiTagMask);
1574 patcher.ChangeBranchCondition(eq); 1576 patcher.ChangeBranchCondition(eq);
1575 } 1577 }
1576 } 1578 }
1577 1579
1578 1580
1579 } } // namespace v8::internal 1581 } } // namespace v8::internal
1580 1582
1581 #endif // V8_TARGET_ARCH_MIPS 1583 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698