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

Side by Side Diff: src/objects-inl.h

Issue 413173002: Revert r22597 (which should have been called: "Tests that the GC doesn't mistake non-pointer consta… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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-constantpool.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Review notes: 5 // Review notes:
6 // 6 //
7 // - The use of macros in these inline functions may seem superfluous 7 // - The use of macros in these inline functions may seem superfluous
8 // but it is absolutely needed to make sure gcc generates optimal 8 // but it is absolutely needed to make sure gcc generates optimal
9 // code. gcc is not happy when attempting to inline too deep. 9 // code. gcc is not happy when attempting to inline too deep.
10 // 10 //
(...skipping 2521 matching lines...) Expand 10 before | Expand all | Expand 10 after
2532 2532
2533 void ConstantPoolArray::set(int index, Address value) { 2533 void ConstantPoolArray::set(int index, Address value) {
2534 ASSERT(map() == GetHeap()->constant_pool_array_map()); 2534 ASSERT(map() == GetHeap()->constant_pool_array_map());
2535 ASSERT(get_type(index) == CODE_PTR); 2535 ASSERT(get_type(index) == CODE_PTR);
2536 WRITE_FIELD(this, OffsetOfElementAt(index), reinterpret_cast<Object*>(value)); 2536 WRITE_FIELD(this, OffsetOfElementAt(index), reinterpret_cast<Object*>(value));
2537 } 2537 }
2538 2538
2539 2539
2540 void ConstantPoolArray::set(int index, Object* value) { 2540 void ConstantPoolArray::set(int index, Object* value) {
2541 ASSERT(map() == GetHeap()->constant_pool_array_map()); 2541 ASSERT(map() == GetHeap()->constant_pool_array_map());
2542 ASSERT(!GetHeap()->InNewSpace(value));
2543 ASSERT(get_type(index) == HEAP_PTR); 2542 ASSERT(get_type(index) == HEAP_PTR);
2544 WRITE_FIELD(this, OffsetOfElementAt(index), value); 2543 WRITE_FIELD(this, OffsetOfElementAt(index), value);
2545 WRITE_BARRIER(GetHeap(), this, OffsetOfElementAt(index), value); 2544 WRITE_BARRIER(GetHeap(), this, OffsetOfElementAt(index), value);
2546 } 2545 }
2547 2546
2548 2547
2549 void ConstantPoolArray::set(int index, int32_t value) { 2548 void ConstantPoolArray::set(int index, int32_t value) {
2550 ASSERT(map() == GetHeap()->constant_pool_array_map()); 2549 ASSERT(map() == GetHeap()->constant_pool_array_map());
2551 ASSERT(get_type(index) == INT32); 2550 ASSERT(get_type(index) == INT32);
2552 WRITE_INT32_FIELD(this, OffsetOfElementAt(index), value); 2551 WRITE_INT32_FIELD(this, OffsetOfElementAt(index), value);
(...skipping 24 matching lines...) Expand all
2577 void ConstantPoolArray::set_at_offset(int offset, Address value) { 2576 void ConstantPoolArray::set_at_offset(int offset, Address value) {
2578 ASSERT(map() == GetHeap()->constant_pool_array_map()); 2577 ASSERT(map() == GetHeap()->constant_pool_array_map());
2579 ASSERT(offset_is_type(offset, CODE_PTR)); 2578 ASSERT(offset_is_type(offset, CODE_PTR));
2580 WRITE_FIELD(this, offset, reinterpret_cast<Object*>(value)); 2579 WRITE_FIELD(this, offset, reinterpret_cast<Object*>(value));
2581 WRITE_BARRIER(GetHeap(), this, offset, reinterpret_cast<Object*>(value)); 2580 WRITE_BARRIER(GetHeap(), this, offset, reinterpret_cast<Object*>(value));
2582 } 2581 }
2583 2582
2584 2583
2585 void ConstantPoolArray::set_at_offset(int offset, Object* value) { 2584 void ConstantPoolArray::set_at_offset(int offset, Object* value) {
2586 ASSERT(map() == GetHeap()->constant_pool_array_map()); 2585 ASSERT(map() == GetHeap()->constant_pool_array_map());
2587 ASSERT(!GetHeap()->InNewSpace(value));
2588 ASSERT(offset_is_type(offset, HEAP_PTR)); 2586 ASSERT(offset_is_type(offset, HEAP_PTR));
2589 WRITE_FIELD(this, offset, value); 2587 WRITE_FIELD(this, offset, value);
2590 WRITE_BARRIER(GetHeap(), this, offset, value); 2588 WRITE_BARRIER(GetHeap(), this, offset, value);
2591 } 2589 }
2592 2590
2593 2591
2594 void ConstantPoolArray::Init(const NumberOfEntries& small) { 2592 void ConstantPoolArray::Init(const NumberOfEntries& small) {
2595 uint32_t small_layout_1 = 2593 uint32_t small_layout_1 =
2596 Int64CountField::encode(small.count_of(INT64)) | 2594 Int64CountField::encode(small.count_of(INT64)) |
2597 CodePtrCountField::encode(small.count_of(CODE_PTR)) | 2595 CodePtrCountField::encode(small.count_of(CODE_PTR)) |
(...skipping 4618 matching lines...) Expand 10 before | Expand all | Expand 10 after
7216 #undef READ_SHORT_FIELD 7214 #undef READ_SHORT_FIELD
7217 #undef WRITE_SHORT_FIELD 7215 #undef WRITE_SHORT_FIELD
7218 #undef READ_BYTE_FIELD 7216 #undef READ_BYTE_FIELD
7219 #undef WRITE_BYTE_FIELD 7217 #undef WRITE_BYTE_FIELD
7220 #undef NOBARRIER_READ_BYTE_FIELD 7218 #undef NOBARRIER_READ_BYTE_FIELD
7221 #undef NOBARRIER_WRITE_BYTE_FIELD 7219 #undef NOBARRIER_WRITE_BYTE_FIELD
7222 7220
7223 } } // namespace v8::internal 7221 } } // namespace v8::internal
7224 7222
7225 #endif // V8_OBJECTS_INL_H_ 7223 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-constantpool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698