| OLD | NEW |
| 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 4906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4917 __ testl(rcx, Immediate(kStringEncodingMask)); | 4917 __ testl(rcx, Immediate(kStringEncodingMask)); |
| 4918 __ j(zero, &non_ascii); | 4918 __ j(zero, &non_ascii); |
| 4919 __ bind(&ascii_data); | 4919 __ bind(&ascii_data); |
| 4920 // Allocate an ASCII cons string. | 4920 // Allocate an ASCII cons string. |
| 4921 __ AllocateAsciiConsString(rcx, rdi, no_reg, &call_runtime); | 4921 __ AllocateAsciiConsString(rcx, rdi, no_reg, &call_runtime); |
| 4922 __ bind(&allocated); | 4922 __ bind(&allocated); |
| 4923 // Fill the fields of the cons string. | 4923 // Fill the fields of the cons string. |
| 4924 __ movq(FieldOperand(rcx, ConsString::kLengthOffset), rbx); | 4924 __ movq(FieldOperand(rcx, ConsString::kLengthOffset), rbx); |
| 4925 __ movq(FieldOperand(rcx, ConsString::kHashFieldOffset), | 4925 __ movq(FieldOperand(rcx, ConsString::kHashFieldOffset), |
| 4926 Immediate(String::kEmptyHashField)); | 4926 Immediate(String::kEmptyHashField)); |
| 4927 |
| 4928 Label skip_write_barrier, after_writing; |
| 4929 ExternalReference high_promotion_mode = ExternalReference:: |
| 4930 new_space_high_promotion_mode_active_address(masm->isolate()); |
| 4931 __ Load(rbx, high_promotion_mode); |
| 4932 __ testb(rbx, Immediate(1)); |
| 4933 __ j(zero, &skip_write_barrier); |
| 4934 |
| 4935 __ movq(FieldOperand(rcx, ConsString::kFirstOffset), rax); |
| 4936 __ RecordWriteField(rcx, |
| 4937 ConsString::kFirstOffset, |
| 4938 rax, |
| 4939 rbx, |
| 4940 kDontSaveFPRegs); |
| 4941 __ movq(FieldOperand(rcx, ConsString::kSecondOffset), rdx); |
| 4942 __ RecordWriteField(rcx, |
| 4943 ConsString::kSecondOffset, |
| 4944 rdx, |
| 4945 rbx, |
| 4946 kDontSaveFPRegs); |
| 4947 __ jmp(&after_writing); |
| 4948 |
| 4949 __ bind(&skip_write_barrier); |
| 4927 __ movq(FieldOperand(rcx, ConsString::kFirstOffset), rax); | 4950 __ movq(FieldOperand(rcx, ConsString::kFirstOffset), rax); |
| 4928 __ movq(FieldOperand(rcx, ConsString::kSecondOffset), rdx); | 4951 __ movq(FieldOperand(rcx, ConsString::kSecondOffset), rdx); |
| 4952 |
| 4953 __ bind(&after_writing); |
| 4954 |
| 4929 __ movq(rax, rcx); | 4955 __ movq(rax, rcx); |
| 4930 __ IncrementCounter(counters->string_add_native(), 1); | 4956 __ IncrementCounter(counters->string_add_native(), 1); |
| 4931 __ ret(2 * kPointerSize); | 4957 __ ret(2 * kPointerSize); |
| 4932 __ bind(&non_ascii); | 4958 __ bind(&non_ascii); |
| 4933 // At least one of the strings is two-byte. Check whether it happens | 4959 // At least one of the strings is two-byte. Check whether it happens |
| 4934 // to contain only one byte characters. | 4960 // to contain only one byte characters. |
| 4935 // rcx: first instance type AND second instance type. | 4961 // rcx: first instance type AND second instance type. |
| 4936 // r8: first instance type. | 4962 // r8: first instance type. |
| 4937 // r9: second instance type. | 4963 // r9: second instance type. |
| 4938 __ testb(rcx, Immediate(kOneByteDataHintMask)); | 4964 __ testb(rcx, Immediate(kOneByteDataHintMask)); |
| (...skipping 1418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6357 // and ElementsTransitionGenerator::GenerateDoubleToObject | 6383 // and ElementsTransitionGenerator::GenerateDoubleToObject |
| 6358 { REG(rdx), REG(rbx), REG(rdi), EMIT_REMEMBERED_SET}, | 6384 { REG(rdx), REG(rbx), REG(rdi), EMIT_REMEMBERED_SET}, |
| 6359 { REG(rdx), REG(rbx), REG(rdi), OMIT_REMEMBERED_SET}, | 6385 { REG(rdx), REG(rbx), REG(rdi), OMIT_REMEMBERED_SET}, |
| 6360 // ElementsTransitionGenerator::GenerateSmiToDouble | 6386 // ElementsTransitionGenerator::GenerateSmiToDouble |
| 6361 // and ElementsTransitionGenerator::GenerateDoubleToObject | 6387 // and ElementsTransitionGenerator::GenerateDoubleToObject |
| 6362 { REG(rdx), REG(r11), REG(r15), EMIT_REMEMBERED_SET}, | 6388 { REG(rdx), REG(r11), REG(r15), EMIT_REMEMBERED_SET}, |
| 6363 // ElementsTransitionGenerator::GenerateDoubleToObject | 6389 // ElementsTransitionGenerator::GenerateDoubleToObject |
| 6364 { REG(r11), REG(rax), REG(r15), EMIT_REMEMBERED_SET}, | 6390 { REG(r11), REG(rax), REG(r15), EMIT_REMEMBERED_SET}, |
| 6365 // StoreArrayLiteralElementStub::Generate | 6391 // StoreArrayLiteralElementStub::Generate |
| 6366 { REG(rbx), REG(rax), REG(rcx), EMIT_REMEMBERED_SET}, | 6392 { REG(rbx), REG(rax), REG(rcx), EMIT_REMEMBERED_SET}, |
| 6367 // FastNewClosureStub::Generate | 6393 // FastNewClosureStub::Generate and |
| 6394 // StringAddStub::Generate |
| 6368 { REG(rcx), REG(rdx), REG(rbx), EMIT_REMEMBERED_SET}, | 6395 { REG(rcx), REG(rdx), REG(rbx), EMIT_REMEMBERED_SET}, |
| 6396 // StringAddStub::Generate |
| 6397 { REG(rcx), REG(rax), REG(rbx), EMIT_REMEMBERED_SET}, |
| 6369 // Null termination. | 6398 // Null termination. |
| 6370 { REG(no_reg), REG(no_reg), REG(no_reg), EMIT_REMEMBERED_SET} | 6399 { REG(no_reg), REG(no_reg), REG(no_reg), EMIT_REMEMBERED_SET} |
| 6371 }; | 6400 }; |
| 6372 | 6401 |
| 6373 #undef REG | 6402 #undef REG |
| 6374 | 6403 |
| 6375 bool RecordWriteStub::IsPregenerated() { | 6404 bool RecordWriteStub::IsPregenerated() { |
| 6376 for (AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime; | 6405 for (AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime; |
| 6377 !entry->object.is(no_reg); | 6406 !entry->object.is(no_reg); |
| 6378 entry++) { | 6407 entry++) { |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6967 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); | 6996 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); |
| 6968 } | 6997 } |
| 6969 } | 6998 } |
| 6970 | 6999 |
| 6971 | 7000 |
| 6972 #undef __ | 7001 #undef __ |
| 6973 | 7002 |
| 6974 } } // namespace v8::internal | 7003 } } // namespace v8::internal |
| 6975 | 7004 |
| 6976 #endif // V8_TARGET_ARCH_X64 | 7005 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |