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 bool ignore; | |
497 Map* transitioned_fast_element_map( | |
fschneider
2012/01/04 12:17:51
If there is no specific reason to use a raw pointe
danno
2012/01/05 13:41:57
Done.
| |
498 map->LookupElementsTransitionMap(FAST_ELEMENTS, &ignore)); | |
499 ASSERT(transitioned_fast_element_map == NULL || | |
500 map->elements_kind() != FAST_ELEMENTS); | |
501 if (transitioned_fast_element_map != NULL) { | |
502 j(equal, early_success, Label::kNear); | |
503 cmp(FieldOperand(obj, HeapObject::kMapOffset), | |
504 Handle<Map>(transitioned_fast_element_map)); | |
fschneider
2012/01/04 12:17:51
Then there is no need to create a handle here.
danno
2012/01/05 13:41:57
Done.
| |
505 } | |
506 | |
507 Map* transitioned_double_map( | |
fschneider
2012/01/04 12:17:51
Same here.
danno
2012/01/05 13:41:57
Done.
| |
508 map->LookupElementsTransitionMap(FAST_DOUBLE_ELEMENTS, &ignore)); | |
509 ASSERT(transitioned_double_map == NULL || | |
510 map->elements_kind() == FAST_SMI_ONLY_ELEMENTS); | |
511 if (transitioned_double_map != NULL) { | |
512 j(equal, early_success, Label::kNear); | |
513 cmp(FieldOperand(obj, HeapObject::kMapOffset), | |
514 Handle<Map>(transitioned_double_map)); | |
fschneider
2012/01/04 12:17:51
and here.
danno
2012/01/05 13:41:57
Done.
| |
515 } | |
516 } | |
517 } | |
518 | |
519 | |
490 void MacroAssembler::CheckMap(Register obj, | 520 void MacroAssembler::CheckMap(Register obj, |
491 Handle<Map> map, | 521 Handle<Map> map, |
492 Label* fail, | 522 Label* fail, |
493 SmiCheckType smi_check_type) { | 523 SmiCheckType smi_check_type, |
524 CompareMapMode mode) { | |
494 if (smi_check_type == DO_SMI_CHECK) { | 525 if (smi_check_type == DO_SMI_CHECK) { |
495 JumpIfSmi(obj, fail); | 526 JumpIfSmi(obj, fail); |
496 } | 527 } |
497 cmp(FieldOperand(obj, HeapObject::kMapOffset), Immediate(map)); | 528 |
529 Label success; | |
530 CompareMap(obj, map, &success, mode); | |
498 j(not_equal, fail); | 531 j(not_equal, fail); |
532 bind(&success); | |
499 } | 533 } |
500 | 534 |
501 | 535 |
502 void MacroAssembler::DispatchMap(Register obj, | 536 void MacroAssembler::DispatchMap(Register obj, |
503 Handle<Map> map, | 537 Handle<Map> map, |
504 Handle<Code> success, | 538 Handle<Code> success, |
505 SmiCheckType smi_check_type) { | 539 SmiCheckType smi_check_type) { |
506 Label fail; | 540 Label fail; |
507 if (smi_check_type == DO_SMI_CHECK) { | 541 if (smi_check_type == DO_SMI_CHECK) { |
508 JumpIfSmi(obj, &fail); | 542 JumpIfSmi(obj, &fail); |
(...skipping 2176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2685 cmp(length, Operand(bitmap_scratch, MemoryChunk::kSizeOffset)); | 2719 cmp(length, Operand(bitmap_scratch, MemoryChunk::kSizeOffset)); |
2686 Check(less_equal, "Live Bytes Count overflow chunk size"); | 2720 Check(less_equal, "Live Bytes Count overflow chunk size"); |
2687 } | 2721 } |
2688 | 2722 |
2689 bind(&done); | 2723 bind(&done); |
2690 } | 2724 } |
2691 | 2725 |
2692 } } // namespace v8::internal | 2726 } } // namespace v8::internal |
2693 | 2727 |
2694 #endif // V8_TARGET_ARCH_IA32 | 2728 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |