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

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

Issue 7639020: Perform TODO(gc) cleanup for TODO-lockdown. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 9 years, 4 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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 if (str.length() > SeqAsciiString::kMaxLength) { 88 if (str.length() > SeqAsciiString::kMaxLength) {
89 return Failure::OutOfMemoryException(); 89 return Failure::OutOfMemoryException();
90 } 90 }
91 // Compute map and object size. 91 // Compute map and object size.
92 Map* map = ascii_symbol_map(); 92 Map* map = ascii_symbol_map();
93 int size = SeqAsciiString::SizeFor(str.length()); 93 int size = SeqAsciiString::SizeFor(str.length());
94 94
95 // Allocate string. 95 // Allocate string.
96 Object* result; 96 Object* result;
97 { MaybeObject* maybe_result = (size > MaxObjectSizeInPagedSpace()) 97 { MaybeObject* maybe_result = (size > MaxObjectSizeInPagedSpace())
98 ? lo_space_->AllocateRawData(size) 98 ? lo_space_->AllocateRaw(size, NOT_EXECUTABLE)
99 : old_data_space_->AllocateRaw(size); 99 : old_data_space_->AllocateRaw(size);
100 if (!maybe_result->ToObject(&result)) return maybe_result; 100 if (!maybe_result->ToObject(&result)) return maybe_result;
101 } 101 }
102 102
103 reinterpret_cast<HeapObject*>(result)->set_map(map); 103 reinterpret_cast<HeapObject*>(result)->set_map(map);
104 // Set length and hash fields of the allocated string. 104 // Set length and hash fields of the allocated string.
105 String* answer = String::cast(result); 105 String* answer = String::cast(result);
106 answer->set_length(str.length()); 106 answer->set_length(str.length());
107 answer->set_hash_field(hash_field); 107 answer->set_hash_field(hash_field);
108 108
(...skipping 12 matching lines...) Expand all
121 if (str.length() > SeqTwoByteString::kMaxLength) { 121 if (str.length() > SeqTwoByteString::kMaxLength) {
122 return Failure::OutOfMemoryException(); 122 return Failure::OutOfMemoryException();
123 } 123 }
124 // Compute map and object size. 124 // Compute map and object size.
125 Map* map = symbol_map(); 125 Map* map = symbol_map();
126 int size = SeqTwoByteString::SizeFor(str.length()); 126 int size = SeqTwoByteString::SizeFor(str.length());
127 127
128 // Allocate string. 128 // Allocate string.
129 Object* result; 129 Object* result;
130 { MaybeObject* maybe_result = (size > MaxObjectSizeInPagedSpace()) 130 { MaybeObject* maybe_result = (size > MaxObjectSizeInPagedSpace())
131 ? lo_space_->AllocateRawData(size) 131 ? lo_space_->AllocateRaw(size, NOT_EXECUTABLE)
132 : old_data_space_->AllocateRaw(size); 132 : old_data_space_->AllocateRaw(size);
133 if (!maybe_result->ToObject(&result)) return maybe_result; 133 if (!maybe_result->ToObject(&result)) return maybe_result;
134 } 134 }
135 135
136 reinterpret_cast<HeapObject*>(result)->set_map(map); 136 reinterpret_cast<HeapObject*>(result)->set_map(map);
137 // Set length and hash fields of the allocated string. 137 // Set length and hash fields of the allocated string.
138 String* answer = String::cast(result); 138 String* answer = String::cast(result);
139 answer->set_length(str.length()); 139 answer->set_length(str.length());
140 answer->set_hash_field(hash_field); 140 answer->set_hash_field(hash_field);
141 141
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 } 185 }
186 } 186 }
187 187
188 if (OLD_POINTER_SPACE == space) { 188 if (OLD_POINTER_SPACE == space) {
189 result = old_pointer_space_->AllocateRaw(size_in_bytes); 189 result = old_pointer_space_->AllocateRaw(size_in_bytes);
190 } else if (OLD_DATA_SPACE == space) { 190 } else if (OLD_DATA_SPACE == space) {
191 result = old_data_space_->AllocateRaw(size_in_bytes); 191 result = old_data_space_->AllocateRaw(size_in_bytes);
192 } else if (CODE_SPACE == space) { 192 } else if (CODE_SPACE == space) {
193 result = code_space_->AllocateRaw(size_in_bytes); 193 result = code_space_->AllocateRaw(size_in_bytes);
194 } else if (LO_SPACE == space) { 194 } else if (LO_SPACE == space) {
195 // TODO(gc) Keep track of whether we are allocating a fixed array here 195 result = lo_space_->AllocateRaw(size_in_bytes, NOT_EXECUTABLE);
196 // so that we can call AllocateRawFixedArray instead.
197 result = lo_space_->AllocateRawData(size_in_bytes);
198 } else if (CELL_SPACE == space) { 196 } else if (CELL_SPACE == space) {
199 result = cell_space_->AllocateRaw(size_in_bytes); 197 result = cell_space_->AllocateRaw(size_in_bytes);
200 } else { 198 } else {
201 ASSERT(MAP_SPACE == space); 199 ASSERT(MAP_SPACE == space);
202 result = map_space_->AllocateRaw(size_in_bytes); 200 result = map_space_->AllocateRaw(size_in_bytes);
203 } 201 }
204 if (result->IsFailure()) old_gen_exhausted_ = true; 202 if (result->IsFailure()) old_gen_exhausted_ = true;
205 return result; 203 return result;
206 } 204 }
207 205
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 675
678 676
679 Heap* _inline_get_heap_() { 677 Heap* _inline_get_heap_() {
680 return HEAP; 678 return HEAP;
681 } 679 }
682 680
683 681
684 } } // namespace v8::internal 682 } } // namespace v8::internal
685 683
686 #endif // V8_HEAP_INL_H_ 684 #endif // V8_HEAP_INL_H_
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/ia32/assembler-ia32-inl.h » ('j') | src/mark-compact.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698