OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 2971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2982 return Code::cast(READ_FIELD(this, kCodeOffset)); | 2982 return Code::cast(READ_FIELD(this, kCodeOffset)); |
2983 } | 2983 } |
2984 | 2984 |
2985 | 2985 |
2986 Code* SharedFunctionInfo::unchecked_code() { | 2986 Code* SharedFunctionInfo::unchecked_code() { |
2987 return reinterpret_cast<Code*>(READ_FIELD(this, kCodeOffset)); | 2987 return reinterpret_cast<Code*>(READ_FIELD(this, kCodeOffset)); |
2988 } | 2988 } |
2989 | 2989 |
2990 | 2990 |
2991 void SharedFunctionInfo::set_code(Code* value, WriteBarrierMode mode) { | 2991 void SharedFunctionInfo::set_code(Code* value, WriteBarrierMode mode) { |
2992 // If optimization has been disabled for the shared function info, | |
2993 // reflect that in the code object so it will not be counted as | |
2994 // optimizable code. | |
2995 ASSERT(value->kind() != Code::FUNCTION || | |
2996 !value->optimizable() || | |
2997 this->code() == Builtins::builtin(Builtins::Illegal) || | |
2998 this->allows_lazy_compilation()); | |
2999 WRITE_FIELD(this, kCodeOffset, value); | 2992 WRITE_FIELD(this, kCodeOffset, value); |
3000 CONDITIONAL_WRITE_BARRIER(this, kCodeOffset, mode); | 2993 CONDITIONAL_WRITE_BARRIER(this, kCodeOffset, mode); |
3001 } | 2994 } |
3002 | 2995 |
3003 | 2996 |
3004 SerializedScopeInfo* SharedFunctionInfo::scope_info() { | 2997 SerializedScopeInfo* SharedFunctionInfo::scope_info() { |
3005 return reinterpret_cast<SerializedScopeInfo*>( | 2998 return reinterpret_cast<SerializedScopeInfo*>( |
3006 READ_FIELD(this, kScopeInfoOffset)); | 2999 READ_FIELD(this, kScopeInfoOffset)); |
3007 } | 3000 } |
3008 | 3001 |
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3849 #undef WRITE_INT_FIELD | 3842 #undef WRITE_INT_FIELD |
3850 #undef READ_SHORT_FIELD | 3843 #undef READ_SHORT_FIELD |
3851 #undef WRITE_SHORT_FIELD | 3844 #undef WRITE_SHORT_FIELD |
3852 #undef READ_BYTE_FIELD | 3845 #undef READ_BYTE_FIELD |
3853 #undef WRITE_BYTE_FIELD | 3846 #undef WRITE_BYTE_FIELD |
3854 | 3847 |
3855 | 3848 |
3856 } } // namespace v8::internal | 3849 } } // namespace v8::internal |
3857 | 3850 |
3858 #endif // V8_OBJECTS_INL_H_ | 3851 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |