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

Side by Side Diff: src/spaces.cc

Issue 7607031: Update gc branch to bleeding_edge revision 8862. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Fix bug in weak-map merge 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
« no previous file with comments | « src/spaces.h ('k') | src/v8.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 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 void HeapObjectIterator::Verify() { 126 void HeapObjectIterator::Verify() {
127 // TODO(gc): We should do something here. 127 // TODO(gc): We should do something here.
128 } 128 }
129 #endif 129 #endif
130 130
131 131
132 // ----------------------------------------------------------------------------- 132 // -----------------------------------------------------------------------------
133 // CodeRange 133 // CodeRange
134 134
135 135
136 CodeRange::CodeRange() 136 CodeRange::CodeRange(Isolate* isolate)
137 : code_range_(NULL), 137 : isolate_(isolate),
138 code_range_(NULL),
138 free_list_(0), 139 free_list_(0),
139 allocation_list_(0), 140 allocation_list_(0),
140 current_allocation_block_index_(0), 141 current_allocation_block_index_(0) {
141 isolate_(NULL) {
142 } 142 }
143 143
144 144
145 bool CodeRange::Setup(const size_t requested) { 145 bool CodeRange::Setup(const size_t requested) {
146 ASSERT(code_range_ == NULL); 146 ASSERT(code_range_ == NULL);
147 147
148 code_range_ = new VirtualMemory(requested); 148 code_range_ = new VirtualMemory(requested);
149 CHECK(code_range_ != NULL); 149 CHECK(code_range_ != NULL);
150 if (!code_range_->IsReserved()) { 150 if (!code_range_->IsReserved()) {
151 delete code_range_; 151 delete code_range_;
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 code_range_ = NULL; 262 code_range_ = NULL;
263 free_list_.Free(); 263 free_list_.Free();
264 allocation_list_.Free(); 264 allocation_list_.Free();
265 } 265 }
266 266
267 267
268 // ----------------------------------------------------------------------------- 268 // -----------------------------------------------------------------------------
269 // MemoryAllocator 269 // MemoryAllocator
270 // 270 //
271 271
272 MemoryAllocator::MemoryAllocator(Isolate* isolate)
273 : isolate_(isolate),
274 capacity_(0),
275 capacity_executable_(0),
276 size_(0),
277 size_executable_(0) {
278 }
279
280
272 bool MemoryAllocator::Setup(intptr_t capacity, intptr_t capacity_executable) { 281 bool MemoryAllocator::Setup(intptr_t capacity, intptr_t capacity_executable) {
273 capacity_ = RoundUp(capacity, Page::kPageSize); 282 capacity_ = RoundUp(capacity, Page::kPageSize);
274 capacity_executable_ = RoundUp(capacity_executable, Page::kPageSize); 283 capacity_executable_ = RoundUp(capacity_executable, Page::kPageSize);
275 ASSERT_GE(capacity_, capacity_executable_); 284 ASSERT_GE(capacity_, capacity_executable_);
276 285
277 size_ = 0; 286 size_ = 0;
278 size_executable_ = 0; 287 size_executable_ = 0;
279 288
280 return true; 289 return true;
281 } 290 }
(...skipping 2217 matching lines...) Expand 10 before | Expand all | Expand 10 after
2499 for (HeapObject* obj = obj_it.Next(); obj != NULL; obj = obj_it.Next()) { 2508 for (HeapObject* obj = obj_it.Next(); obj != NULL; obj = obj_it.Next()) {
2500 if (obj->IsCode()) { 2509 if (obj->IsCode()) {
2501 Code* code = Code::cast(obj); 2510 Code* code = Code::cast(obj);
2502 isolate->code_kind_statistics()[code->kind()] += code->Size(); 2511 isolate->code_kind_statistics()[code->kind()] += code->Size();
2503 } 2512 }
2504 } 2513 }
2505 } 2514 }
2506 #endif // DEBUG 2515 #endif // DEBUG
2507 2516
2508 } } // namespace v8::internal 2517 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/spaces.h ('k') | src/v8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698