| 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 4883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4894 } | 4894 } |
| 4895 | 4895 |
| 4896 | 4896 |
| 4897 bool JSFunction::IsInRecompileQueue() { | 4897 bool JSFunction::IsInRecompileQueue() { |
| 4898 return code() == GetIsolate()->builtins()->builtin( | 4898 return code() == GetIsolate()->builtins()->builtin( |
| 4899 Builtins::kInRecompileQueue); | 4899 Builtins::kInRecompileQueue); |
| 4900 } | 4900 } |
| 4901 | 4901 |
| 4902 | 4902 |
| 4903 Code* JSFunction::code() { | 4903 Code* JSFunction::code() { |
| 4904 return Code::cast(unchecked_code()); | 4904 return Code::cast( |
| 4905 } | |
| 4906 | |
| 4907 | |
| 4908 Code* JSFunction::unchecked_code() { | |
| 4909 return reinterpret_cast<Code*>( | |
| 4910 Code::GetObjectFromEntryAddress(FIELD_ADDR(this, kCodeEntryOffset))); | 4905 Code::GetObjectFromEntryAddress(FIELD_ADDR(this, kCodeEntryOffset))); |
| 4911 } | 4906 } |
| 4912 | 4907 |
| 4913 | 4908 |
| 4914 void JSFunction::set_code(Code* value) { | 4909 void JSFunction::set_code(Code* value) { |
| 4915 ASSERT(!HEAP->InNewSpace(value)); | 4910 ASSERT(!HEAP->InNewSpace(value)); |
| 4916 Address entry = value->entry(); | 4911 Address entry = value->entry(); |
| 4917 WRITE_INTPTR_FIELD(this, kCodeEntryOffset, reinterpret_cast<intptr_t>(entry)); | 4912 WRITE_INTPTR_FIELD(this, kCodeEntryOffset, reinterpret_cast<intptr_t>(entry)); |
| 4918 GetHeap()->incremental_marking()->RecordWriteOfCodeEntry( | 4913 GetHeap()->incremental_marking()->RecordWriteOfCodeEntry( |
| 4919 this, | 4914 this, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 4944 context()->native_context()->RemoveOptimizedFunction(this); | 4939 context()->native_context()->RemoveOptimizedFunction(this); |
| 4945 } | 4940 } |
| 4946 } | 4941 } |
| 4947 | 4942 |
| 4948 | 4943 |
| 4949 Context* JSFunction::context() { | 4944 Context* JSFunction::context() { |
| 4950 return Context::cast(READ_FIELD(this, kContextOffset)); | 4945 return Context::cast(READ_FIELD(this, kContextOffset)); |
| 4951 } | 4946 } |
| 4952 | 4947 |
| 4953 | 4948 |
| 4954 Object* JSFunction::unchecked_context() { | |
| 4955 return READ_FIELD(this, kContextOffset); | |
| 4956 } | |
| 4957 | |
| 4958 | |
| 4959 void JSFunction::set_context(Object* value) { | 4949 void JSFunction::set_context(Object* value) { |
| 4960 ASSERT(value->IsUndefined() || value->IsContext()); | 4950 ASSERT(value->IsUndefined() || value->IsContext()); |
| 4961 WRITE_FIELD(this, kContextOffset, value); | 4951 WRITE_FIELD(this, kContextOffset, value); |
| 4962 WRITE_BARRIER(GetHeap(), this, kContextOffset, value); | 4952 WRITE_BARRIER(GetHeap(), this, kContextOffset, value); |
| 4963 } | 4953 } |
| 4964 | 4954 |
| 4965 ACCESSORS(JSFunction, prototype_or_initial_map, Object, | 4955 ACCESSORS(JSFunction, prototype_or_initial_map, Object, |
| 4966 kPrototypeOrInitialMapOffset) | 4956 kPrototypeOrInitialMapOffset) |
| 4967 | 4957 |
| 4968 | 4958 |
| (...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6190 #undef WRITE_UINT32_FIELD | 6180 #undef WRITE_UINT32_FIELD |
| 6191 #undef READ_SHORT_FIELD | 6181 #undef READ_SHORT_FIELD |
| 6192 #undef WRITE_SHORT_FIELD | 6182 #undef WRITE_SHORT_FIELD |
| 6193 #undef READ_BYTE_FIELD | 6183 #undef READ_BYTE_FIELD |
| 6194 #undef WRITE_BYTE_FIELD | 6184 #undef WRITE_BYTE_FIELD |
| 6195 | 6185 |
| 6196 | 6186 |
| 6197 } } // namespace v8::internal | 6187 } } // namespace v8::internal |
| 6198 | 6188 |
| 6199 #endif // V8_OBJECTS_INL_H_ | 6189 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |