Chromium Code Reviews| 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 5730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5741 } | 5741 } |
| 5742 | 5742 |
| 5743 | 5743 |
| 5744 void SharedFunctionInfo::set_kind(FunctionKind kind) { | 5744 void SharedFunctionInfo::set_kind(FunctionKind kind) { |
| 5745 DCHECK(IsValidFunctionKind(kind)); | 5745 DCHECK(IsValidFunctionKind(kind)); |
| 5746 int hints = compiler_hints(); | 5746 int hints = compiler_hints(); |
| 5747 hints = FunctionKindBits::update(hints, kind); | 5747 hints = FunctionKindBits::update(hints, kind); |
| 5748 set_compiler_hints(hints); | 5748 set_compiler_hints(hints); |
| 5749 } | 5749 } |
| 5750 | 5750 |
| 5751 // static | |
| 5752 int SharedFunctionInfo::OffsetToPreviousContext() { | |
| 5753 return FixedArray::kHeaderSize + | |
|
Michael Starzinger
2016/04/08 12:44:02
These can all be statically computed, can we make
mvstanton
2016/04/11 13:36:14
Absolutely, much better, done.
| |
| 5754 kPointerSize * (kContextOffset - kEntryLength); | |
| 5755 } | |
| 5756 | |
| 5757 int SharedFunctionInfo::OffsetToPreviousCachedCode() { | |
| 5758 return FixedArray::kHeaderSize + | |
| 5759 kPointerSize * (kCachedCodeOffset - kEntryLength); | |
| 5760 } | |
| 5761 | |
| 5762 int SharedFunctionInfo::OffsetToPreviousLiterals() { | |
| 5763 return FixedArray::kHeaderSize + | |
| 5764 kPointerSize * (kLiteralsOffset - kEntryLength); | |
| 5765 } | |
| 5766 | |
| 5767 int SharedFunctionInfo::OffsetToPreviousOsrAstId() { | |
| 5768 return FixedArray::kHeaderSize + | |
| 5769 kPointerSize * (kOsrAstIdOffset - kEntryLength); | |
| 5770 } | |
| 5751 | 5771 |
| 5752 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, needs_home_object, | 5772 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, needs_home_object, |
| 5753 kNeedsHomeObject) | 5773 kNeedsHomeObject) |
| 5754 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, native, kNative) | 5774 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, native, kNative) |
| 5755 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, force_inline, kForceInline) | 5775 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, force_inline, kForceInline) |
| 5756 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, | 5776 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, |
| 5757 name_should_print_as_anonymous, | 5777 name_should_print_as_anonymous, |
| 5758 kNameShouldPrintAsAnonymous) | 5778 kNameShouldPrintAsAnonymous) |
| 5759 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_anonymous_expression, | 5779 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_anonymous_expression, |
| 5760 kIsAnonymousExpression) | 5780 kIsAnonymousExpression) |
| (...skipping 2041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7802 #undef WRITE_INT64_FIELD | 7822 #undef WRITE_INT64_FIELD |
| 7803 #undef READ_BYTE_FIELD | 7823 #undef READ_BYTE_FIELD |
| 7804 #undef WRITE_BYTE_FIELD | 7824 #undef WRITE_BYTE_FIELD |
| 7805 #undef NOBARRIER_READ_BYTE_FIELD | 7825 #undef NOBARRIER_READ_BYTE_FIELD |
| 7806 #undef NOBARRIER_WRITE_BYTE_FIELD | 7826 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 7807 | 7827 |
| 7808 } // namespace internal | 7828 } // namespace internal |
| 7809 } // namespace v8 | 7829 } // namespace v8 |
| 7810 | 7830 |
| 7811 #endif // V8_OBJECTS_INL_H_ | 7831 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |