-
Notifications
You must be signed in to change notification settings - Fork 818
Performance optimizations for Type #2733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,7 +92,7 @@ void Type::init(const std::vector<Type>& types) { | |
} | ||
#endif | ||
|
||
if (types.size() >= unknownSize) { | ||
if (types.size() >= UNKNOWN_SIZE) { | ||
WASM_UNREACHABLE("Type too large"); | ||
} | ||
_size = types.size(); | ||
|
@@ -120,7 +120,7 @@ void Type::init(const std::vector<Type>& types) { | |
if (lookup()) { | ||
return; | ||
} | ||
if (typeLists.size() >= (1 << (32 - sizeBits))) { | ||
if (typeLists.size() >= (1 << (ID_BITS))) { | ||
WASM_UNREACHABLE("Too many types!"); | ||
} | ||
id = typeLists.size(); | ||
|
@@ -134,14 +134,14 @@ Type::Type(std::initializer_list<Type> types) { init(types); } | |
Type::Type(const std::vector<Type>& types) { init(types); } | ||
|
||
size_t Type::size() { | ||
if (_size == unknownSize) { | ||
if (_size == UNKNOWN_SIZE) { | ||
_size = expand().size(); | ||
} | ||
return _size; | ||
} | ||
|
||
size_t Type::size() const { | ||
if (_size == unknownSize) { | ||
if (_size == UNKNOWN_SIZE) { | ||
return expand().size(); | ||
|
||
} | ||
return _size; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra unnecessary parens here around
ID_BITS