OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1278 } | 1278 } |
1279 | 1279 |
1280 | 1280 |
1281 void LCodeGen::DoFixedArrayBaseLength(LFixedArrayBaseLength* instr) { | 1281 void LCodeGen::DoFixedArrayBaseLength(LFixedArrayBaseLength* instr) { |
1282 Register result = ToRegister(instr->result()); | 1282 Register result = ToRegister(instr->result()); |
1283 Register array = ToRegister(instr->InputAt(0)); | 1283 Register array = ToRegister(instr->InputAt(0)); |
1284 __ movq(result, FieldOperand(array, FixedArrayBase::kLengthOffset)); | 1284 __ movq(result, FieldOperand(array, FixedArrayBase::kLengthOffset)); |
1285 } | 1285 } |
1286 | 1286 |
1287 | 1287 |
| 1288 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { |
| 1289 Register result = ToRegister(instr->result()); |
| 1290 Register map = ToRegister(instr->InputAt(0)); |
| 1291 __ EnumLength(result, map); |
| 1292 } |
| 1293 |
| 1294 |
1288 void LCodeGen::DoElementsKind(LElementsKind* instr) { | 1295 void LCodeGen::DoElementsKind(LElementsKind* instr) { |
1289 Register result = ToRegister(instr->result()); | 1296 Register result = ToRegister(instr->result()); |
1290 Register input = ToRegister(instr->InputAt(0)); | 1297 Register input = ToRegister(instr->InputAt(0)); |
1291 | 1298 |
1292 // Load map into |result|. | 1299 // Load map into |result|. |
1293 __ movq(result, FieldOperand(input, HeapObject::kMapOffset)); | 1300 __ movq(result, FieldOperand(input, HeapObject::kMapOffset)); |
1294 // Load the map's "bit field 2" into |result|. We only need the first byte. | 1301 // Load the map's "bit field 2" into |result|. We only need the first byte. |
1295 __ movzxbq(result, FieldOperand(result, Map::kBitField2Offset)); | 1302 __ movzxbq(result, FieldOperand(result, Map::kBitField2Offset)); |
1296 // Retrieve elements_kind from bit field 2. | 1303 // Retrieve elements_kind from bit field 2. |
1297 __ and_(result, Immediate(Map::kElementsKindMask)); | 1304 __ and_(result, Immediate(Map::kElementsKindMask)); |
(...skipping 3912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5210 __ CompareRoot(FieldOperand(rax, HeapObject::kMapOffset), | 5217 __ CompareRoot(FieldOperand(rax, HeapObject::kMapOffset), |
5211 Heap::kMetaMapRootIndex); | 5218 Heap::kMetaMapRootIndex); |
5212 DeoptimizeIf(not_equal, instr->environment()); | 5219 DeoptimizeIf(not_equal, instr->environment()); |
5213 __ bind(&use_cache); | 5220 __ bind(&use_cache); |
5214 } | 5221 } |
5215 | 5222 |
5216 | 5223 |
5217 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) { | 5224 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) { |
5218 Register map = ToRegister(instr->map()); | 5225 Register map = ToRegister(instr->map()); |
5219 Register result = ToRegister(instr->result()); | 5226 Register result = ToRegister(instr->result()); |
| 5227 Label load_cache, done; |
| 5228 __ EnumLength(result, map); |
| 5229 __ Cmp(result, Smi::FromInt(0)); |
| 5230 __ j(not_equal, &load_cache); |
| 5231 __ LoadRoot(result, Heap::kEmptyFixedArrayRootIndex); |
| 5232 __ jmp(&done); |
| 5233 __ bind(&load_cache); |
5220 __ LoadInstanceDescriptors(map, result); | 5234 __ LoadInstanceDescriptors(map, result); |
5221 __ movq(result, | 5235 __ movq(result, |
5222 FieldOperand(result, DescriptorArray::kEnumCacheOffset)); | 5236 FieldOperand(result, DescriptorArray::kEnumCacheOffset)); |
5223 __ movq(result, | 5237 __ movq(result, |
5224 FieldOperand(result, FixedArray::SizeFor(instr->idx()))); | 5238 FieldOperand(result, FixedArray::SizeFor(instr->idx()))); |
| 5239 __ bind(&done); |
5225 Condition cc = masm()->CheckSmi(result); | 5240 Condition cc = masm()->CheckSmi(result); |
5226 DeoptimizeIf(cc, instr->environment()); | 5241 DeoptimizeIf(cc, instr->environment()); |
5227 } | 5242 } |
5228 | 5243 |
5229 | 5244 |
5230 void LCodeGen::DoCheckMapValue(LCheckMapValue* instr) { | 5245 void LCodeGen::DoCheckMapValue(LCheckMapValue* instr) { |
5231 Register object = ToRegister(instr->value()); | 5246 Register object = ToRegister(instr->value()); |
5232 __ cmpq(ToRegister(instr->map()), | 5247 __ cmpq(ToRegister(instr->map()), |
5233 FieldOperand(object, HeapObject::kMapOffset)); | 5248 FieldOperand(object, HeapObject::kMapOffset)); |
5234 DeoptimizeIf(not_equal, instr->environment()); | 5249 DeoptimizeIf(not_equal, instr->environment()); |
(...skipping 24 matching lines...) Expand all Loading... |
5259 FixedArray::kHeaderSize - kPointerSize)); | 5274 FixedArray::kHeaderSize - kPointerSize)); |
5260 __ bind(&done); | 5275 __ bind(&done); |
5261 } | 5276 } |
5262 | 5277 |
5263 | 5278 |
5264 #undef __ | 5279 #undef __ |
5265 | 5280 |
5266 } } // namespace v8::internal | 5281 } } // namespace v8::internal |
5267 | 5282 |
5268 #endif // V8_TARGET_ARCH_X64 | 5283 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |