Bug 1518711 - Rename BigInt's ParseNodeKind to match the declaration from bug 1513040. r=jorendorff
authorRobin Templeton <robin@igalia.com>
Wed, 09 Jan 2019 19:14:40 +0000
changeset 510253 5c70351492dab61461ac07609bfb75ca7da405b0
parent 510252 68dc096dab039ddc824d285c6511b033abd2b6c3
child 510254 3b5346cfb6c89c15f8ccdaa08e304f4ecc21dad1
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs1518711, 1513040
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1518711 - Rename BigInt's ParseNodeKind to match the declaration from bug 1513040. r=jorendorff Differential Revision: https://phabricator.services.mozilla.com/D16008
js/src/builtin/ReflectParse.cpp
js/src/frontend/BytecodeEmitter.cpp
js/src/frontend/FoldConstants.cpp
js/src/frontend/NameFunctions.cpp
js/src/frontend/ParseNode.h
--- a/js/src/builtin/ReflectParse.cpp
+++ b/js/src/builtin/ReflectParse.cpp
@@ -3121,17 +3121,17 @@ bool ASTSerializer::literal(ParseNode* p
       break;
     }
 
     case ParseNodeKind::NumberExpr:
       val.setNumber(pn->as<NumericLiteral>().value());
       break;
 
 #ifdef ENABLE_BIGINT
-    case ParseNodeKind::BigInt: {
+    case ParseNodeKind::BigIntExpr: {
       BigInt* x = pn->as<BigIntLiteral>().box()->value();
       cx->check(x);
       val.setBigInt(x);
       break;
     }
 #endif
 
     case ParseNodeKind::NullExpr:
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -962,17 +962,17 @@ restart:
       return true;
 
     case ParseNodeKind::NumberExpr:
       MOZ_ASSERT(pn->is<NumericLiteral>());
       *answer = false;
       return true;
 
 #ifdef ENABLE_BIGINT
-    case ParseNodeKind::BigInt:
+    case ParseNodeKind::BigIntExpr:
       MOZ_ASSERT(pn->is<BigIntLiteral>());
       *answer = false;
       return true;
 #endif
 
     // |this| can throw in derived class constructors, including nested arrow
     // functions or eval.
     case ParseNodeKind::ThisExpr:
@@ -4237,17 +4237,17 @@ bool ParseNode::getConstantValue(JSConte
                                  size_t ncompare, NewObjectKind newKind) {
   MOZ_ASSERT(newKind == TenuredObject || newKind == SingletonObject);
 
   switch (getKind()) {
     case ParseNodeKind::NumberExpr:
       vp.setNumber(as<NumericLiteral>().value());
       return true;
 #ifdef ENABLE_BIGINT
-    case ParseNodeKind::BigInt:
+    case ParseNodeKind::BigIntExpr:
       vp.setBigInt(as<BigIntLiteral>().box()->value());
       return true;
 #endif
     case ParseNodeKind::TemplateStringExpr:
     case ParseNodeKind::StringExpr:
       vp.setString(as<NameNode>().atom());
       return true;
     case ParseNodeKind::TrueExpr:
@@ -9162,17 +9162,17 @@ bool BytecodeEmitter::emitTree(
 
     case ParseNodeKind::NumberExpr:
       if (!emitNumberOp(pn->as<NumericLiteral>().value())) {
         return false;
       }
       break;
 
 #ifdef ENABLE_BIGINT
-    case ParseNodeKind::BigInt:
+    case ParseNodeKind::BigIntExpr:
       if (!emitBigIntOp(pn->as<BigIntLiteral>().box()->value())) {
         return false;
       }
       break;
 #endif
 
     case ParseNodeKind::RegExpExpr:
       if (!emitRegExp(objectList.add(pn->as<RegExpLiteral>().objbox()))) {
--- a/js/src/frontend/FoldConstants.cpp
+++ b/js/src/frontend/FoldConstants.cpp
@@ -381,17 +381,17 @@ restart:
     case ParseNodeKind::TrueExpr:
     case ParseNodeKind::FalseExpr:
     case ParseNodeKind::NullExpr:
     case ParseNodeKind::RawUndefinedExpr:
     case ParseNodeKind::ThisExpr:
     case ParseNodeKind::Elision:
     case ParseNodeKind::NumberExpr:
 #ifdef ENABLE_BIGINT
-    case ParseNodeKind::BigInt:
+    case ParseNodeKind::BigIntExpr:
 #endif
     case ParseNodeKind::NewExpr:
     case ParseNodeKind::Generator:
     case ParseNodeKind::ParamsBody:
     case ParseNodeKind::Catch:
     case ParseNodeKind::ForIn:
     case ParseNodeKind::ForOf:
     case ParseNodeKind::ForHead:
@@ -463,17 +463,17 @@ static bool FoldType(JSContext* cx, Pars
 
 static bool IsEffectless(ParseNode* node) {
   return node->isKind(ParseNodeKind::TrueExpr) ||
          node->isKind(ParseNodeKind::FalseExpr) ||
          node->isKind(ParseNodeKind::StringExpr) ||
          node->isKind(ParseNodeKind::TemplateStringExpr) ||
          node->isKind(ParseNodeKind::NumberExpr) ||
 #ifdef ENABLE_BIGINT
-         node->isKind(ParseNodeKind::BigInt) ||
+         node->isKind(ParseNodeKind::BigIntExpr) ||
 #endif
          node->isKind(ParseNodeKind::NullExpr) ||
          node->isKind(ParseNodeKind::RawUndefinedExpr) ||
          node->isKind(ParseNodeKind::Function);
 }
 
 enum Truthiness { Truthy, Falsy, Unknown };
 
@@ -481,17 +481,17 @@ static Truthiness Boolish(ParseNode* pn)
   switch (pn->getKind()) {
     case ParseNodeKind::NumberExpr:
       return (pn->as<NumericLiteral>().value() != 0 &&
               !IsNaN(pn->as<NumericLiteral>().value()))
                  ? Truthy
                  : Falsy;
 
 #ifdef ENABLE_BIGINT
-    case ParseNodeKind::BigInt:
+    case ParseNodeKind::BigIntExpr:
       return (pn->as<BigIntLiteral>().box()->value()->toBoolean()) ? Truthy
                                                                    : Falsy;
 #endif
 
     case ParseNodeKind::StringExpr:
     case ParseNodeKind::TemplateStringExpr:
       return (pn->as<NameNode>().atom()->length() > 0) ? Truthy : Falsy;
 
@@ -557,17 +557,17 @@ static bool FoldTypeOfExpr(JSContext* cx
   RootedPropertyName result(cx);
   if (expr->isKind(ParseNodeKind::StringExpr) ||
       expr->isKind(ParseNodeKind::TemplateStringExpr)) {
     result = cx->names().string;
   } else if (expr->isKind(ParseNodeKind::NumberExpr)) {
     result = cx->names().number;
   }
 #ifdef ENABLE_BIGINT
-  else if (expr->isKind(ParseNodeKind::BigInt)) {
+  else if (expr->isKind(ParseNodeKind::BigIntExpr)) {
     result = cx->names().bigint;
   }
 #endif
   else if (expr->isKind(ParseNodeKind::NullExpr)) {
     result = cx->names().object;
   } else if (expr->isKind(ParseNodeKind::TrueExpr) ||
              expr->isKind(ParseNodeKind::FalseExpr)) {
     result = cx->names().boolean;
--- a/js/src/frontend/NameFunctions.cpp
+++ b/js/src/frontend/NameFunctions.cpp
@@ -463,17 +463,17 @@ class NameResolver {
         MOZ_ASSERT(cur->is<RegExpLiteral>());
         break;
 
       case ParseNodeKind::NumberExpr:
         MOZ_ASSERT(cur->is<NumericLiteral>());
         break;
 
 #ifdef ENABLE_BIGINT
-      case ParseNodeKind::BigInt:
+      case ParseNodeKind::BigIntExpr:
         MOZ_ASSERT(cur->is<BigIntLiteral>());
         break;
 #endif
 
       case ParseNodeKind::TypeOfNameExpr:
       case ParseNodeKind::SuperBase:
         MOZ_ASSERT(cur->as<UnaryNode>().kid()->isKind(ParseNodeKind::Name));
         MOZ_ASSERT(!cur->as<UnaryNode>().kid()->as<NameNode>().initializer());
--- a/js/src/frontend/ParseNode.h
+++ b/js/src/frontend/ParseNode.h
@@ -1540,22 +1540,22 @@ class NumericLiteral : public ParseNode 
 
   void setDecimalPoint(DecimalPoint d) { pn_u.number.decimalPoint = d; }
 };
 
 #ifdef ENABLE_BIGINT
 class BigIntLiteral : public ParseNode {
  public:
   BigIntLiteral(BigIntBox* bibox, const TokenPos& pos)
-      : ParseNode(ParseNodeKind::BigInt, JSOP_NOP, pos) {
+      : ParseNode(ParseNodeKind::BigIntExpr, JSOP_NOP, pos) {
     pn_u.bigint.box = bibox;
   }
 
   static bool test(const ParseNode& node) {
-    bool match = node.isKind(ParseNodeKind::BigInt);
+    bool match = node.isKind(ParseNodeKind::BigIntExpr);
     MOZ_ASSERT_IF(match, node.isArity(PN_BIGINT));
     return match;
   }
 
   static constexpr ParseNodeArity arity() { return PN_BIGINT; }
 
   template <typename Visitor>
   bool accept(Visitor& visitor) {