OLD | NEW |
1 // Copyright 2011 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 |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 pop(scratch1); | 483 pop(scratch1); |
484 fstp_d(FieldOperand(elements, key, times_4, FixedDoubleArray::kHeaderSize)); | 484 fstp_d(FieldOperand(elements, key, times_4, FixedDoubleArray::kHeaderSize)); |
485 } | 485 } |
486 bind(&done); | 486 bind(&done); |
487 } | 487 } |
488 | 488 |
489 | 489 |
490 void MacroAssembler::CheckMap(Register obj, | 490 void MacroAssembler::CheckMap(Register obj, |
491 Handle<Map> map, | 491 Handle<Map> map, |
492 Label* fail, | 492 Label* fail, |
493 SmiCheckType smi_check_type) { | 493 SmiCheckType smi_check_type, |
| 494 MapCheckMode mode) { |
494 if (smi_check_type == DO_SMI_CHECK) { | 495 if (smi_check_type == DO_SMI_CHECK) { |
495 JumpIfSmi(obj, fail); | 496 JumpIfSmi(obj, fail); |
496 } | 497 } |
| 498 |
| 499 Label success; |
497 cmp(FieldOperand(obj, HeapObject::kMapOffset), Immediate(map)); | 500 cmp(FieldOperand(obj, HeapObject::kMapOffset), Immediate(map)); |
| 501 if (mode == ALLOW_ELEMENT_TRANSITION_MAPS) { |
| 502 bool ignore; |
| 503 Map* transitioned_double_map = |
| 504 map->LookupElementsTransitionMap(FAST_DOUBLE_ELEMENTS, &ignore); |
| 505 ASSERT(transitioned_double_map == NULL || |
| 506 map->elements_kind() == FAST_SMI_ONLY_ELEMENTS); |
| 507 Map* transitioned_fast_element_map = |
| 508 map->LookupElementsTransitionMap(FAST_ELEMENTS, &ignore); |
| 509 ASSERT(transitioned_fast_element_map == NULL || |
| 510 map->elements_kind() != FAST_ELEMENTS); |
| 511 if (transitioned_fast_element_map != NULL) { |
| 512 j(equal, &success); |
| 513 cmp(FieldOperand(obj, HeapObject::kMapOffset), |
| 514 Immediate(Handle<Map>(transitioned_fast_element_map))); |
| 515 } |
| 516 |
| 517 if (transitioned_double_map != NULL) { |
| 518 j(equal, &success); |
| 519 cmp(FieldOperand(obj, HeapObject::kMapOffset), |
| 520 Immediate(Handle<Map>(transitioned_double_map))); |
| 521 } |
| 522 } |
498 j(not_equal, fail); | 523 j(not_equal, fail); |
| 524 bind(&success); |
499 } | 525 } |
500 | 526 |
501 | 527 |
502 void MacroAssembler::DispatchMap(Register obj, | 528 void MacroAssembler::DispatchMap(Register obj, |
503 Handle<Map> map, | 529 Handle<Map> map, |
504 Handle<Code> success, | 530 Handle<Code> success, |
505 SmiCheckType smi_check_type) { | 531 SmiCheckType smi_check_type) { |
506 Label fail; | 532 Label fail; |
507 if (smi_check_type == DO_SMI_CHECK) { | 533 if (smi_check_type == DO_SMI_CHECK) { |
508 JumpIfSmi(obj, &fail); | 534 JumpIfSmi(obj, &fail); |
(...skipping 2176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2685 cmp(length, Operand(bitmap_scratch, MemoryChunk::kSizeOffset)); | 2711 cmp(length, Operand(bitmap_scratch, MemoryChunk::kSizeOffset)); |
2686 Check(less_equal, "Live Bytes Count overflow chunk size"); | 2712 Check(less_equal, "Live Bytes Count overflow chunk size"); |
2687 } | 2713 } |
2688 | 2714 |
2689 bind(&done); | 2715 bind(&done); |
2690 } | 2716 } |
2691 | 2717 |
2692 } } // namespace v8::internal | 2718 } } // namespace v8::internal |
2693 | 2719 |
2694 #endif // V8_TARGET_ARCH_IA32 | 2720 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |