Bug 1204187 - IonMonkey: MIPS32: Inline RelocationIterator. r=nbp
authorHeiher <r@hev.cc>
Tue, 15 Sep 2015 03:24:40 +0800
changeset 294922 862295d7d82a6fb20dffd0e19c6be9d805545962
parent 294921 4a2be6e35d27a5073dd0db6a9a286eea127e6959
child 294923 010b34c54ee2a861289ff65fa9e82a7a690fc1cb
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp
bugs1204187
milestone43.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 1204187 - IonMonkey: MIPS32: Inline RelocationIterator. r=nbp --- js/src/jit/mips-shared/Assembler-mips-shared.cpp | 23 ----------------------- js/src/jit/mips32/Assembler-mips32.cpp | 9 ++++++--- 2 files changed, 6 insertions(+), 26 deletions(-)
js/src/jit/mips-shared/Assembler-mips-shared.cpp
js/src/jit/mips32/Assembler-mips32.cpp
--- a/js/src/jit/mips-shared/Assembler-mips-shared.cpp
+++ b/js/src/jit/mips-shared/Assembler-mips-shared.cpp
@@ -107,39 +107,16 @@ AssemblerMIPSShared::PatchableJumpAddres
 }
 
 Assembler&
 AssemblerMIPSShared::asAsm()
 {
     return *static_cast<Assembler*>(this);
 }
 
-class RelocationIterator
-{
-    CompactBufferReader reader_;
-    // offset in bytes
-    uint32_t offset_;
-
-  public:
-    RelocationIterator(CompactBufferReader& reader)
-      : reader_(reader)
-    { }
-
-    bool read() {
-        if (!reader_.more())
-            return false;
-        offset_ = reader_.readUnsigned();
-        return true;
-    }
-
-    uint32_t offset() const {
-        return offset_;
-    }
-};
-
 void
 AssemblerMIPSShared::copyJumpRelocationTable(uint8_t* dest)
 {
     if (jumpRelocations_.length())
         memcpy(dest, jumpRelocations_.buffer(), jumpRelocations_.length());
 }
 
 void
--- a/js/src/jit/mips32/Assembler-mips32.cpp
+++ b/js/src/jit/mips32/Assembler-mips32.cpp
@@ -1,16 +1,20 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "jit/mips32/Assembler-mips32.h"
 
+#include "mozilla/DebugOnly.h"
+
+using mozilla::DebugOnly;
+
 using namespace js;
 using namespace js::jit;
 
 ABIArgGenerator::ABIArgGenerator()
   : usedArgSlots_(0),
     firstArgFloatSize_(0),
     useGPRForFloats_(false),
     current_()
@@ -166,19 +170,18 @@ CodeFromJump(Instruction* jump)
 {
     uint8_t* target = (uint8_t*)Assembler::ExtractLuiOriValue(jump, jump->next());
     return JitCode::FromExecutable(target);
 }
 
 void
 Assembler::TraceJumpRelocations(JSTracer* trc, JitCode* code, CompactBufferReader& reader)
 {
-    RelocationIterator iter(reader);
-    while (iter.read()) {
-        JitCode* child = CodeFromJump((Instruction*)(code->raw() + iter.offset()));
+    while (reader.more()) {
+        JitCode* child = CodeFromJump((Instruction*)(code->raw() + reader.readUnsigned()));
         TraceManuallyBarrieredEdge(trc, &child, "rel32");
     }
 }
 
 static void
 TraceOneDataRelocation(JSTracer* trc, Instruction* inst)
 {
     void* ptr = (void*)Assembler::ExtractLuiOriValue(inst, inst->next());