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 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1383 | 1383 |
1384 | 1384 |
1385 void LCodeGen::DoFixedArrayBaseLength( | 1385 void LCodeGen::DoFixedArrayBaseLength( |
1386 LFixedArrayBaseLength* instr) { | 1386 LFixedArrayBaseLength* instr) { |
1387 Register result = ToRegister(instr->result()); | 1387 Register result = ToRegister(instr->result()); |
1388 Register array = ToRegister(instr->InputAt(0)); | 1388 Register array = ToRegister(instr->InputAt(0)); |
1389 __ mov(result, FieldOperand(array, FixedArrayBase::kLengthOffset)); | 1389 __ mov(result, FieldOperand(array, FixedArrayBase::kLengthOffset)); |
1390 } | 1390 } |
1391 | 1391 |
1392 | 1392 |
| 1393 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { |
| 1394 Register result = ToRegister(instr->result()); |
| 1395 Register map = ToRegister(instr->InputAt(0)); |
| 1396 __ EnumLength(result, map); |
| 1397 __ SmiTag(result); |
| 1398 } |
| 1399 |
| 1400 |
1393 void LCodeGen::DoElementsKind(LElementsKind* instr) { | 1401 void LCodeGen::DoElementsKind(LElementsKind* instr) { |
1394 Register result = ToRegister(instr->result()); | 1402 Register result = ToRegister(instr->result()); |
1395 Register input = ToRegister(instr->InputAt(0)); | 1403 Register input = ToRegister(instr->InputAt(0)); |
1396 | 1404 |
1397 // Load map into |result|. | 1405 // Load map into |result|. |
1398 __ mov(result, FieldOperand(input, HeapObject::kMapOffset)); | 1406 __ mov(result, FieldOperand(input, HeapObject::kMapOffset)); |
1399 // Load the map's "bit field 2" into |result|. We only need the first byte, | 1407 // Load the map's "bit field 2" into |result|. We only need the first byte, |
1400 // but the following masking takes care of that anyway. | 1408 // but the following masking takes care of that anyway. |
1401 __ mov(result, FieldOperand(result, Map::kBitField2Offset)); | 1409 __ mov(result, FieldOperand(result, Map::kBitField2Offset)); |
1402 // Retrieve elements_kind from bit field 2. | 1410 // Retrieve elements_kind from bit field 2. |
(...skipping 3899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5302 __ cmp(FieldOperand(eax, HeapObject::kMapOffset), | 5310 __ cmp(FieldOperand(eax, HeapObject::kMapOffset), |
5303 isolate()->factory()->meta_map()); | 5311 isolate()->factory()->meta_map()); |
5304 DeoptimizeIf(not_equal, instr->environment()); | 5312 DeoptimizeIf(not_equal, instr->environment()); |
5305 __ bind(&use_cache); | 5313 __ bind(&use_cache); |
5306 } | 5314 } |
5307 | 5315 |
5308 | 5316 |
5309 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) { | 5317 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) { |
5310 Register map = ToRegister(instr->map()); | 5318 Register map = ToRegister(instr->map()); |
5311 Register result = ToRegister(instr->result()); | 5319 Register result = ToRegister(instr->result()); |
| 5320 Label load_cache, done; |
| 5321 __ EnumLength(result, map); |
| 5322 __ cmp(result, Immediate(0)); |
| 5323 __ j(not_equal, &load_cache); |
| 5324 __ mov(result, isolate()->factory()->empty_fixed_array()); |
| 5325 __ jmp(&done); |
| 5326 |
| 5327 __ bind(&load_cache); |
5312 __ LoadInstanceDescriptors(map, result); | 5328 __ LoadInstanceDescriptors(map, result); |
5313 __ mov(result, | 5329 __ mov(result, |
5314 FieldOperand(result, DescriptorArray::kEnumCacheOffset)); | 5330 FieldOperand(result, DescriptorArray::kEnumCacheOffset)); |
5315 __ mov(result, | 5331 __ mov(result, |
5316 FieldOperand(result, FixedArray::SizeFor(instr->idx()))); | 5332 FieldOperand(result, FixedArray::SizeFor(instr->idx()))); |
| 5333 __ bind(&done); |
5317 __ test(result, result); | 5334 __ test(result, result); |
5318 DeoptimizeIf(equal, instr->environment()); | 5335 DeoptimizeIf(equal, instr->environment()); |
5319 } | 5336 } |
5320 | 5337 |
5321 | 5338 |
5322 void LCodeGen::DoCheckMapValue(LCheckMapValue* instr) { | 5339 void LCodeGen::DoCheckMapValue(LCheckMapValue* instr) { |
5323 Register object = ToRegister(instr->value()); | 5340 Register object = ToRegister(instr->value()); |
5324 __ cmp(ToRegister(instr->map()), | 5341 __ cmp(ToRegister(instr->map()), |
5325 FieldOperand(object, HeapObject::kMapOffset)); | 5342 FieldOperand(object, HeapObject::kMapOffset)); |
5326 DeoptimizeIf(not_equal, instr->environment()); | 5343 DeoptimizeIf(not_equal, instr->environment()); |
(...skipping 23 matching lines...) Expand all Loading... |
5350 FixedArray::kHeaderSize - kPointerSize)); | 5367 FixedArray::kHeaderSize - kPointerSize)); |
5351 __ bind(&done); | 5368 __ bind(&done); |
5352 } | 5369 } |
5353 | 5370 |
5354 | 5371 |
5355 #undef __ | 5372 #undef __ |
5356 | 5373 |
5357 } } // namespace v8::internal | 5374 } } // namespace v8::internal |
5358 | 5375 |
5359 #endif // V8_TARGET_ARCH_IA32 | 5376 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |