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 6070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6081 } | 6081 } |
6082 | 6082 |
6083 | 6083 |
6084 static void SetFlagsFromString(const char* flags) { | 6084 static void SetFlagsFromString(const char* flags) { |
6085 V8::SetFlagsFromString(flags, i::StrLength(flags)); | 6085 V8::SetFlagsFromString(flags, i::StrLength(flags)); |
6086 } | 6086 } |
6087 | 6087 |
6088 | 6088 |
6089 void Testing::PrepareStressRun(int run) { | 6089 void Testing::PrepareStressRun(int run) { |
6090 static const char* kLazyOptimizations = | 6090 static const char* kLazyOptimizations = |
6091 "--prepare-always-opt --nolimit-inlining " | 6091 "--prepare-always-opt --nolimit-inlining --noalways-opt"; |
6092 "--noalways-opt --noopt-eagerly"; | |
6093 static const char* kEagerOptimizations = "--opt-eagerly"; | |
6094 static const char* kForcedOptimizations = "--always-opt"; | 6092 static const char* kForcedOptimizations = "--always-opt"; |
6095 | 6093 |
6096 // If deoptimization stressed turn on frequent deoptimization. If no value | 6094 // If deoptimization stressed turn on frequent deoptimization. If no value |
6097 // is spefified through --deopt-every-n-times use a default default value. | 6095 // is spefified through --deopt-every-n-times use a default default value. |
6098 static const char* kDeoptEvery13Times = "--deopt-every-n-times=13"; | 6096 static const char* kDeoptEvery13Times = "--deopt-every-n-times=13"; |
6099 if (internal::Testing::stress_type() == Testing::kStressTypeDeopt && | 6097 if (internal::Testing::stress_type() == Testing::kStressTypeDeopt && |
6100 internal::FLAG_deopt_every_n_times == 0) { | 6098 internal::FLAG_deopt_every_n_times == 0) { |
6101 SetFlagsFromString(kDeoptEvery13Times); | 6099 SetFlagsFromString(kDeoptEvery13Times); |
6102 } | 6100 } |
6103 | 6101 |
6104 #ifdef DEBUG | 6102 #ifdef DEBUG |
6105 // As stressing in debug mode only make two runs skip the deopt stressing | 6103 // As stressing in debug mode only make two runs skip the deopt stressing |
6106 // here. | 6104 // here. |
6107 if (run == GetStressRuns() - 1) { | 6105 if (run == GetStressRuns() - 1) { |
6108 SetFlagsFromString(kForcedOptimizations); | 6106 SetFlagsFromString(kForcedOptimizations); |
6109 } else { | 6107 } else { |
6110 SetFlagsFromString(kEagerOptimizations); | |
6111 SetFlagsFromString(kLazyOptimizations); | 6108 SetFlagsFromString(kLazyOptimizations); |
6112 } | 6109 } |
6113 #else | 6110 #else |
6114 if (run == GetStressRuns() - 1) { | 6111 if (run == GetStressRuns() - 1) { |
6115 SetFlagsFromString(kForcedOptimizations); | 6112 SetFlagsFromString(kForcedOptimizations); |
6116 } else if (run == GetStressRuns() - 2) { | 6113 } else if (run != GetStressRuns() - 2) { |
6117 SetFlagsFromString(kEagerOptimizations); | |
6118 } else { | |
6119 SetFlagsFromString(kLazyOptimizations); | 6114 SetFlagsFromString(kLazyOptimizations); |
6120 } | 6115 } |
6121 #endif | 6116 #endif |
6122 } | 6117 } |
6123 | 6118 |
6124 | 6119 |
6125 void Testing::DeoptimizeAll() { | 6120 void Testing::DeoptimizeAll() { |
6126 internal::Deoptimizer::DeoptimizeAll(); | 6121 internal::Deoptimizer::DeoptimizeAll(); |
6127 } | 6122 } |
6128 | 6123 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6188 | 6183 |
6189 | 6184 |
6190 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { | 6185 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { |
6191 HandleScopeImplementer* scope_implementer = | 6186 HandleScopeImplementer* scope_implementer = |
6192 reinterpret_cast<HandleScopeImplementer*>(storage); | 6187 reinterpret_cast<HandleScopeImplementer*>(storage); |
6193 scope_implementer->IterateThis(v); | 6188 scope_implementer->IterateThis(v); |
6194 return storage + ArchiveSpacePerThread(); | 6189 return storage + ArchiveSpacePerThread(); |
6195 } | 6190 } |
6196 | 6191 |
6197 } } // namespace v8::internal | 6192 } } // namespace v8::internal |
OLD | NEW |