Bug 1518661 - Part 1: Pass PropertyName* directly instead of creating ID. r=jimb,jorendorff
authorLogan Smyth <loganfsmyth@gmail.com>
Wed, 13 Feb 2019 02:54:57 +0000
changeset 458847 b7f9a1180f23
parent 458846 bc69bea83b66
child 458848 fde198422591
push id35548
push useropoprus@mozilla.com
push dateWed, 13 Feb 2019 09:48:26 +0000
treeherdermozilla-central@93e37c529818 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimb, jorendorff
bugs1518661
milestone67.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 1518661 - Part 1: Pass PropertyName* directly instead of creating ID. r=jimb,jorendorff This is just a bit of cleanup I'd noticed while writing new implementations of these. Differential Revision: https://phabricator.services.mozilla.com/D17659
js/src/vm/Debugger.cpp
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -6406,19 +6406,18 @@ class DebuggerScriptGetOffsetLocationMat
       lineno = r.frontLineNumber();
       column = r.frontColumnNumber();
     } else {
       MOZ_ASSERT(flowData[r.frontOffset()].hasSingleEdge());
       lineno = flowData[r.frontOffset()].lineno();
       column = flowData[r.frontOffset()].column();
     }
 
-    RootedId id(cx_, NameToId(cx_->names().lineNumber));
     RootedValue value(cx_, NumberValue(lineno));
-    if (!DefineDataProperty(cx_, result_, id, value)) {
+    if (!DefineDataProperty(cx_, result_, cx_->names().lineNumber, value)) {
       return false;
     }
 
     value = NumberValue(column);
     if (!DefineDataProperty(cx_, result_, cx_->names().columnNumber, value)) {
       return false;
     }
 
@@ -6456,19 +6455,18 @@ class DebuggerScriptGetOffsetLocationMat
       return false;
     }
 
     result_.set(NewBuiltinClassInstance<PlainObject>(cx_));
     if (!result_) {
       return false;
     }
 
-    RootedId id(cx_, NameToId(cx_->names().lineNumber));
     RootedValue value(cx_, NumberValue(lineno));
-    if (!DefineDataProperty(cx_, result_, id, value)) {
+    if (!DefineDataProperty(cx_, result_, cx_->names().lineNumber, value)) {
       return false;
     }
 
     value = NumberValue(column);
     if (!DefineDataProperty(cx_, result_, cx_->names().columnNumber, value)) {
       return false;
     }
 
@@ -6676,30 +6674,28 @@ class DebuggerScriptGetAllColumnOffsetsM
   MutableHandleObject result_;
 
   bool appendColumnOffsetEntry(size_t lineno, size_t column, size_t offset) {
     RootedPlainObject entry(cx_, NewBuiltinClassInstance<PlainObject>(cx_));
     if (!entry) {
       return false;
     }
 
-    RootedId id(cx_, NameToId(cx_->names().lineNumber));
     RootedValue value(cx_, NumberValue(lineno));
-    if (!DefineDataProperty(cx_, entry, id, value)) {
+    if (!DefineDataProperty(cx_, entry, cx_->names().lineNumber, value)) {
       return false;
     }
 
     value = NumberValue(column);
     if (!DefineDataProperty(cx_, entry, cx_->names().columnNumber, value)) {
       return false;
     }
 
-    id = NameToId(cx_->names().offset);
     value = NumberValue(offset);
-    if (!DefineDataProperty(cx_, entry, id, value)) {
+    if (!DefineDataProperty(cx_, entry, cx_->names().offset, value)) {
       return false;
     }
 
     return NewbornArrayPush(cx_, result_, ObjectValue(*entry));
   }
 
  public:
   explicit DebuggerScriptGetAllColumnOffsetsMatcher(JSContext* cx,