Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Side by Side Diff: src/objects.h

Issue 163463002: Pass in the handler kind to IC computation rather than extracting it from the handler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ic.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 5213 matching lines...) Expand 10 before | Expand all | Expand 10 after
5224 inline ByteArray* unchecked_relocation_info(); 5224 inline ByteArray* unchecked_relocation_info();
5225 5225
5226 inline int relocation_size(); 5226 inline int relocation_size();
5227 5227
5228 // [flags]: Various code flags. 5228 // [flags]: Various code flags.
5229 inline Flags flags(); 5229 inline Flags flags();
5230 inline void set_flags(Flags flags); 5230 inline void set_flags(Flags flags);
5231 5231
5232 // [flags]: Access to specific code flags. 5232 // [flags]: Access to specific code flags.
5233 inline Kind kind(); 5233 inline Kind kind();
5234 inline Kind handler_kind() {
5235 return static_cast<Kind>(arguments_count());
5236 }
5237 inline InlineCacheState ic_state(); // Only valid for IC stubs. 5234 inline InlineCacheState ic_state(); // Only valid for IC stubs.
5238 inline ExtraICState extra_ic_state(); // Only valid for IC stubs. 5235 inline ExtraICState extra_ic_state(); // Only valid for IC stubs.
5239 5236
5240 inline StubType type(); // Only valid for monomorphic IC stubs. 5237 inline StubType type(); // Only valid for monomorphic IC stubs.
5241 inline int arguments_count(); // Only valid for call IC stubs.
5242 5238
5243 // Testers for IC stub kinds. 5239 // Testers for IC stub kinds.
5244 inline bool is_inline_cache_stub(); 5240 inline bool is_inline_cache_stub();
5245 inline bool is_debug_stub(); 5241 inline bool is_debug_stub();
5246 inline bool is_handler() { return kind() == HANDLER; } 5242 inline bool is_handler() { return kind() == HANDLER; }
5247 inline bool is_load_stub() { return kind() == LOAD_IC; } 5243 inline bool is_load_stub() { return kind() == LOAD_IC; }
5248 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; } 5244 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; }
5249 inline bool is_store_stub() { return kind() == STORE_IC; } 5245 inline bool is_store_stub() { return kind() == STORE_IC; }
5250 inline bool is_keyed_store_stub() { return kind() == KEYED_STORE_IC; } 5246 inline bool is_keyed_store_stub() { return kind() == KEYED_STORE_IC; }
5251 inline bool is_binary_op_stub() { return kind() == BINARY_OP_IC; } 5247 inline bool is_binary_op_stub() { return kind() == BINARY_OP_IC; }
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
5385 ExtraICState extra_ic_state = kNoExtraICState, 5381 ExtraICState extra_ic_state = kNoExtraICState,
5386 InlineCacheHolderFlag holder = OWN_MAP, 5382 InlineCacheHolderFlag holder = OWN_MAP,
5387 StubType type = NORMAL, 5383 StubType type = NORMAL,
5388 Kind handler_kind = STUB); 5384 Kind handler_kind = STUB);
5389 5385
5390 static inline InlineCacheState ExtractICStateFromFlags(Flags flags); 5386 static inline InlineCacheState ExtractICStateFromFlags(Flags flags);
5391 static inline StubType ExtractTypeFromFlags(Flags flags); 5387 static inline StubType ExtractTypeFromFlags(Flags flags);
5392 static inline Kind ExtractKindFromFlags(Flags flags); 5388 static inline Kind ExtractKindFromFlags(Flags flags);
5393 static inline InlineCacheHolderFlag ExtractCacheHolderFromFlags(Flags flags); 5389 static inline InlineCacheHolderFlag ExtractCacheHolderFromFlags(Flags flags);
5394 static inline ExtraICState ExtractExtraICStateFromFlags(Flags flags); 5390 static inline ExtraICState ExtractExtraICStateFromFlags(Flags flags);
5395 static inline int ExtractArgumentsCountFromFlags(Flags flags);
5396 5391
5397 static inline Flags RemoveTypeFromFlags(Flags flags); 5392 static inline Flags RemoveTypeFromFlags(Flags flags);
5398 5393
5399 // Convert a target address into a code object. 5394 // Convert a target address into a code object.
5400 static inline Code* GetCodeFromTargetAddress(Address address); 5395 static inline Code* GetCodeFromTargetAddress(Address address);
5401 5396
5402 // Convert an entry address into an object. 5397 // Convert an entry address into an object.
5403 static inline Object* GetObjectFromEntryAddress(Address location_of_address); 5398 static inline Object* GetObjectFromEntryAddress(Address location_of_address);
5404 5399
5405 // Returns the address of the first instruction. 5400 // Returns the address of the first instruction.
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
5605 kSafepointTableOffsetBitCount> {}; // NOLINT 5600 kSafepointTableOffsetBitCount> {}; // NOLINT
5606 class StubMajorKeyField: public BitField<int, 5601 class StubMajorKeyField: public BitField<int,
5607 kStubMajorKeyFirstBit, kStubMajorKeyBits> {}; // NOLINT 5602 kStubMajorKeyFirstBit, kStubMajorKeyBits> {}; // NOLINT
5608 5603
5609 // KindSpecificFlags2 layout (FUNCTION) 5604 // KindSpecificFlags2 layout (FUNCTION)
5610 class BackEdgeTableOffsetField: public BitField<int, 5605 class BackEdgeTableOffsetField: public BitField<int,
5611 kIsCrankshaftedBit + 1, 29> {}; // NOLINT 5606 kIsCrankshaftedBit + 1, 29> {}; // NOLINT
5612 class BackEdgesPatchedForOSRField: public BitField<bool, 5607 class BackEdgesPatchedForOSRField: public BitField<bool,
5613 kIsCrankshaftedBit + 1 + 29, 1> {}; // NOLINT 5608 kIsCrankshaftedBit + 1 + 29, 1> {}; // NOLINT
5614 5609
5615 // Signed field cannot be encoded using the BitField class. 5610 class HandlerKindField: public BitField<Kind, 17, 4> {};
5616 static const int kArgumentsCountShift = 17; 5611
5617 static const int kArgumentsCountMask = ~((1 << kArgumentsCountShift) - 1); 5612 static const int kArgumentsBits = 16;
5618 static const int kArgumentsBits =
5619 PlatformSmiTagging::kSmiValueSize - Code::kArgumentsCountShift + 1;
5620 static const int kMaxArguments = (1 << kArgumentsBits) - 1; 5613 static const int kMaxArguments = (1 << kArgumentsBits) - 1;
5621 5614
5622 // This constant should be encodable in an ARM instruction. 5615 // This constant should be encodable in an ARM instruction.
5623 static const int kFlagsNotUsedInLookup = 5616 static const int kFlagsNotUsedInLookup =
5624 TypeField::kMask | CacheHolderField::kMask; 5617 TypeField::kMask | CacheHolderField::kMask;
5625 5618
5626 private: 5619 private:
5627 friend class RelocIterator; 5620 friend class RelocIterator;
5628 5621
5629 void ClearInlineCaches(Kind* kind); 5622 void ClearInlineCaches(Kind* kind);
(...skipping 5127 matching lines...) Expand 10 before | Expand all | Expand 10 after
10757 } else { 10750 } else {
10758 value &= ~(1 << bit_position); 10751 value &= ~(1 << bit_position);
10759 } 10752 }
10760 return value; 10753 return value;
10761 } 10754 }
10762 }; 10755 };
10763 10756
10764 } } // namespace v8::internal 10757 } } // namespace v8::internal
10765 10758
10766 #endif // V8_OBJECTS_H_ 10759 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/ic.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698