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 4284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4295 class TypeFeedbackInfo; | 4295 class TypeFeedbackInfo; |
4296 | 4296 |
4297 // Code describes objects with on-the-fly generated machine code. | 4297 // Code describes objects with on-the-fly generated machine code. |
4298 class Code: public HeapObject { | 4298 class Code: public HeapObject { |
4299 public: | 4299 public: |
4300 // Opaque data type for encapsulating code flags like kind, inline | 4300 // Opaque data type for encapsulating code flags like kind, inline |
4301 // cache state, and arguments count. | 4301 // cache state, and arguments count. |
4302 // FLAGS_MIN_VALUE and FLAGS_MAX_VALUE are specified to ensure that | 4302 // FLAGS_MIN_VALUE and FLAGS_MAX_VALUE are specified to ensure that |
4303 // enumeration type has correct value range (see Issue 830 for more details). | 4303 // enumeration type has correct value range (see Issue 830 for more details). |
4304 enum Flags { | 4304 enum Flags { |
4305 FLAGS_MIN_VALUE = kMinInt, | 4305 FLAGS_MIN_VALUE = 0, |
4306 FLAGS_MAX_VALUE = kMaxInt | 4306 FLAGS_MAX_VALUE = kMaxUInt32 |
4307 }; | 4307 }; |
4308 | 4308 |
4309 #define CODE_KIND_LIST(V) \ | 4309 #define CODE_KIND_LIST(V) \ |
4310 V(FUNCTION) \ | 4310 V(FUNCTION) \ |
4311 V(OPTIMIZED_FUNCTION) \ | 4311 V(OPTIMIZED_FUNCTION) \ |
4312 V(STUB) \ | 4312 V(STUB) \ |
4313 V(COMPILED_STUB) \ | 4313 V(COMPILED_STUB) \ |
4314 V(BUILTIN) \ | 4314 V(BUILTIN) \ |
4315 V(LOAD_IC) \ | 4315 V(LOAD_IC) \ |
4316 V(KEYED_LOAD_IC) \ | 4316 V(KEYED_LOAD_IC) \ |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4777 class StubMajorKeyField: public BitField<int, | 4777 class StubMajorKeyField: public BitField<int, |
4778 kStubMajorKeyFirstBit, kStubMajorKeyBits> {}; // NOLINT | 4778 kStubMajorKeyFirstBit, kStubMajorKeyBits> {}; // NOLINT |
4779 | 4779 |
4780 // KindSpecificFlags2 layout (FUNCTION) | 4780 // KindSpecificFlags2 layout (FUNCTION) |
4781 class StackCheckTableOffsetField: public BitField<int, 0, 31> {}; | 4781 class StackCheckTableOffsetField: public BitField<int, 0, 31> {}; |
4782 class StackCheckPatchedForOSRField: public BitField<bool, 31, 1> {}; | 4782 class StackCheckPatchedForOSRField: public BitField<bool, 31, 1> {}; |
4783 | 4783 |
4784 // Signed field cannot be encoded using the BitField class. | 4784 // Signed field cannot be encoded using the BitField class. |
4785 static const int kArgumentsCountShift = 17; | 4785 static const int kArgumentsCountShift = 17; |
4786 static const int kArgumentsCountMask = ~((1 << kArgumentsCountShift) - 1); | 4786 static const int kArgumentsCountMask = ~((1 << kArgumentsCountShift) - 1); |
| 4787 static const int kArgumentsBits = |
| 4788 PlatformSmiTagging::kSmiValueSize - Code::kArgumentsCountShift + 1; |
| 4789 static const int kMaxArguments = (1 << kArgumentsBits) - 1; |
4787 | 4790 |
4788 // This constant should be encodable in an ARM instruction. | 4791 // This constant should be encodable in an ARM instruction. |
4789 static const int kFlagsNotUsedInLookup = | 4792 static const int kFlagsNotUsedInLookup = |
4790 TypeField::kMask | CacheHolderField::kMask; | 4793 TypeField::kMask | CacheHolderField::kMask; |
4791 | 4794 |
4792 private: | 4795 private: |
4793 friend class RelocIterator; | 4796 friend class RelocIterator; |
4794 | 4797 |
4795 // Code aging | 4798 // Code aging |
4796 byte* FindCodeAgeSequence(); | 4799 byte* FindCodeAgeSequence(); |
(...skipping 4465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9262 } else { | 9265 } else { |
9263 value &= ~(1 << bit_position); | 9266 value &= ~(1 << bit_position); |
9264 } | 9267 } |
9265 return value; | 9268 return value; |
9266 } | 9269 } |
9267 }; | 9270 }; |
9268 | 9271 |
9269 } } // namespace v8::internal | 9272 } } // namespace v8::internal |
9270 | 9273 |
9271 #endif // V8_OBJECTS_H_ | 9274 #endif // V8_OBJECTS_H_ |
OLD | NEW |