OLD | NEW |
1 // Copyright 2011 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 |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 // Store the value at the masked, scaled index. | 214 // Store the value at the masked, scaled index. |
215 const int kValueOffset = kElementsStartOffset + kPointerSize; | 215 const int kValueOffset = kElementsStartOffset + kPointerSize; |
216 __ lea(scratch1, Operand(elements, | 216 __ lea(scratch1, Operand(elements, |
217 scratch1, | 217 scratch1, |
218 times_pointer_size, | 218 times_pointer_size, |
219 kValueOffset - kHeapObjectTag)); | 219 kValueOffset - kHeapObjectTag)); |
220 __ movq(Operand(scratch1, 0), value); | 220 __ movq(Operand(scratch1, 0), value); |
221 | 221 |
222 // Update write barrier. Make sure not to clobber the value. | 222 // Update write barrier. Make sure not to clobber the value. |
223 __ movq(scratch0, value); | 223 __ movq(scratch0, value); |
224 __ RecordWrite(elements, scratch1, scratch0); | 224 __ RecordWrite(elements, scratch1, scratch0, kDontSaveFPRegs); |
225 } | 225 } |
226 | 226 |
227 | 227 |
228 void LoadIC::GenerateArrayLength(MacroAssembler* masm) { | 228 void LoadIC::GenerateArrayLength(MacroAssembler* masm) { |
229 // ----------- S t a t e ------------- | 229 // ----------- S t a t e ------------- |
230 // -- rax : receiver | 230 // -- rax : receiver |
231 // -- rcx : name | 231 // -- rcx : name |
232 // -- rsp[0] : return address | 232 // -- rsp[0] : return address |
233 // ----------------------------------- | 233 // ----------------------------------- |
234 Label miss; | 234 Label miss; |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 // rcx: index | 694 // rcx: index |
695 Label non_smi_value; | 695 Label non_smi_value; |
696 __ movq(FieldOperand(rbx, rcx, times_pointer_size, FixedArray::kHeaderSize), | 696 __ movq(FieldOperand(rbx, rcx, times_pointer_size, FixedArray::kHeaderSize), |
697 rax); | 697 rax); |
698 __ JumpIfNotSmi(rax, &non_smi_value, Label::kNear); | 698 __ JumpIfNotSmi(rax, &non_smi_value, Label::kNear); |
699 __ ret(0); | 699 __ ret(0); |
700 __ bind(&non_smi_value); | 700 __ bind(&non_smi_value); |
701 // Slow case that needs to retain rcx for use by RecordWrite. | 701 // Slow case that needs to retain rcx for use by RecordWrite. |
702 // Update write barrier for the elements array address. | 702 // Update write barrier for the elements array address. |
703 __ movq(rdx, rax); | 703 __ movq(rdx, rax); |
704 __ RecordWriteNonSmi(rbx, 0, rdx, rcx); | 704 __ lea(rcx, |
| 705 FieldOperand(rbx, rcx, times_pointer_size, FixedArray::kHeaderSize)); |
| 706 __ RecordWrite( |
| 707 rbx, rcx, rdx, kDontSaveFPRegs, EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); |
705 __ ret(0); | 708 __ ret(0); |
706 } | 709 } |
707 | 710 |
708 | 711 |
709 // The generated code does not accept smi keys. | 712 // The generated code does not accept smi keys. |
710 // The generated code falls through if both probes miss. | 713 // The generated code falls through if both probes miss. |
711 static void GenerateMonomorphicCacheProbe(MacroAssembler* masm, | 714 static void GenerateMonomorphicCacheProbe(MacroAssembler* masm, |
712 int argc, | 715 int argc, |
713 Code::Kind kind, | 716 Code::Kind kind, |
714 Code::ExtraICState extra_ic_state) { | 717 Code::ExtraICState extra_ic_state) { |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1207 // -- rcx : key | 1210 // -- rcx : key |
1208 // -- rdx : receiver | 1211 // -- rdx : receiver |
1209 // -- rsp[0] : return address | 1212 // -- rsp[0] : return address |
1210 // ----------------------------------- | 1213 // ----------------------------------- |
1211 Label slow, notin; | 1214 Label slow, notin; |
1212 Operand mapped_location = GenerateMappedArgumentsLookup( | 1215 Operand mapped_location = GenerateMappedArgumentsLookup( |
1213 masm, rdx, rcx, rbx, rdi, r8, ¬in, &slow); | 1216 masm, rdx, rcx, rbx, rdi, r8, ¬in, &slow); |
1214 __ movq(mapped_location, rax); | 1217 __ movq(mapped_location, rax); |
1215 __ lea(r9, mapped_location); | 1218 __ lea(r9, mapped_location); |
1216 __ movq(r8, rax); | 1219 __ movq(r8, rax); |
1217 __ RecordWrite(rbx, r9, r8); | 1220 __ RecordWrite(rbx, |
| 1221 r9, |
| 1222 r8, |
| 1223 kDontSaveFPRegs, |
| 1224 EMIT_REMEMBERED_SET, |
| 1225 INLINE_SMI_CHECK); |
1218 __ Ret(); | 1226 __ Ret(); |
1219 __ bind(¬in); | 1227 __ bind(¬in); |
1220 // The unmapped lookup expects that the parameter map is in rbx. | 1228 // The unmapped lookup expects that the parameter map is in rbx. |
1221 Operand unmapped_location = | 1229 Operand unmapped_location = |
1222 GenerateUnmappedArgumentsLookup(masm, rcx, rbx, rdi, &slow); | 1230 GenerateUnmappedArgumentsLookup(masm, rcx, rbx, rdi, &slow); |
1223 __ movq(unmapped_location, rax); | 1231 __ movq(unmapped_location, rax); |
1224 __ lea(r9, unmapped_location); | 1232 __ lea(r9, unmapped_location); |
1225 __ movq(r8, rax); | 1233 __ movq(r8, rax); |
1226 __ RecordWrite(rbx, r9, r8); | 1234 __ RecordWrite(rbx, |
| 1235 r9, |
| 1236 r8, |
| 1237 kDontSaveFPRegs, |
| 1238 EMIT_REMEMBERED_SET, |
| 1239 INLINE_SMI_CHECK); |
1227 __ Ret(); | 1240 __ Ret(); |
1228 __ bind(&slow); | 1241 __ bind(&slow); |
1229 GenerateMiss(masm, false); | 1242 GenerateMiss(masm, false); |
1230 } | 1243 } |
1231 | 1244 |
1232 | 1245 |
1233 void KeyedCallIC::GenerateNonStrictArguments(MacroAssembler* masm, | 1246 void KeyedCallIC::GenerateNonStrictArguments(MacroAssembler* masm, |
1234 int argc) { | 1247 int argc) { |
1235 // ----------- S t a t e ------------- | 1248 // ----------- S t a t e ------------- |
1236 // rcx : function name | 1249 // rcx : function name |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1659 Condition cc = *jmp_address == Assembler::kJncShortOpcode | 1672 Condition cc = *jmp_address == Assembler::kJncShortOpcode |
1660 ? not_zero | 1673 ? not_zero |
1661 : zero; | 1674 : zero; |
1662 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 1675 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
1663 } | 1676 } |
1664 | 1677 |
1665 | 1678 |
1666 } } // namespace v8::internal | 1679 } } // namespace v8::internal |
1667 | 1680 |
1668 #endif // V8_TARGET_ARCH_X64 | 1681 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |