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 5820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5831 __ j(zero, &non_ascii); | 5831 __ j(zero, &non_ascii); |
5832 __ bind(&ascii_data); | 5832 __ bind(&ascii_data); |
5833 // Allocate an ASCII cons string. | 5833 // Allocate an ASCII cons string. |
5834 __ AllocateAsciiConsString(ecx, edi, no_reg, &call_runtime); | 5834 __ AllocateAsciiConsString(ecx, edi, no_reg, &call_runtime); |
5835 __ bind(&allocated); | 5835 __ bind(&allocated); |
5836 // Fill the fields of the cons string. | 5836 // Fill the fields of the cons string. |
5837 __ AssertSmi(ebx); | 5837 __ AssertSmi(ebx); |
5838 __ mov(FieldOperand(ecx, ConsString::kLengthOffset), ebx); | 5838 __ mov(FieldOperand(ecx, ConsString::kLengthOffset), ebx); |
5839 __ mov(FieldOperand(ecx, ConsString::kHashFieldOffset), | 5839 __ mov(FieldOperand(ecx, ConsString::kHashFieldOffset), |
5840 Immediate(String::kEmptyHashField)); | 5840 Immediate(String::kEmptyHashField)); |
| 5841 |
| 5842 Label skip_write_barrier, after_writing; |
| 5843 ExternalReference high_promotion_mode = ExternalReference:: |
| 5844 new_space_high_promotion_mode_active_address(masm->isolate()); |
| 5845 __ test(Operand::StaticVariable(high_promotion_mode), Immediate(1)); |
| 5846 __ j(zero, &skip_write_barrier); |
| 5847 |
| 5848 __ mov(FieldOperand(ecx, ConsString::kFirstOffset), eax); |
| 5849 __ RecordWriteField(ecx, |
| 5850 ConsString::kFirstOffset, |
| 5851 eax, |
| 5852 ebx, |
| 5853 kDontSaveFPRegs); |
| 5854 __ mov(FieldOperand(ecx, ConsString::kSecondOffset), edx); |
| 5855 __ RecordWriteField(ecx, |
| 5856 ConsString::kSecondOffset, |
| 5857 edx, |
| 5858 ebx, |
| 5859 kDontSaveFPRegs); |
| 5860 __ jmp(&after_writing); |
| 5861 |
| 5862 __ bind(&skip_write_barrier); |
5841 __ mov(FieldOperand(ecx, ConsString::kFirstOffset), eax); | 5863 __ mov(FieldOperand(ecx, ConsString::kFirstOffset), eax); |
5842 __ mov(FieldOperand(ecx, ConsString::kSecondOffset), edx); | 5864 __ mov(FieldOperand(ecx, ConsString::kSecondOffset), edx); |
| 5865 |
| 5866 __ bind(&after_writing); |
| 5867 |
5843 __ mov(eax, ecx); | 5868 __ mov(eax, ecx); |
5844 __ IncrementCounter(counters->string_add_native(), 1); | 5869 __ IncrementCounter(counters->string_add_native(), 1); |
5845 __ ret(2 * kPointerSize); | 5870 __ ret(2 * kPointerSize); |
5846 __ bind(&non_ascii); | 5871 __ bind(&non_ascii); |
5847 // At least one of the strings is two-byte. Check whether it happens | 5872 // At least one of the strings is two-byte. Check whether it happens |
5848 // to contain only one byte characters. | 5873 // to contain only one byte characters. |
5849 // ecx: first instance type AND second instance type. | 5874 // ecx: first instance type AND second instance type. |
5850 // edi: second instance type. | 5875 // edi: second instance type. |
5851 __ test(ecx, Immediate(kOneByteDataHintMask)); | 5876 __ test(ecx, Immediate(kOneByteDataHintMask)); |
5852 __ j(not_zero, &ascii_data); | 5877 __ j(not_zero, &ascii_data); |
(...skipping 1511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7364 // ElementsTransitionGenerator::GenerateMapChangeElementTransition | 7389 // ElementsTransitionGenerator::GenerateMapChangeElementTransition |
7365 // and ElementsTransitionGenerator::GenerateSmiToDouble | 7390 // and ElementsTransitionGenerator::GenerateSmiToDouble |
7366 // and ElementsTransitionGenerator::GenerateDoubleToObject | 7391 // and ElementsTransitionGenerator::GenerateDoubleToObject |
7367 { REG(edx), REG(ebx), REG(edi), EMIT_REMEMBERED_SET}, | 7392 { REG(edx), REG(ebx), REG(edi), EMIT_REMEMBERED_SET}, |
7368 { REG(edx), REG(ebx), REG(edi), OMIT_REMEMBERED_SET}, | 7393 { REG(edx), REG(ebx), REG(edi), OMIT_REMEMBERED_SET}, |
7369 // ElementsTransitionGenerator::GenerateDoubleToObject | 7394 // ElementsTransitionGenerator::GenerateDoubleToObject |
7370 { REG(eax), REG(edx), REG(esi), EMIT_REMEMBERED_SET}, | 7395 { REG(eax), REG(edx), REG(esi), EMIT_REMEMBERED_SET}, |
7371 { REG(edx), REG(eax), REG(edi), EMIT_REMEMBERED_SET}, | 7396 { REG(edx), REG(eax), REG(edi), EMIT_REMEMBERED_SET}, |
7372 // StoreArrayLiteralElementStub::Generate | 7397 // StoreArrayLiteralElementStub::Generate |
7373 { REG(ebx), REG(eax), REG(ecx), EMIT_REMEMBERED_SET}, | 7398 { REG(ebx), REG(eax), REG(ecx), EMIT_REMEMBERED_SET}, |
7374 // FastNewClosureStub | 7399 // FastNewClosureStub and StringAddStub::Generate |
7375 { REG(ecx), REG(edx), REG(ebx), EMIT_REMEMBERED_SET}, | 7400 { REG(ecx), REG(edx), REG(ebx), EMIT_REMEMBERED_SET}, |
| 7401 // StringAddStub::Generate |
| 7402 { REG(ecx), REG(eax), REG(ebx), EMIT_REMEMBERED_SET}, |
7376 // Null termination. | 7403 // Null termination. |
7377 { REG(no_reg), REG(no_reg), REG(no_reg), EMIT_REMEMBERED_SET} | 7404 { REG(no_reg), REG(no_reg), REG(no_reg), EMIT_REMEMBERED_SET} |
7378 }; | 7405 }; |
7379 | 7406 |
7380 #undef REG | 7407 #undef REG |
7381 | 7408 |
7382 bool RecordWriteStub::IsPregenerated() { | 7409 bool RecordWriteStub::IsPregenerated() { |
7383 for (const AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime; | 7410 for (const AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime; |
7384 !entry->object.is(no_reg); | 7411 !entry->object.is(no_reg); |
7385 entry++) { | 7412 entry++) { |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7943 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); | 7970 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); |
7944 } | 7971 } |
7945 } | 7972 } |
7946 | 7973 |
7947 | 7974 |
7948 #undef __ | 7975 #undef __ |
7949 | 7976 |
7950 } } // namespace v8::internal | 7977 } } // namespace v8::internal |
7951 | 7978 |
7952 #endif // V8_TARGET_ARCH_IA32 | 7979 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |