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 6134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6145 void Code::set_type_feedback_info(Object* value, WriteBarrierMode mode) { | 6145 void Code::set_type_feedback_info(Object* value, WriteBarrierMode mode) { |
6146 ASSERT(kind() == FUNCTION); | 6146 ASSERT(kind() == FUNCTION); |
6147 set_raw_type_feedback_info(value, mode); | 6147 set_raw_type_feedback_info(value, mode); |
6148 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kTypeFeedbackInfoOffset, | 6148 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kTypeFeedbackInfoOffset, |
6149 value, mode); | 6149 value, mode); |
6150 } | 6150 } |
6151 | 6151 |
6152 | 6152 |
6153 uint32_t Code::stub_key() { | 6153 uint32_t Code::stub_key() { |
6154 ASSERT(IsCodeStubOrIC()); | 6154 ASSERT(IsCodeStubOrIC()); |
6155 return Smi::cast(raw_type_feedback_info())->value() - Smi::kMinValue; | 6155 Smi* smi_key = Smi::cast(raw_type_feedback_info()); |
| 6156 return static_cast<uint32_t>(smi_key->value()); |
6156 } | 6157 } |
6157 | 6158 |
6158 | 6159 |
6159 void Code::set_stub_key(uint32_t key) { | 6160 void Code::set_stub_key(uint32_t key) { |
6160 ASSERT(IsCodeStubOrIC()); | 6161 ASSERT(IsCodeStubOrIC()); |
6161 set_raw_type_feedback_info(Smi::FromInt(key + Smi::kMinValue)); | 6162 set_raw_type_feedback_info(Smi::FromInt(key)); |
6162 } | 6163 } |
6163 | 6164 |
6164 | 6165 |
6165 ACCESSORS(Code, gc_metadata, Object, kGCMetadataOffset) | 6166 ACCESSORS(Code, gc_metadata, Object, kGCMetadataOffset) |
6166 INT_ACCESSORS(Code, ic_age, kICAgeOffset) | 6167 INT_ACCESSORS(Code, ic_age, kICAgeOffset) |
6167 | 6168 |
6168 | 6169 |
6169 byte* Code::instruction_start() { | 6170 byte* Code::instruction_start() { |
6170 return FIELD_ADDR(this, kHeaderSize); | 6171 return FIELD_ADDR(this, kHeaderSize); |
6171 } | 6172 } |
(...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7228 #undef READ_SHORT_FIELD | 7229 #undef READ_SHORT_FIELD |
7229 #undef WRITE_SHORT_FIELD | 7230 #undef WRITE_SHORT_FIELD |
7230 #undef READ_BYTE_FIELD | 7231 #undef READ_BYTE_FIELD |
7231 #undef WRITE_BYTE_FIELD | 7232 #undef WRITE_BYTE_FIELD |
7232 #undef NOBARRIER_READ_BYTE_FIELD | 7233 #undef NOBARRIER_READ_BYTE_FIELD |
7233 #undef NOBARRIER_WRITE_BYTE_FIELD | 7234 #undef NOBARRIER_WRITE_BYTE_FIELD |
7234 | 7235 |
7235 } } // namespace v8::internal | 7236 } } // namespace v8::internal |
7236 | 7237 |
7237 #endif // V8_OBJECTS_INL_H_ | 7238 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |