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

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

Issue 8700008: New approach to Crankshaft decision-making (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix snapshot build and memory leaks Created 9 years 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
OLDNEW
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 3670 matching lines...) Expand 10 before | Expand all | Expand 10 after
3681 Smi* SharedFunctionInfo::deopt_counter() { 3681 Smi* SharedFunctionInfo::deopt_counter() {
3682 return reinterpret_cast<Smi*>(READ_FIELD(this, kDeoptCounterOffset)); 3682 return reinterpret_cast<Smi*>(READ_FIELD(this, kDeoptCounterOffset));
3683 } 3683 }
3684 3684
3685 3685
3686 void SharedFunctionInfo::set_deopt_counter(Smi* value) { 3686 void SharedFunctionInfo::set_deopt_counter(Smi* value) {
3687 WRITE_FIELD(this, kDeoptCounterOffset, value); 3687 WRITE_FIELD(this, kDeoptCounterOffset, value);
3688 } 3688 }
3689 3689
3690 3690
3691 SMI_ACCESSORS(SharedFunctionInfo, call_counter, kCallCounterOffset)
3692
3693
3691 bool SharedFunctionInfo::is_compiled() { 3694 bool SharedFunctionInfo::is_compiled() {
3692 return code() != 3695 return code() !=
3693 Isolate::Current()->builtins()->builtin(Builtins::kLazyCompile); 3696 Isolate::Current()->builtins()->builtin(Builtins::kLazyCompile);
3694 } 3697 }
3695 3698
3696 3699
3697 bool SharedFunctionInfo::IsApiFunction() { 3700 bool SharedFunctionInfo::IsApiFunction() {
3698 return function_data()->IsFunctionTemplateInfo(); 3701 return function_data()->IsFunctionTemplateInfo();
3699 } 3702 }
3700 3703
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
3787 3790
3788 set_code(code); 3791 set_code(code);
3789 3792
3790 // Add/remove the function from the list of optimized functions for this 3793 // Add/remove the function from the list of optimized functions for this
3791 // context based on the state change. 3794 // context based on the state change.
3792 if (!was_optimized && is_optimized) { 3795 if (!was_optimized && is_optimized) {
3793 context()->global_context()->AddOptimizedFunction(this); 3796 context()->global_context()->AddOptimizedFunction(this);
3794 } 3797 }
3795 if (was_optimized && !is_optimized) { 3798 if (was_optimized && !is_optimized) {
3796 context()->global_context()->RemoveOptimizedFunction(this); 3799 context()->global_context()->RemoveOptimizedFunction(this);
3800 shared()->set_call_counter(
3801 SharedFunctionInfo::kCallsUntilPrimitiveOptimization);
3797 } 3802 }
3798 } 3803 }
3799 3804
3800 3805
3801 Context* JSFunction::context() { 3806 Context* JSFunction::context() {
3802 return Context::cast(READ_FIELD(this, kContextOffset)); 3807 return Context::cast(READ_FIELD(this, kContextOffset));
3803 } 3808 }
3804 3809
3805 3810
3806 Object* JSFunction::unchecked_context() { 3811 Object* JSFunction::unchecked_context() {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
3869 bool JSFunction::should_have_prototype() { 3874 bool JSFunction::should_have_prototype() {
3870 return map()->function_with_prototype(); 3875 return map()->function_with_prototype();
3871 } 3876 }
3872 3877
3873 3878
3874 bool JSFunction::is_compiled() { 3879 bool JSFunction::is_compiled() {
3875 return code() != GetIsolate()->builtins()->builtin(Builtins::kLazyCompile); 3880 return code() != GetIsolate()->builtins()->builtin(Builtins::kLazyCompile);
3876 } 3881 }
3877 3882
3878 3883
3884 SMI_ACCESSORS(JSFunction, profiler_ticks, kProfilerTicksOffset)
3885
3886
3879 FixedArray* JSFunction::literals() { 3887 FixedArray* JSFunction::literals() {
3880 ASSERT(!shared()->bound()); 3888 ASSERT(!shared()->bound());
3881 return literals_or_bindings(); 3889 return literals_or_bindings();
3882 } 3890 }
3883 3891
3884 3892
3885 void JSFunction::set_literals(FixedArray* literals) { 3893 void JSFunction::set_literals(FixedArray* literals) {
3886 ASSERT(!shared()->bound()); 3894 ASSERT(!shared()->bound());
3887 set_literals_or_bindings(literals); 3895 set_literals_or_bindings(literals);
3888 } 3896 }
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
4719 #undef WRITE_INT_FIELD 4727 #undef WRITE_INT_FIELD
4720 #undef READ_SHORT_FIELD 4728 #undef READ_SHORT_FIELD
4721 #undef WRITE_SHORT_FIELD 4729 #undef WRITE_SHORT_FIELD
4722 #undef READ_BYTE_FIELD 4730 #undef READ_BYTE_FIELD
4723 #undef WRITE_BYTE_FIELD 4731 #undef WRITE_BYTE_FIELD
4724 4732
4725 4733
4726 } } // namespace v8::internal 4734 } } // namespace v8::internal
4727 4735
4728 #endif // V8_OBJECTS_INL_H_ 4736 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/platform.h » ('j') | src/platform-linux.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698