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

Side by Side Diff: src/builtins.cc

Issue 9748007: HeapProfiler doesn't track array movements when it is shifting. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: A test was added Created 8 years, 9 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 | test/cctest/test-heap-profiler.cc » ('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 15 matching lines...) Expand all
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 #include "v8.h" 28 #include "v8.h"
29 29
30 #include "api.h" 30 #include "api.h"
31 #include "arguments.h" 31 #include "arguments.h"
32 #include "bootstrapper.h" 32 #include "bootstrapper.h"
33 #include "builtins.h" 33 #include "builtins.h"
34 #include "gdb-jit.h" 34 #include "gdb-jit.h"
35 #include "ic-inl.h" 35 #include "ic-inl.h"
36 #include "heap-profiler.h"
36 #include "mark-compact.h" 37 #include "mark-compact.h"
37 #include "vm-state-inl.h" 38 #include "vm-state-inl.h"
38 39
39 namespace v8 { 40 namespace v8 {
40 namespace internal { 41 namespace internal {
41 42
42 namespace { 43 namespace {
43 44
44 // Arguments object passed to C++ builtins. 45 // Arguments object passed to C++ builtins.
45 template <BuiltinExtraArguments extra_args> 46 template <BuiltinExtraArguments extra_args>
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 former_start[to_trim + 1] = Smi::FromInt(len - to_trim); 374 former_start[to_trim + 1] = Smi::FromInt(len - to_trim);
374 375
375 // Maintain marking consistency for HeapObjectIterator and 376 // Maintain marking consistency for HeapObjectIterator and
376 // IncrementalMarking. 377 // IncrementalMarking.
377 int size_delta = to_trim * kPointerSize; 378 int size_delta = to_trim * kPointerSize;
378 if (heap->marking()->TransferMark(elms->address(), 379 if (heap->marking()->TransferMark(elms->address(),
379 elms->address() + size_delta)) { 380 elms->address() + size_delta)) {
380 MemoryChunk::IncrementLiveBytesFromMutator(elms->address(), -size_delta); 381 MemoryChunk::IncrementLiveBytesFromMutator(elms->address(), -size_delta);
381 } 382 }
382 383
384 HEAP_PROFILE(heap, ObjectMoveEvent(elms->address(),
385 elms->address() + size_delta));
383 return FixedArray::cast(HeapObject::FromAddress( 386 return FixedArray::cast(HeapObject::FromAddress(
384 elms->address() + to_trim * kPointerSize)); 387 elms->address() + to_trim * kPointerSize));
385 } 388 }
386 389
387 390
388 static bool ArrayPrototypeHasNoElements(Heap* heap, 391 static bool ArrayPrototypeHasNoElements(Heap* heap,
389 Context* global_context, 392 Context* global_context,
390 JSObject* array_proto) { 393 JSObject* array_proto) {
391 // This method depends on non writability of Object and Array prototype 394 // This method depends on non writability of Object and Array prototype
392 // fields. 395 // fields.
(...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after
1732 return Handle<Code>(code_address); \ 1735 return Handle<Code>(code_address); \
1733 } 1736 }
1734 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) 1737 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C)
1735 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) 1738 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A)
1736 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) 1739 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
1737 #undef DEFINE_BUILTIN_ACCESSOR_C 1740 #undef DEFINE_BUILTIN_ACCESSOR_C
1738 #undef DEFINE_BUILTIN_ACCESSOR_A 1741 #undef DEFINE_BUILTIN_ACCESSOR_A
1739 1742
1740 1743
1741 } } // namespace v8::internal 1744 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698