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

Unified Diff: src/globals.h

Issue 1676883002: [runtime] Optimize and unify rest parameters. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: src/globals.h
diff --git a/src/globals.h b/src/globals.h
index b1ff6c5f5ddaa386e2820310f818305d15d74cb2..d1cae952a827175c5256da59362eaae411af9482 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -770,6 +770,30 @@ inline std::ostream& operator<<(std::ostream& os, TailCallMode mode) {
return os;
}
+// Defines specifics about arguments object or rest parameter creation.
+enum class CreateArgumentsType : uint8_t {
+ kMappedArguments,
+ kUnmappedArguments,
+ kRestParameter
+};
+
+inline size_t hash_value(CreateArgumentsType type) {
+ return bit_cast<uint8_t>(type);
+}
+
+inline std::ostream& operator<<(std::ostream& os, CreateArgumentsType type) {
+ switch (type) {
+ case CreateArgumentsType::kMappedArguments:
+ return os << "MAPPED_ARGUMENTS";
+ case CreateArgumentsType::kUnmappedArguments:
+ return os << "UNMAPPED_ARGUMENTS";
+ case CreateArgumentsType::kRestParameter:
+ return os << "REST_PARAMETER";
+ }
+ UNREACHABLE();
+ return os;
+}
+
// Used to specify if a macro instruction must perform a smi check on tagged
// values.
enum SmiCheckType {

Powered by Google App Engine
This is Rietveld 408576698