Index: src/x64/code-stubs-x64.cc |
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc |
index 8f27374af5f156b9c6e85ef2f6622f4fd0821ec2..cc44f19383af2388741d325f3b9b465f0dbb3879 100644 |
--- a/src/x64/code-stubs-x64.cc |
+++ b/src/x64/code-stubs-x64.cc |
@@ -4941,9 +4941,19 @@ void SubStringStub::Generate(MacroAssembler* masm) { |
STATIC_ASSERT((kStringEncodingMask & kOneByteStringTag) != 0); |
STATIC_ASSERT((kStringEncodingMask & kTwoByteStringTag) == 0); |
__ testb(rbx, Immediate(kStringEncodingMask)); |
- __ j(zero, &two_byte_slice, Label::kNear); |
+ if (masm->isolate()->heap_profiler()->is_tracking_allocations()) { |
+ // Make a long jump due to RecordObjectAllocation inside |
yurys
2013/09/25 10:41:12
You could calculate
Label::Distance distance = ma
Alexandra Mikhaylova
2013/09/25 14:33:40
Done.
|
+ // MacroAssembler::Allocate |
+ __ j(zero, &two_byte_slice); |
+ } else { |
+ __ j(zero, &two_byte_slice, Label::kNear); |
+ } |
__ AllocateAsciiSlicedString(rax, rbx, r14, &runtime); |
- __ jmp(&set_slice_header, Label::kNear); |
+ if (masm->isolate()->heap_profiler()->is_tracking_allocations()) { |
+ __ jmp(&set_slice_header); |
+ } else { |
+ __ jmp(&set_slice_header, Label::kNear); |
+ } |
__ bind(&two_byte_slice); |
__ AllocateTwoByteSlicedString(rax, rbx, r14, &runtime); |
__ bind(&set_slice_header); |