| OLD | NEW |
| 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 // If no properties are added in the constructor, they are more likely | 183 // If no properties are added in the constructor, they are more likely |
| 184 // to be added later. | 184 // to be added later. |
| 185 if (estimate == 0) estimate = 2; | 185 if (estimate == 0) estimate = 2; |
| 186 | 186 |
| 187 // We do not shrink objects that go into a snapshot (yet), so we adjust | 187 // We do not shrink objects that go into a snapshot (yet), so we adjust |
| 188 // the estimate conservatively. | 188 // the estimate conservatively. |
| 189 if (Serializer::enabled()) return estimate + 2; | 189 if (Serializer::enabled()) return estimate + 2; |
| 190 | 190 |
| 191 // Inobject slack tracking will reclaim redundant inobject space later, | 191 // Inobject slack tracking will reclaim redundant inobject space later, |
| 192 // so we can afford to adjust the estimate generously. | 192 // so we can afford to adjust the estimate generously. |
| 193 return estimate + 8; | 193 if (FLAG_clever_optimizations) { |
| 194 return estimate + 8; |
| 195 } else { |
| 196 return estimate + 3; |
| 197 } |
| 194 } | 198 } |
| 195 | 199 |
| 196 | 200 |
| 197 void SetExpectedNofPropertiesFromEstimate(Handle<SharedFunctionInfo> shared, | 201 void SetExpectedNofPropertiesFromEstimate(Handle<SharedFunctionInfo> shared, |
| 198 int estimate) { | 202 int estimate) { |
| 199 // See the comment in SetExpectedNofProperties. | 203 // See the comment in SetExpectedNofProperties. |
| 200 if (shared->live_objects_may_exist()) return; | 204 if (shared->live_objects_may_exist()) return; |
| 201 | 205 |
| 202 shared->set_expected_nof_properties( | 206 shared->set_expected_nof_properties( |
| 203 ExpectedNofPropertiesFromEstimate(estimate)); | 207 ExpectedNofPropertiesFromEstimate(estimate)); |
| (...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 | 942 |
| 939 bool CompileOptimized(Handle<JSFunction> function, | 943 bool CompileOptimized(Handle<JSFunction> function, |
| 940 int osr_ast_id, | 944 int osr_ast_id, |
| 941 ClearExceptionFlag flag) { | 945 ClearExceptionFlag flag) { |
| 942 CompilationInfo info(function); | 946 CompilationInfo info(function); |
| 943 info.SetOptimizing(osr_ast_id); | 947 info.SetOptimizing(osr_ast_id); |
| 944 return CompileLazyHelper(&info, flag); | 948 return CompileLazyHelper(&info, flag); |
| 945 } | 949 } |
| 946 | 950 |
| 947 } } // namespace v8::internal | 951 } } // namespace v8::internal |
| OLD | NEW |