OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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( | |
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)); | |
505 } | |
506 | |
507 Map* transitioned_double_map( | |
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)); | |
515 } | |
516 } | |
517 } | |
518 | |
519 | |
520 void MacroAssembler::CheckMap(Register obj, | 490 void MacroAssembler::CheckMap(Register obj, |
521 Handle<Map> map, | 491 Handle<Map> map, |
522 Label* fail, | 492 Label* fail, |
523 SmiCheckType smi_check_type, | 493 SmiCheckType smi_check_type) { |
524 CompareMapMode mode) { | |
525 if (smi_check_type == DO_SMI_CHECK) { | 494 if (smi_check_type == DO_SMI_CHECK) { |
526 JumpIfSmi(obj, fail); | 495 JumpIfSmi(obj, fail); |
527 } | 496 } |
528 | 497 cmp(FieldOperand(obj, HeapObject::kMapOffset), Immediate(map)); |
529 Label success; | |
530 CompareMap(obj, map, &success, mode); | |
531 j(not_equal, fail); | 498 j(not_equal, fail); |
532 bind(&success); | |
533 } | 499 } |
534 | 500 |
535 | 501 |
536 void MacroAssembler::DispatchMap(Register obj, | 502 void MacroAssembler::DispatchMap(Register obj, |
537 Handle<Map> map, | 503 Handle<Map> map, |
538 Handle<Code> success, | 504 Handle<Code> success, |
539 SmiCheckType smi_check_type) { | 505 SmiCheckType smi_check_type) { |
540 Label fail; | 506 Label fail; |
541 if (smi_check_type == DO_SMI_CHECK) { | 507 if (smi_check_type == DO_SMI_CHECK) { |
542 JumpIfSmi(obj, &fail); | 508 JumpIfSmi(obj, &fail); |
(...skipping 2176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2719 cmp(length, Operand(bitmap_scratch, MemoryChunk::kSizeOffset)); | 2685 cmp(length, Operand(bitmap_scratch, MemoryChunk::kSizeOffset)); |
2720 Check(less_equal, "Live Bytes Count overflow chunk size"); | 2686 Check(less_equal, "Live Bytes Count overflow chunk size"); |
2721 } | 2687 } |
2722 | 2688 |
2723 bind(&done); | 2689 bind(&done); |
2724 } | 2690 } |
2725 | 2691 |
2726 } } // namespace v8::internal | 2692 } } // namespace v8::internal |
2727 | 2693 |
2728 #endif // V8_TARGET_ARCH_IA32 | 2694 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |