Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 768 // so as to avoid possible warnings about linker duplicates. | 768 // so as to avoid possible warnings about linker duplicates. |
| 769 // Override operator new to allocate IntNode subtype objects onto | 769 // Override operator new to allocate IntNode subtype objects onto |
| 770 // the dedicated heap for blink::Node. | 770 // the dedicated heap for blink::Node. |
| 771 // | 771 // |
| 772 // TODO(haraken): untangling the heap unit tests from Blink would | 772 // TODO(haraken): untangling the heap unit tests from Blink would |
| 773 // simplify and avoid running into this problem - http://crbug.com/425381 | 773 // simplify and avoid running into this problem - http://crbug.com/425381 |
| 774 GC_PLUGIN_IGNORE("crbug.com/443854") | 774 GC_PLUGIN_IGNORE("crbug.com/443854") |
| 775 void* operator new(size_t size) | 775 void* operator new(size_t size) |
| 776 { | 776 { |
| 777 ThreadState* state = ThreadState::current(); | 777 ThreadState* state = ThreadState::current(); |
| 778 return Heap::allocateOnHeapIndex(state, size, BlinkGC::NodeHeapIndex, GC InfoTrait<IntNode>::index()); | 778 const char* typeName = WTF_HEAP_PROFILER_TYPE_NAME(IntNode); |
|
Primiano Tucci (use gerrit)
2016/02/29 17:23:14
don't know how frequent this is, if is significant
sof
2016/03/03 08:37:30
(This is a unit test.)
hajimehoshi
2016/03/03 10:12:31
Since this is a unit test and we don't relatively
| |
| 779 return Heap::allocateOnHeapIndex(state, size, BlinkGC::NodeHeapIndex, GC InfoTrait<IntNode>::index(), typeName); | |
| 779 } | 780 } |
| 780 | 781 |
| 781 static IntNode* create(int i) | 782 static IntNode* create(int i) |
| 782 { | 783 { |
| 783 return new IntNode(i); | 784 return new IntNode(i); |
| 784 } | 785 } |
| 785 | 786 |
| 786 DEFINE_INLINE_TRACE() { } | 787 DEFINE_INLINE_TRACE() { } |
| 787 | 788 |
| 788 int value() { return m_value; } | 789 int value() { return m_value; } |
| (...skipping 5737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6526 EXPECT_EQ(1u, vector2.size()); | 6527 EXPECT_EQ(1u, vector2.size()); |
| 6527 // TODO(Oilpan): when Vector.h's contiguous container support no longer disables | 6528 // TODO(Oilpan): when Vector.h's contiguous container support no longer disables |
| 6528 // Vector<>s with inline capacity, remove. | 6529 // Vector<>s with inline capacity, remove. |
| 6529 #if !defined(ANNOTATE_CONTIGUOUS_CONTAINER) | 6530 #if !defined(ANNOTATE_CONTIGUOUS_CONTAINER) |
| 6530 EXPECT_EQ(16u, vector1.capacity()); | 6531 EXPECT_EQ(16u, vector1.capacity()); |
| 6531 EXPECT_EQ(16u, vector2.capacity()); | 6532 EXPECT_EQ(16u, vector2.capacity()); |
| 6532 #endif | 6533 #endif |
| 6533 } | 6534 } |
| 6534 | 6535 |
| 6535 } // namespace blink | 6536 } // namespace blink |
| OLD | NEW |