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

Side by Side Diff: src/utils.h

Issue 14862009: Encapsulating Type information in the CompareICStub (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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/type-info.cc ('k') | test/cctest/cctest.gyp » ('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 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after
1023 return (bits_ & set.bits_) != 0; 1023 return (bits_ & set.bits_) != 0;
1024 } 1024 }
1025 void Add(E element) { bits_ |= Mask(element); } 1025 void Add(E element) { bits_ |= Mask(element); }
1026 void Add(const EnumSet& set) { bits_ |= set.bits_; } 1026 void Add(const EnumSet& set) { bits_ |= set.bits_; }
1027 void Remove(E element) { bits_ &= ~Mask(element); } 1027 void Remove(E element) { bits_ &= ~Mask(element); }
1028 void Remove(const EnumSet& set) { bits_ &= ~set.bits_; } 1028 void Remove(const EnumSet& set) { bits_ &= ~set.bits_; }
1029 void RemoveAll() { bits_ = 0; } 1029 void RemoveAll() { bits_ = 0; }
1030 void Intersect(const EnumSet& set) { bits_ &= set.bits_; } 1030 void Intersect(const EnumSet& set) { bits_ &= set.bits_; }
1031 T ToIntegral() const { return bits_; } 1031 T ToIntegral() const { return bits_; }
1032 bool operator==(const EnumSet& set) { return bits_ == set.bits_; } 1032 bool operator==(const EnumSet& set) { return bits_ == set.bits_; }
1033 bool operator!=(const EnumSet& set) { return bits_ != set.bits_; }
1033 EnumSet<E, T> operator|(const EnumSet& set) const { 1034 EnumSet<E, T> operator|(const EnumSet& set) const {
1034 return EnumSet<E, T>(bits_ | set.bits_); 1035 return EnumSet<E, T>(bits_ | set.bits_);
1035 } 1036 }
1036 1037
1037 private: 1038 private:
1038 T Mask(E element) const { 1039 T Mask(E element) const {
1039 // The strange typing in ASSERT is necessary to avoid stupid warnings, see: 1040 // The strange typing in ASSERT is necessary to avoid stupid warnings, see:
1040 // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43680 1041 // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43680
1041 ASSERT(static_cast<int>(element) < static_cast<int>(sizeof(T) * CHAR_BIT)); 1042 ASSERT(static_cast<int>(element) < static_cast<int>(sizeof(T) * CHAR_BIT));
1042 return 1 << element; 1043 return 1 << element;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
1091 1092
1092 // Every compiled stub starts with this id. 1093 // Every compiled stub starts with this id.
1093 static const int kStubEntryId = 5; 1094 static const int kStubEntryId = 5;
1094 1095
1095 int id_; 1096 int id_;
1096 }; 1097 };
1097 1098
1098 } } // namespace v8::internal 1099 } } // namespace v8::internal
1099 1100
1100 #endif // V8_UTILS_H_ 1101 #endif // V8_UTILS_H_
OLDNEW
« no previous file with comments | « src/type-info.cc ('k') | test/cctest/cctest.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698