OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 3740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3751 ResourceConstraints(); | 3751 ResourceConstraints(); |
3752 int max_young_space_size() const { return max_young_space_size_; } | 3752 int max_young_space_size() const { return max_young_space_size_; } |
3753 void set_max_young_space_size(int value) { max_young_space_size_ = value; } | 3753 void set_max_young_space_size(int value) { max_young_space_size_ = value; } |
3754 int max_old_space_size() const { return max_old_space_size_; } | 3754 int max_old_space_size() const { return max_old_space_size_; } |
3755 void set_max_old_space_size(int value) { max_old_space_size_ = value; } | 3755 void set_max_old_space_size(int value) { max_old_space_size_ = value; } |
3756 int max_executable_size() { return max_executable_size_; } | 3756 int max_executable_size() { return max_executable_size_; } |
3757 void set_max_executable_size(int value) { max_executable_size_ = value; } | 3757 void set_max_executable_size(int value) { max_executable_size_ = value; } |
3758 uint32_t* stack_limit() const { return stack_limit_; } | 3758 uint32_t* stack_limit() const { return stack_limit_; } |
3759 // Sets an address beyond which the VM's stack may not grow. | 3759 // Sets an address beyond which the VM's stack may not grow. |
3760 void set_stack_limit(uint32_t* value) { stack_limit_ = value; } | 3760 void set_stack_limit(uint32_t* value) { stack_limit_ = value; } |
| 3761 Maybe<bool> is_memory_constrained() const { return is_memory_constrained_; } |
| 3762 // If set to true, V8 will limit it's memory usage, at the potential cost of |
| 3763 // lower performance. Note, this option is a tentative addition to the API |
| 3764 // and may be removed or modified without warning. |
| 3765 void set_memory_constrained(bool value) { |
| 3766 is_memory_constrained_ = Maybe<bool>(value); |
| 3767 } |
| 3768 |
3761 private: | 3769 private: |
3762 int max_young_space_size_; | 3770 int max_young_space_size_; |
3763 int max_old_space_size_; | 3771 int max_old_space_size_; |
3764 int max_executable_size_; | 3772 int max_executable_size_; |
3765 uint32_t* stack_limit_; | 3773 uint32_t* stack_limit_; |
| 3774 Maybe<bool> is_memory_constrained_; |
3766 }; | 3775 }; |
3767 | 3776 |
3768 | 3777 |
3769 bool V8_EXPORT SetResourceConstraints(ResourceConstraints* constraints); | 3778 bool V8_EXPORT SetResourceConstraints(ResourceConstraints* constraints); |
3770 | 3779 |
3771 | 3780 |
3772 // --- Exceptions --- | 3781 // --- Exceptions --- |
3773 | 3782 |
3774 | 3783 |
3775 typedef void (*FatalErrorCallback)(const char* location, const char* message); | 3784 typedef void (*FatalErrorCallback)(const char* location, const char* message); |
(...skipping 2661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6437 */ | 6446 */ |
6438 | 6447 |
6439 | 6448 |
6440 } // namespace v8 | 6449 } // namespace v8 |
6441 | 6450 |
6442 | 6451 |
6443 #undef TYPE_CHECK | 6452 #undef TYPE_CHECK |
6444 | 6453 |
6445 | 6454 |
6446 #endif // V8_H_ | 6455 #endif // V8_H_ |
OLD | NEW |