Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Side by Side Diff: src/objects-inl.h

Issue 18158007: Remove redundant set_optimizable() call (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4612 matching lines...) Expand 10 before | Expand all | Expand 10 after
4623 BOOL_GETTER(SharedFunctionInfo, 4623 BOOL_GETTER(SharedFunctionInfo,
4624 compiler_hints, 4624 compiler_hints,
4625 optimization_disabled, 4625 optimization_disabled,
4626 kOptimizationDisabled) 4626 kOptimizationDisabled)
4627 4627
4628 4628
4629 void SharedFunctionInfo::set_optimization_disabled(bool disable) { 4629 void SharedFunctionInfo::set_optimization_disabled(bool disable) {
4630 set_compiler_hints(BooleanBit::set(compiler_hints(), 4630 set_compiler_hints(BooleanBit::set(compiler_hints(),
4631 kOptimizationDisabled, 4631 kOptimizationDisabled,
4632 disable)); 4632 disable));
4633 // If disabling optimizations we reflect that in the code object so 4633 // If enabling/disabling optimizations we reflect that in the code object
4634 // it will not be counted as optimizable code. 4634 if (code()->kind() == Code::FUNCTION) {
4635 if ((code()->kind() == Code::FUNCTION) && disable) { 4635 code()->set_optimizable(!disable);
4636 code()->set_optimizable(false);
4637 } 4636 }
4638 } 4637 }
4639 4638
4640 4639
4641 int SharedFunctionInfo::profiler_ticks() { 4640 int SharedFunctionInfo::profiler_ticks() {
4642 if (code()->kind() != Code::FUNCTION) return 0; 4641 if (code()->kind() != Code::FUNCTION) return 0;
4643 return code()->profiler_ticks(); 4642 return code()->profiler_ticks();
4644 } 4643 }
4645 4644
4646 4645
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
4846 4845
4847 void SharedFunctionInfo::TryReenableOptimization() { 4846 void SharedFunctionInfo::TryReenableOptimization() {
4848 int tries = opt_reenable_tries(); 4847 int tries = opt_reenable_tries();
4849 set_opt_reenable_tries((tries + 1) & OptReenableTriesBits::kMax); 4848 set_opt_reenable_tries((tries + 1) & OptReenableTriesBits::kMax);
4850 // We reenable optimization whenever the number of tries is a large 4849 // We reenable optimization whenever the number of tries is a large
4851 // enough power of 2. 4850 // enough power of 2.
4852 if (tries >= 16 && (((tries - 1) & tries) == 0)) { 4851 if (tries >= 16 && (((tries - 1) & tries) == 0)) {
4853 set_optimization_disabled(false); 4852 set_optimization_disabled(false);
4854 set_opt_count(0); 4853 set_opt_count(0);
4855 set_deopt_count(0); 4854 set_deopt_count(0);
4856 code()->set_optimizable(true);
4857 } 4855 }
4858 } 4856 }
4859 4857
4860 4858
4861 bool JSFunction::IsBuiltin() { 4859 bool JSFunction::IsBuiltin() {
4862 return context()->global_object()->IsJSBuiltinsObject(); 4860 return context()->global_object()->IsJSBuiltinsObject();
4863 } 4861 }
4864 4862
4865 4863
4866 bool JSFunction::NeedsArgumentsAdaption() { 4864 bool JSFunction::NeedsArgumentsAdaption() {
(...skipping 1315 matching lines...) Expand 10 before | Expand all | Expand 10 after
6182 #undef WRITE_UINT32_FIELD 6180 #undef WRITE_UINT32_FIELD
6183 #undef READ_SHORT_FIELD 6181 #undef READ_SHORT_FIELD
6184 #undef WRITE_SHORT_FIELD 6182 #undef WRITE_SHORT_FIELD
6185 #undef READ_BYTE_FIELD 6183 #undef READ_BYTE_FIELD
6186 #undef WRITE_BYTE_FIELD 6184 #undef WRITE_BYTE_FIELD
6187 6185
6188 6186
6189 } } // namespace v8::internal 6187 } } // namespace v8::internal
6190 6188
6191 #endif // V8_OBJECTS_INL_H_ 6189 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698