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

Side by Side Diff: src/runtime.cc

Issue 7124006: Two-page newspace. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Address review comments. Created 9 years, 6 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/mark-compact.cc ('k') | src/spaces.h » ('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 12234 matching lines...) Expand 10 before | Expand all | Expand 10 after
12245 12245
12246 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { 12246 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) {
12247 return &(kIntrinsicFunctions[static_cast<int>(id)]); 12247 return &(kIntrinsicFunctions[static_cast<int>(id)]);
12248 } 12248 }
12249 12249
12250 12250
12251 void Runtime::PerformGC(Object* result) { 12251 void Runtime::PerformGC(Object* result) {
12252 Isolate* isolate = Isolate::Current(); 12252 Isolate* isolate = Isolate::Current();
12253 Failure* failure = Failure::cast(result); 12253 Failure* failure = Failure::cast(result);
12254 if (failure->IsRetryAfterGC()) { 12254 if (failure->IsRetryAfterGC()) {
12255 if (isolate->heap()->new_space()->AddFreshPage()) {
12256 return;
12257 }
12255 // Try to do a garbage collection; ignore it if it fails. The C 12258 // Try to do a garbage collection; ignore it if it fails. The C
12256 // entry stub will throw an out-of-memory exception in that case. 12259 // entry stub will throw an out-of-memory exception in that case.
12257 isolate->heap()->CollectGarbage(failure->allocation_space()); 12260 isolate->heap()->CollectGarbage(failure->allocation_space());
12258 } else { 12261 } else {
12259 // Handle last resort GC and make sure to allow future allocations 12262 // Handle last resort GC and make sure to allow future allocations
12260 // to grow the heap without causing GCs (if possible). 12263 // to grow the heap without causing GCs (if possible).
12261 isolate->counters()->gc_last_resort_from_js()->Increment(); 12264 isolate->counters()->gc_last_resort_from_js()->Increment();
12262 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags); 12265 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags);
12263 } 12266 }
12264 } 12267 }
12265 12268
12266 12269
12267 } } // namespace v8::internal 12270 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mark-compact.cc ('k') | src/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698