| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // Review notes: | 5 // Review notes: |
| 6 // | 6 // |
| 7 // - The use of macros in these inline functions may seem superfluous | 7 // - The use of macros in these inline functions may seem superfluous |
| 8 // but it is absolutely needed to make sure gcc generates optimal | 8 // but it is absolutely needed to make sure gcc generates optimal |
| 9 // code. gcc is not happy when attempting to inline too deep. | 9 // code. gcc is not happy when attempting to inline too deep. |
| 10 // | 10 // |
| (...skipping 6226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6237 } | 6237 } |
| 6238 | 6238 |
| 6239 | 6239 |
| 6240 Code* SharedFunctionInfo::code() const { | 6240 Code* SharedFunctionInfo::code() const { |
| 6241 return Code::cast(READ_FIELD(this, kCodeOffset)); | 6241 return Code::cast(READ_FIELD(this, kCodeOffset)); |
| 6242 } | 6242 } |
| 6243 | 6243 |
| 6244 | 6244 |
| 6245 void SharedFunctionInfo::set_code(Code* value, WriteBarrierMode mode) { | 6245 void SharedFunctionInfo::set_code(Code* value, WriteBarrierMode mode) { |
| 6246 DCHECK(value->kind() != Code::OPTIMIZED_FUNCTION); | 6246 DCHECK(value->kind() != Code::OPTIMIZED_FUNCTION); |
| 6247 // If the SharedFunctionInfo has bytecode we should never mark it for lazy |
| 6248 // compile, since the bytecode is never flushed. |
| 6249 DCHECK(value != GetIsolate()->builtins()->builtin(Builtins::kCompileLazy) || |
| 6250 !HasBytecodeArray()); |
| 6247 WRITE_FIELD(this, kCodeOffset, value); | 6251 WRITE_FIELD(this, kCodeOffset, value); |
| 6248 CONDITIONAL_WRITE_BARRIER(value->GetHeap(), this, kCodeOffset, value, mode); | 6252 CONDITIONAL_WRITE_BARRIER(value->GetHeap(), this, kCodeOffset, value, mode); |
| 6249 } | 6253 } |
| 6250 | 6254 |
| 6251 | 6255 |
| 6252 void SharedFunctionInfo::ReplaceCode(Code* value) { | 6256 void SharedFunctionInfo::ReplaceCode(Code* value) { |
| 6253 // If the GC metadata field is already used then the function was | 6257 // If the GC metadata field is already used then the function was |
| 6254 // enqueued as a code flushing candidate and we remove it now. | 6258 // enqueued as a code flushing candidate and we remove it now. |
| 6255 if (code()->gc_metadata() != NULL) { | 6259 if (code()->gc_metadata() != NULL) { |
| 6256 CodeFlusher* flusher = GetHeap()->mark_compact_collector()->code_flusher(); | 6260 CodeFlusher* flusher = GetHeap()->mark_compact_collector()->code_flusher(); |
| (...skipping 2184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8441 #undef WRITE_INT64_FIELD | 8445 #undef WRITE_INT64_FIELD |
| 8442 #undef READ_BYTE_FIELD | 8446 #undef READ_BYTE_FIELD |
| 8443 #undef WRITE_BYTE_FIELD | 8447 #undef WRITE_BYTE_FIELD |
| 8444 #undef NOBARRIER_READ_BYTE_FIELD | 8448 #undef NOBARRIER_READ_BYTE_FIELD |
| 8445 #undef NOBARRIER_WRITE_BYTE_FIELD | 8449 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 8446 | 8450 |
| 8447 } // namespace internal | 8451 } // namespace internal |
| 8448 } // namespace v8 | 8452 } // namespace v8 |
| 8449 | 8453 |
| 8450 #endif // V8_OBJECTS_INL_H_ | 8454 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |