Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Side by Side Diff: src/x64/code-stubs-x64.cc

Issue 22852024: Track JS allocations as they arrive with no affection on performance when tracking is switched off (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Deoptimize code and generate optimized code when switching allocations tracking Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 4922 matching lines...) Expand 10 before | Expand all | Expand 10 after
4933 __ j(less, &copy_routine); 4933 __ j(less, &copy_routine);
4934 // Allocate new sliced string. At this point we do not reload the instance 4934 // Allocate new sliced string. At this point we do not reload the instance
4935 // type including the string encoding because we simply rely on the info 4935 // type including the string encoding because we simply rely on the info
4936 // provided by the original string. It does not matter if the original 4936 // provided by the original string. It does not matter if the original
4937 // string's encoding is wrong because we always have to recheck encoding of 4937 // string's encoding is wrong because we always have to recheck encoding of
4938 // the newly created string's parent anyways due to externalized strings. 4938 // the newly created string's parent anyways due to externalized strings.
4939 Label two_byte_slice, set_slice_header; 4939 Label two_byte_slice, set_slice_header;
4940 STATIC_ASSERT((kStringEncodingMask & kOneByteStringTag) != 0); 4940 STATIC_ASSERT((kStringEncodingMask & kOneByteStringTag) != 0);
4941 STATIC_ASSERT((kStringEncodingMask & kTwoByteStringTag) == 0); 4941 STATIC_ASSERT((kStringEncodingMask & kTwoByteStringTag) == 0);
4942 __ testb(rbx, Immediate(kStringEncodingMask)); 4942 __ testb(rbx, Immediate(kStringEncodingMask));
4943 __ j(zero, &two_byte_slice, Label::kNear); 4943 if (masm->emit_allocations_tracking_code()) {
4944 // Make a long jump due to RecordObjectAllocation inside
4945 // MacroAssembler::Allocate
4946 __ j(zero, &two_byte_slice);
4947 } else {
4948 __ j(zero, &two_byte_slice, Label::kNear);
4949 }
4944 __ AllocateAsciiSlicedString(rax, rbx, r14, &runtime); 4950 __ AllocateAsciiSlicedString(rax, rbx, r14, &runtime);
4945 __ jmp(&set_slice_header, Label::kNear); 4951 if (masm->emit_allocations_tracking_code()) {
4952 __ jmp(&set_slice_header);
4953 } else {
4954 __ jmp(&set_slice_header, Label::kNear);
4955 }
4946 __ bind(&two_byte_slice); 4956 __ bind(&two_byte_slice);
4947 __ AllocateTwoByteSlicedString(rax, rbx, r14, &runtime); 4957 __ AllocateTwoByteSlicedString(rax, rbx, r14, &runtime);
4948 __ bind(&set_slice_header); 4958 __ bind(&set_slice_header);
4949 __ Integer32ToSmi(rcx, rcx); 4959 __ Integer32ToSmi(rcx, rcx);
4950 __ movq(FieldOperand(rax, SlicedString::kLengthOffset), rcx); 4960 __ movq(FieldOperand(rax, SlicedString::kLengthOffset), rcx);
4951 __ movq(FieldOperand(rax, SlicedString::kHashFieldOffset), 4961 __ movq(FieldOperand(rax, SlicedString::kHashFieldOffset),
4952 Immediate(String::kEmptyHashField)); 4962 Immediate(String::kEmptyHashField));
4953 __ movq(FieldOperand(rax, SlicedString::kParentOffset), rdi); 4963 __ movq(FieldOperand(rax, SlicedString::kParentOffset), rdi);
4954 __ movq(FieldOperand(rax, SlicedString::kOffsetOffset), rdx); 4964 __ movq(FieldOperand(rax, SlicedString::kOffsetOffset), rdx);
4955 __ IncrementCounter(counters->sub_string_native(), 1); 4965 __ IncrementCounter(counters->sub_string_native(), 1);
(...skipping 1590 matching lines...) Expand 10 before | Expand all | Expand 10 after
6546 __ bind(&fast_elements_case); 6556 __ bind(&fast_elements_case);
6547 GenerateCase(masm, FAST_ELEMENTS); 6557 GenerateCase(masm, FAST_ELEMENTS);
6548 } 6558 }
6549 6559
6550 6560
6551 #undef __ 6561 #undef __
6552 6562
6553 } } // namespace v8::internal 6563 } } // namespace v8::internal
6554 6564
6555 #endif // V8_TARGET_ARCH_X64 6565 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/spaces-inl.h ('k') | src/x64/macro-assembler-x64.h » ('j') | test/cctest/cctest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698