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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 } else { | 480 } else { |
481 push(scratch1); | 481 push(scratch1); |
482 fild_s(Operand(esp, 0)); | 482 fild_s(Operand(esp, 0)); |
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::CompareMap(Register obj, |
| 491 Handle<Map> map, |
| 492 Label* early_success, |
| 493 CompareMapMode mode) { |
| 494 cmp(FieldOperand(obj, HeapObject::kMapOffset), map); |
| 495 if (mode == ALLOW_ELEMENT_TRANSITION_MAPS) { |
| 496 Map* transitioned_fast_element_map( |
| 497 map->LookupElementsTransitionMap(FAST_ELEMENTS, NULL)); |
| 498 ASSERT(transitioned_fast_element_map == NULL || |
| 499 map->elements_kind() != FAST_ELEMENTS); |
| 500 if (transitioned_fast_element_map != NULL) { |
| 501 j(equal, early_success, Label::kNear); |
| 502 cmp(FieldOperand(obj, HeapObject::kMapOffset), |
| 503 Handle<Map>(transitioned_fast_element_map)); |
| 504 } |
| 505 |
| 506 Map* transitioned_double_map( |
| 507 map->LookupElementsTransitionMap(FAST_DOUBLE_ELEMENTS, NULL)); |
| 508 ASSERT(transitioned_double_map == NULL || |
| 509 map->elements_kind() == FAST_SMI_ONLY_ELEMENTS); |
| 510 if (transitioned_double_map != NULL) { |
| 511 j(equal, early_success, Label::kNear); |
| 512 cmp(FieldOperand(obj, HeapObject::kMapOffset), |
| 513 Handle<Map>(transitioned_double_map)); |
| 514 } |
| 515 } |
| 516 } |
| 517 |
| 518 |
490 void MacroAssembler::CheckMap(Register obj, | 519 void MacroAssembler::CheckMap(Register obj, |
491 Handle<Map> map, | 520 Handle<Map> map, |
492 Label* fail, | 521 Label* fail, |
493 SmiCheckType smi_check_type) { | 522 SmiCheckType smi_check_type, |
| 523 CompareMapMode mode) { |
494 if (smi_check_type == DO_SMI_CHECK) { | 524 if (smi_check_type == DO_SMI_CHECK) { |
495 JumpIfSmi(obj, fail); | 525 JumpIfSmi(obj, fail); |
496 } | 526 } |
497 cmp(FieldOperand(obj, HeapObject::kMapOffset), Immediate(map)); | 527 |
| 528 Label success; |
| 529 CompareMap(obj, map, &success, mode); |
498 j(not_equal, fail); | 530 j(not_equal, fail); |
| 531 bind(&success); |
499 } | 532 } |
500 | 533 |
501 | 534 |
502 void MacroAssembler::DispatchMap(Register obj, | 535 void MacroAssembler::DispatchMap(Register obj, |
503 Handle<Map> map, | 536 Handle<Map> map, |
504 Handle<Code> success, | 537 Handle<Code> success, |
505 SmiCheckType smi_check_type) { | 538 SmiCheckType smi_check_type) { |
506 Label fail; | 539 Label fail; |
507 if (smi_check_type == DO_SMI_CHECK) { | 540 if (smi_check_type == DO_SMI_CHECK) { |
508 JumpIfSmi(obj, &fail); | 541 JumpIfSmi(obj, &fail); |
(...skipping 2176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2685 cmp(length, Operand(bitmap_scratch, MemoryChunk::kSizeOffset)); | 2718 cmp(length, Operand(bitmap_scratch, MemoryChunk::kSizeOffset)); |
2686 Check(less_equal, "Live Bytes Count overflow chunk size"); | 2719 Check(less_equal, "Live Bytes Count overflow chunk size"); |
2687 } | 2720 } |
2688 | 2721 |
2689 bind(&done); | 2722 bind(&done); |
2690 } | 2723 } |
2691 | 2724 |
2692 } } // namespace v8::internal | 2725 } } // namespace v8::internal |
2693 | 2726 |
2694 #endif // V8_TARGET_ARCH_IA32 | 2727 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |