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

Side by Side Diff: src/api.cc

Issue 242074: Fix the stack limits setting API so it is usable. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 2 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 | « include/v8.h ('k') | src/arm/simulator-arm.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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 } 334 }
335 335
336 336
337 ResourceConstraints::ResourceConstraints() 337 ResourceConstraints::ResourceConstraints()
338 : max_young_space_size_(0), 338 : max_young_space_size_(0),
339 max_old_space_size_(0), 339 max_old_space_size_(0),
340 stack_limit_(NULL) { } 340 stack_limit_(NULL) { }
341 341
342 342
343 bool SetResourceConstraints(ResourceConstraints* constraints) { 343 bool SetResourceConstraints(ResourceConstraints* constraints) {
344 bool result = i::Heap::ConfigureHeap(constraints->max_young_space_size(), 344 int semispace_size = constraints->max_young_space_size();
345 constraints->max_old_space_size()); 345 int old_gen_size = constraints->max_old_space_size();
346 if (!result) return false; 346 if (semispace_size != 0 || old_gen_size != 0) {
347 bool result = i::Heap::ConfigureHeap(semispace_size, old_gen_size);
348 if (!result) return false;
349 }
347 if (constraints->stack_limit() != NULL) { 350 if (constraints->stack_limit() != NULL) {
348 uintptr_t limit = reinterpret_cast<uintptr_t>(constraints->stack_limit()); 351 uintptr_t limit = reinterpret_cast<uintptr_t>(constraints->stack_limit());
349 i::StackGuard::SetStackLimit(limit); 352 i::StackGuard::SetStackLimit(limit);
350 } 353 }
351 return true; 354 return true;
352 } 355 }
353 356
354 357
355 i::Object** V8::GlobalizeReference(i::Object** obj) { 358 i::Object** V8::GlobalizeReference(i::Object** obj) {
356 if (IsDeadCheck("V8::Persistent::New")) return NULL; 359 if (IsDeadCheck("V8::Persistent::New")) return NULL;
(...skipping 3409 matching lines...) Expand 10 before | Expand all | Expand 10 after
3766 3769
3767 3770
3768 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 3771 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
3769 HandleScopeImplementer* thread_local = 3772 HandleScopeImplementer* thread_local =
3770 reinterpret_cast<HandleScopeImplementer*>(storage); 3773 reinterpret_cast<HandleScopeImplementer*>(storage);
3771 thread_local->IterateThis(v); 3774 thread_local->IterateThis(v);
3772 return storage + ArchiveSpacePerThread(); 3775 return storage + ArchiveSpacePerThread();
3773 } 3776 }
3774 3777
3775 } } // namespace v8::internal 3778 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/arm/simulator-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698