OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 5216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5227 __ j(less, ©_routine); | 5227 __ j(less, ©_routine); |
5228 // Allocate new sliced string. At this point we do not reload the instance | 5228 // Allocate new sliced string. At this point we do not reload the instance |
5229 // type including the string encoding because we simply rely on the info | 5229 // type including the string encoding because we simply rely on the info |
5230 // provided by the original string. It does not matter if the original | 5230 // provided by the original string. It does not matter if the original |
5231 // string's encoding is wrong because we always have to recheck encoding of | 5231 // string's encoding is wrong because we always have to recheck encoding of |
5232 // the newly created string's parent anyways due to externalized strings. | 5232 // the newly created string's parent anyways due to externalized strings. |
5233 Label two_byte_slice, set_slice_header; | 5233 Label two_byte_slice, set_slice_header; |
5234 STATIC_ASSERT((kStringEncodingMask & kOneByteStringTag) != 0); | 5234 STATIC_ASSERT((kStringEncodingMask & kOneByteStringTag) != 0); |
5235 STATIC_ASSERT((kStringEncodingMask & kTwoByteStringTag) == 0); | 5235 STATIC_ASSERT((kStringEncodingMask & kTwoByteStringTag) == 0); |
5236 __ testb(rbx, Immediate(kStringEncodingMask)); | 5236 __ testb(rbx, Immediate(kStringEncodingMask)); |
5237 __ j(zero, &two_byte_slice, Label::kNear); | 5237 // Make a long jump due to RecordObjectAllocation inside |
| 5238 // MacroAssembler::Allocate |
| 5239 __ j(zero, &two_byte_slice); |
5238 __ AllocateAsciiSlicedString(rax, rbx, r14, &runtime); | 5240 __ AllocateAsciiSlicedString(rax, rbx, r14, &runtime); |
5239 __ jmp(&set_slice_header, Label::kNear); | 5241 __ jmp(&set_slice_header); |
5240 __ bind(&two_byte_slice); | 5242 __ bind(&two_byte_slice); |
5241 __ AllocateTwoByteSlicedString(rax, rbx, r14, &runtime); | 5243 __ AllocateTwoByteSlicedString(rax, rbx, r14, &runtime); |
5242 __ bind(&set_slice_header); | 5244 __ bind(&set_slice_header); |
5243 __ Integer32ToSmi(rcx, rcx); | 5245 __ Integer32ToSmi(rcx, rcx); |
5244 __ movq(FieldOperand(rax, SlicedString::kLengthOffset), rcx); | 5246 __ movq(FieldOperand(rax, SlicedString::kLengthOffset), rcx); |
5245 __ movq(FieldOperand(rax, SlicedString::kHashFieldOffset), | 5247 __ movq(FieldOperand(rax, SlicedString::kHashFieldOffset), |
5246 Immediate(String::kEmptyHashField)); | 5248 Immediate(String::kEmptyHashField)); |
5247 __ movq(FieldOperand(rax, SlicedString::kParentOffset), rdi); | 5249 __ movq(FieldOperand(rax, SlicedString::kParentOffset), rdi); |
5248 __ movq(FieldOperand(rax, SlicedString::kOffsetOffset), rdx); | 5250 __ movq(FieldOperand(rax, SlicedString::kOffsetOffset), rdx); |
5249 __ IncrementCounter(counters->sub_string_native(), 1); | 5251 __ IncrementCounter(counters->sub_string_native(), 1); |
(...skipping 1550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6800 __ bind(&fast_elements_case); | 6802 __ bind(&fast_elements_case); |
6801 GenerateCase(masm, FAST_ELEMENTS); | 6803 GenerateCase(masm, FAST_ELEMENTS); |
6802 } | 6804 } |
6803 | 6805 |
6804 | 6806 |
6805 #undef __ | 6807 #undef __ |
6806 | 6808 |
6807 } } // namespace v8::internal | 6809 } } // namespace v8::internal |
6808 | 6810 |
6809 #endif // V8_TARGET_ARCH_X64 | 6811 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |