OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 19 matching lines...) Expand all Loading... |
30 #undef USING_V8_SHARED | 30 #undef USING_V8_SHARED |
31 #include "../include/v8-defaults.h" | 31 #include "../include/v8-defaults.h" |
32 | 32 |
33 #include "platform.h" | 33 #include "platform.h" |
34 #include "globals.h" | 34 #include "globals.h" |
35 #include "v8.h" | 35 #include "v8.h" |
36 | 36 |
37 namespace v8 { | 37 namespace v8 { |
38 | 38 |
39 | 39 |
| 40 // TODO(rmcilroy): Remove this function once it is no longer used in Chrome. |
40 bool ConfigureResourceConstraintsForCurrentPlatform( | 41 bool ConfigureResourceConstraintsForCurrentPlatform( |
41 ResourceConstraints* constraints) { | 42 ResourceConstraints* constraints) { |
42 if (constraints == NULL) { | 43 if (constraints == NULL) { |
43 return false; | 44 return false; |
44 } | 45 } |
45 | 46 |
46 int lump_of_memory = (i::kPointerSize / 4) * i::MB; | 47 int lump_of_memory = (i::kPointerSize / 4) * i::MB; |
47 | 48 |
48 // The young_space_size should be a power of 2 and old_generation_size should | 49 // The young_space_size should be a power of 2 and old_generation_size should |
49 // be a multiple of Page::kPageSize. | 50 // be a multiple of Page::kPageSize. |
50 #if V8_OS_ANDROID | 51 #if V8_OS_ANDROID |
51 constraints->set_max_young_space_size(8 * lump_of_memory); | 52 constraints->set_max_young_space_size(8 * lump_of_memory); |
52 constraints->set_max_old_space_size(256 * lump_of_memory); | 53 constraints->set_max_old_space_size(256 * lump_of_memory); |
53 constraints->set_max_executable_size(192 * lump_of_memory); | 54 constraints->set_max_executable_size(192 * lump_of_memory); |
54 #else | 55 #else |
55 constraints->set_max_young_space_size(16 * lump_of_memory); | 56 constraints->set_max_young_space_size(16 * lump_of_memory); |
56 constraints->set_max_old_space_size(700 * lump_of_memory); | 57 constraints->set_max_old_space_size(700 * lump_of_memory); |
57 constraints->set_max_executable_size(256 * lump_of_memory); | 58 constraints->set_max_executable_size(256 * lump_of_memory); |
58 #endif | 59 #endif |
59 return true; | 60 return true; |
60 } | 61 } |
61 | 62 |
62 | 63 |
| 64 // TODO(rmcilroy): Remove this function once it is no longer used in Chrome. |
63 bool SetDefaultResourceConstraintsForCurrentPlatform() { | 65 bool SetDefaultResourceConstraintsForCurrentPlatform() { |
64 ResourceConstraints constraints; | 66 ResourceConstraints constraints; |
65 if (!ConfigureResourceConstraintsForCurrentPlatform(&constraints)) | 67 if (!ConfigureResourceConstraintsForCurrentPlatform(&constraints)) |
66 return false; | 68 return false; |
67 return SetResourceConstraints(&constraints); | 69 return SetResourceConstraints(&constraints); |
68 } | 70 } |
69 | 71 |
70 } // namespace v8 | 72 } // namespace v8 |
OLD | NEW |