Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(442)

Side by Side Diff: src/ia32/ic-ia32.cc

Issue 134643026: Cleanup: Unify CodeGenerator class across platforms (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 if (check_map == kCheckMap) { 731 if (check_map == kCheckMap) {
732 __ mov(edi, FieldOperand(ebx, HeapObject::kMapOffset)); 732 __ mov(edi, FieldOperand(ebx, HeapObject::kMapOffset));
733 __ cmp(edi, masm->isolate()->factory()->fixed_array_map()); 733 __ cmp(edi, masm->isolate()->factory()->fixed_array_map());
734 __ j(not_equal, fast_double); 734 __ j(not_equal, fast_double);
735 } 735 }
736 736
737 // HOLECHECK: guards "A[i] = V" 737 // HOLECHECK: guards "A[i] = V"
738 // We have to go to the runtime if the current value is the hole because 738 // We have to go to the runtime if the current value is the hole because
739 // there may be a callback on the element 739 // there may be a callback on the element
740 Label holecheck_passed1; 740 Label holecheck_passed1;
741 __ cmp(CodeGenerator::FixedArrayElementOperand(ebx, ecx), 741 __ cmp(FixedArrayElementOperand(ebx, ecx),
742 masm->isolate()->factory()->the_hole_value()); 742 masm->isolate()->factory()->the_hole_value());
743 __ j(not_equal, &holecheck_passed1); 743 __ j(not_equal, &holecheck_passed1);
744 __ JumpIfDictionaryInPrototypeChain(edx, ebx, edi, slow); 744 __ JumpIfDictionaryInPrototypeChain(edx, ebx, edi, slow);
745 __ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset)); 745 __ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset));
746 746
747 __ bind(&holecheck_passed1); 747 __ bind(&holecheck_passed1);
748 748
749 // Smi stores don't require further checks. 749 // Smi stores don't require further checks.
750 Label non_smi_value; 750 Label non_smi_value;
751 __ JumpIfNotSmi(eax, &non_smi_value); 751 __ JumpIfNotSmi(eax, &non_smi_value);
752 if (increment_length == kIncrementLength) { 752 if (increment_length == kIncrementLength) {
753 // Add 1 to receiver->length. 753 // Add 1 to receiver->length.
754 __ add(FieldOperand(edx, JSArray::kLengthOffset), 754 __ add(FieldOperand(edx, JSArray::kLengthOffset),
755 Immediate(Smi::FromInt(1))); 755 Immediate(Smi::FromInt(1)));
756 } 756 }
757 // It's irrelevant whether array is smi-only or not when writing a smi. 757 // It's irrelevant whether array is smi-only or not when writing a smi.
758 __ mov(CodeGenerator::FixedArrayElementOperand(ebx, ecx), eax); 758 __ mov(FixedArrayElementOperand(ebx, ecx), eax);
759 __ ret(0); 759 __ ret(0);
760 760
761 __ bind(&non_smi_value); 761 __ bind(&non_smi_value);
762 // Escape to elements kind transition case. 762 // Escape to elements kind transition case.
763 __ mov(edi, FieldOperand(edx, HeapObject::kMapOffset)); 763 __ mov(edi, FieldOperand(edx, HeapObject::kMapOffset));
764 __ CheckFastObjectElements(edi, &transition_smi_elements); 764 __ CheckFastObjectElements(edi, &transition_smi_elements);
765 765
766 // Fast elements array, store the value to the elements backing store. 766 // Fast elements array, store the value to the elements backing store.
767 __ bind(&finish_object_store); 767 __ bind(&finish_object_store);
768 if (increment_length == kIncrementLength) { 768 if (increment_length == kIncrementLength) {
769 // Add 1 to receiver->length. 769 // Add 1 to receiver->length.
770 __ add(FieldOperand(edx, JSArray::kLengthOffset), 770 __ add(FieldOperand(edx, JSArray::kLengthOffset),
771 Immediate(Smi::FromInt(1))); 771 Immediate(Smi::FromInt(1)));
772 } 772 }
773 __ mov(CodeGenerator::FixedArrayElementOperand(ebx, ecx), eax); 773 __ mov(FixedArrayElementOperand(ebx, ecx), eax);
774 // Update write barrier for the elements array address. 774 // Update write barrier for the elements array address.
775 __ mov(edx, eax); // Preserve the value which is returned. 775 __ mov(edx, eax); // Preserve the value which is returned.
776 __ RecordWriteArray( 776 __ RecordWriteArray(
777 ebx, edx, ecx, kDontSaveFPRegs, EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); 777 ebx, edx, ecx, kDontSaveFPRegs, EMIT_REMEMBERED_SET, OMIT_SMI_CHECK);
778 __ ret(0); 778 __ ret(0);
779 779
780 __ bind(fast_double); 780 __ bind(fast_double);
781 if (check_map == kCheckMap) { 781 if (check_map == kCheckMap) {
782 // Check for fast double array case. If this fails, call through to the 782 // Check for fast double array case. If this fails, call through to the
783 // runtime. 783 // runtime.
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
1306 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) 1306 Condition cc = (check == ENABLE_INLINED_SMI_CHECK)
1307 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) 1307 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero)
1308 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); 1308 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry);
1309 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); 1309 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc);
1310 } 1310 }
1311 1311
1312 1312
1313 } } // namespace v8::internal 1313 } } // namespace v8::internal
1314 1314
1315 #endif // V8_TARGET_ARCH_IA32 1315 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698