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

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

Issue 38753007: JS allocations tracking for ia32 architecture (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 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
« no previous file with comments | « no previous file | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4344 matching lines...) Expand 10 before | Expand all | Expand 10 after
4355 __ j(less, &copy_routine); 4355 __ j(less, &copy_routine);
4356 // Allocate new sliced string. At this point we do not reload the instance 4356 // Allocate new sliced string. At this point we do not reload the instance
4357 // type including the string encoding because we simply rely on the info 4357 // type including the string encoding because we simply rely on the info
4358 // provided by the original string. It does not matter if the original 4358 // provided by the original string. It does not matter if the original
4359 // string's encoding is wrong because we always have to recheck encoding of 4359 // string's encoding is wrong because we always have to recheck encoding of
4360 // the newly created string's parent anyways due to externalized strings. 4360 // the newly created string's parent anyways due to externalized strings.
4361 Label two_byte_slice, set_slice_header; 4361 Label two_byte_slice, set_slice_header;
4362 STATIC_ASSERT((kStringEncodingMask & kOneByteStringTag) != 0); 4362 STATIC_ASSERT((kStringEncodingMask & kOneByteStringTag) != 0);
4363 STATIC_ASSERT((kStringEncodingMask & kTwoByteStringTag) == 0); 4363 STATIC_ASSERT((kStringEncodingMask & kTwoByteStringTag) == 0);
4364 __ test(ebx, Immediate(kStringEncodingMask)); 4364 __ test(ebx, Immediate(kStringEncodingMask));
4365 __ j(zero, &two_byte_slice, Label::kNear); 4365 // Make long jumps when allocations tracking is on due to
4366 // RecordObjectAllocation inside MacroAssembler::Allocate.
4367 Label::Distance jump_distance =
4368 masm->isolate()->heap_profiler()->is_tracking_allocations()
4369 ? Label::kFar
4370 : Label::kNear;
4371 __ j(zero, &two_byte_slice, jump_distance);
4366 __ AllocateAsciiSlicedString(eax, ebx, no_reg, &runtime); 4372 __ AllocateAsciiSlicedString(eax, ebx, no_reg, &runtime);
4367 __ jmp(&set_slice_header, Label::kNear); 4373 __ jmp(&set_slice_header, jump_distance);
4368 __ bind(&two_byte_slice); 4374 __ bind(&two_byte_slice);
4369 __ AllocateTwoByteSlicedString(eax, ebx, no_reg, &runtime); 4375 __ AllocateTwoByteSlicedString(eax, ebx, no_reg, &runtime);
4370 __ bind(&set_slice_header); 4376 __ bind(&set_slice_header);
4371 __ mov(FieldOperand(eax, SlicedString::kLengthOffset), ecx); 4377 __ mov(FieldOperand(eax, SlicedString::kLengthOffset), ecx);
4372 __ mov(FieldOperand(eax, SlicedString::kHashFieldOffset), 4378 __ mov(FieldOperand(eax, SlicedString::kHashFieldOffset),
4373 Immediate(String::kEmptyHashField)); 4379 Immediate(String::kEmptyHashField));
4374 __ mov(FieldOperand(eax, SlicedString::kParentOffset), edi); 4380 __ mov(FieldOperand(eax, SlicedString::kParentOffset), edi);
4375 __ mov(FieldOperand(eax, SlicedString::kOffsetOffset), edx); 4381 __ mov(FieldOperand(eax, SlicedString::kOffsetOffset), edx);
4376 __ IncrementCounter(counters->sub_string_native(), 1); 4382 __ IncrementCounter(counters->sub_string_native(), 1);
4377 __ ret(3 * kPointerSize); 4383 __ ret(3 * kPointerSize);
(...skipping 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after
6001 __ bind(&fast_elements_case); 6007 __ bind(&fast_elements_case);
6002 GenerateCase(masm, FAST_ELEMENTS); 6008 GenerateCase(masm, FAST_ELEMENTS);
6003 } 6009 }
6004 6010
6005 6011
6006 #undef __ 6012 #undef __
6007 6013
6008 } } // namespace v8::internal 6014 } } // namespace v8::internal
6009 6015
6010 #endif // V8_TARGET_ARCH_IA32 6016 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « no previous file | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698