Bug 1518661 - Part 1: Pass PropertyName* directly instead of creating ID. r=jimb,jorendorff
☠☠ backed out by e32e036906b9 ☠ ☠
authorLogan Smyth <loganfsmyth@gmail.com>
Tue, 12 Feb 2019 23:45:18 +0000
changeset 458813 64ebb085a6b3a5924ddc40c680bf40bb2459f1bd
parent 458812 1a7809015b49094905722525e3d90c2987b2d666
child 458814 4a8b38e5373bc1d2b16445f81a1604f3c1eaf642
push id78045
push userlsmyth@mozilla.com
push dateWed, 13 Feb 2019 01:06:35 +0000
treeherderautoland@d381785b0c4c [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,