OLD | NEW |
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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 } | 335 } |
336 | 336 |
337 | 337 |
338 ResourceConstraints::ResourceConstraints() | 338 ResourceConstraints::ResourceConstraints() |
339 : max_young_space_size_(0), | 339 : max_young_space_size_(0), |
340 max_old_space_size_(0), | 340 max_old_space_size_(0), |
341 stack_limit_(NULL) { } | 341 stack_limit_(NULL) { } |
342 | 342 |
343 | 343 |
344 bool SetResourceConstraints(ResourceConstraints* constraints) { | 344 bool SetResourceConstraints(ResourceConstraints* constraints) { |
345 int semispace_size = constraints->max_young_space_size(); | 345 int young_space_size = constraints->max_young_space_size(); |
346 int old_gen_size = constraints->max_old_space_size(); | 346 int old_gen_size = constraints->max_old_space_size(); |
347 if (semispace_size != 0 || old_gen_size != 0) { | 347 if (young_space_size != 0 || old_gen_size != 0) { |
348 bool result = i::Heap::ConfigureHeap(semispace_size, old_gen_size); | 348 bool result = i::Heap::ConfigureHeap(young_space_size / 2, old_gen_size); |
349 if (!result) return false; | 349 if (!result) return false; |
350 } | 350 } |
351 if (constraints->stack_limit() != NULL) { | 351 if (constraints->stack_limit() != NULL) { |
352 uintptr_t limit = reinterpret_cast<uintptr_t>(constraints->stack_limit()); | 352 uintptr_t limit = reinterpret_cast<uintptr_t>(constraints->stack_limit()); |
353 i::StackGuard::SetStackLimit(limit); | 353 i::StackGuard::SetStackLimit(limit); |
354 } | 354 } |
355 return true; | 355 return true; |
356 } | 356 } |
357 | 357 |
358 | 358 |
(...skipping 3453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3812 | 3812 |
3813 | 3813 |
3814 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { | 3814 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { |
3815 HandleScopeImplementer* thread_local = | 3815 HandleScopeImplementer* thread_local = |
3816 reinterpret_cast<HandleScopeImplementer*>(storage); | 3816 reinterpret_cast<HandleScopeImplementer*>(storage); |
3817 thread_local->IterateThis(v); | 3817 thread_local->IterateThis(v); |
3818 return storage + ArchiveSpacePerThread(); | 3818 return storage + ArchiveSpacePerThread(); |
3819 } | 3819 } |
3820 | 3820 |
3821 } } // namespace v8::internal | 3821 } } // namespace v8::internal |
OLD | NEW |