Indentation and comment wrapping (at 79, 99 looks too long and most comments still avoid going past 80+/-).
authorBrendan Eich <brendan@mozilla.org>
Mon, 07 Jul 2008 02:55:03 -0700
changeset 17487 28ee0944d8703c00d9208c19dd498a0bd552151e
parent 17484 5b4529458a560d4fabcb625f3eaadd23bb151c39
child 17488 451aef0e1c4f24b60764dcad9340afb92d41dda5
push id1452
push usershaver@mozilla.com
push dateFri, 22 Aug 2008 00:08:22 +0000
treeherderautoland@d13bb0868596 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9.1a1pre
Indentation and comment wrapping (at 79, 99 looks too long and most comments still avoid going past 80+/-).
js/src/jstracer.cpp
js/src/jstracer.h
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -1202,26 +1202,26 @@ TraceRecorder::test_property_cache(JSObj
 #endif
     guard(true, lir->ins2i(LIR_eq, shape_ins, OBJ_SCOPE(obj)->shape));
     return true;
 }
 
 void
 TraceRecorder::stobj_set_slot(LIns* obj_ins, unsigned slot, LIns*& dslots_ins, LIns* v_ins)
 {
-    if (slot < JS_INITIAL_NSLOTS)
+    if (slot < JS_INITIAL_NSLOTS) {
         lir->insStorei(v_ins,
-                obj_ins,
-                offsetof(JSObject, fslots) + slot * sizeof(jsval));
-    else {
+                       obj_ins,
+                       offsetof(JSObject, fslots) + slot * sizeof(jsval));
+    } else {
         if (!dslots_ins)
             dslots_ins = lir->insLoadi(obj_ins, offsetof(JSObject, dslots));
         lir->insStorei(v_ins,
-                dslots_ins,
-                (slot - JS_INITIAL_NSLOTS) * sizeof(jsval));
+                       dslots_ins,
+                       (slot - JS_INITIAL_NSLOTS) * sizeof(jsval));
     }
 }
 
 LIns*
 TraceRecorder::stobj_get_slot(LIns* obj_ins, unsigned slot, LIns*& dslots_ins)
 {
     if (slot < JS_INITIAL_NSLOTS) {
         return lir->insLoadi(obj_ins,
--- a/js/src/jstracer.h
+++ b/js/src/jstracer.h
@@ -1,10 +1,10 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * vim: set ts=8 sw=4 et tw=79 ft=cpp:
+ * vim: set ts=8 sw=4 et tw=99 ft=cpp:
  *
  * ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
@@ -44,36 +44,35 @@
 #include "jslock.h"
 #include "jsnum.h"
 #include "jsinterp.h"
 
 #include "nanojit/nanojit.h"
 
 /*
  * We use a magic boxed pointer value to represent error conditions that
- * trigger a side exit. The address is so low that it should never be
- * actually in use. If it is, a performance regression occurs, not an
- * actual runtime error.
+ * trigger a side exit. The address is so low that it should never be actually
+ * in use. If it is, a performance regression occurs, not an actual runtime
+ * error.
  */
 #define JSVAL_ERROR_COOKIE OBJECT_TO_JSVAL((void*)0x10)
 
 /*
- * We also need a magic unboxed 32-bit integer that signals an error.
- * Again if this number is hit we experience a performance regression,
- * not a runtime error.
+ * We also need a magic unboxed 32-bit integer that signals an error.  Again if
+ * this number is hit we experience a performance regression, not a runtime
+ * error.
  */
 #define INT32_ERROR_COOKIE 0xffffabcd
 
 /*
- * Tracker is used to keep track of values being manipulated by the
- * interpreter during trace recording.
+ * Tracker is used to keep track of values being manipulated by the interpreter
+ * during trace recording.
  */
 template <typename T>
-class Tracker
-{
+class Tracker {
     struct Page {
         struct Page*    next;
         jsuword         base;
         T               map[0];
     };
     struct Page* pagelist;
 
     jsuword         getPageBase(const void* v) const;
@@ -167,30 +166,30 @@ class TraceRecorder {
     bool iunary(nanojit::LOpcode op);
     bool bbinary(nanojit::LOpcode op);
     void demote(jsval& v, jsdouble result);
 
     bool map_is_native(JSObjectMap* map, nanojit::LIns* map_ins);
     bool test_property_cache(JSObject* obj, nanojit::LIns* obj_ins, JSObject*& obj2,
                              JSPropCacheEntry*& entry);
     void stobj_set_slot(nanojit::LIns* obj_ins, unsigned slot,
-            nanojit::LIns*& dslots_ins, nanojit::LIns* v_ins);
+                        nanojit::LIns*& dslots_ins, nanojit::LIns* v_ins);
     nanojit::LIns* stobj_get_slot(nanojit::LIns* obj_ins, unsigned slot,
-            nanojit::LIns*& dslots_ins);
+                                  nanojit::LIns*& dslots_ins);
     bool native_set(nanojit::LIns* obj_ins, JSScopeProperty* sprop,
-            nanojit::LIns*& dslots_ins, nanojit::LIns* v_ins);
+                    nanojit::LIns*& dslots_ins, nanojit::LIns* v_ins);
     bool native_get(nanojit::LIns* obj_ins, nanojit::LIns* pobj_ins, JSScopeProperty* sprop,
-            nanojit::LIns*& dslots_ins, nanojit::LIns*& v_ins);
+                    nanojit::LIns*& dslots_ins, nanojit::LIns*& v_ins);
 
     bool box_jsval(jsval v, nanojit::LIns*& v_ins);
     bool unbox_jsval(jsval v, nanojit::LIns*& v_ins);
-    bool guardThatObjectIsDenseArray(JSObject* obj,
-            nanojit::LIns* obj_ins, nanojit::LIns*& dslots_ins);
-    bool guardDenseArrayIndexWithinBounds(JSObject* obj, jsint idx,
-            nanojit::LIns* obj_ins, nanojit::LIns*& dslots_ins, nanojit::LIns* idx_ins);
+    bool guardThatObjectIsDenseArray(JSObject* obj, nanojit::LIns* obj_ins,
+                                     nanojit::LIns*& dslots_ins);
+    bool guardDenseArrayIndexWithinBounds(JSObject* obj, jsint idx, nanojit::LIns* obj_ins,
+                                          nanojit::LIns*& dslots_ins, nanojit::LIns* idx_ins);
 public:
     TraceRecorder(JSContext* cx, nanojit::Fragmento*, nanojit::Fragment*);
     ~TraceRecorder();
 
     JSStackFrame* getEntryFrame() const;
     JSStackFrame* getFp() const;
     JSFrameRegs& getRegs() const;
     nanojit::Fragment* getFragment() const;
@@ -211,24 +210,19 @@ FASTCALL jsdouble builtin_dmod(jsdouble 
 FASTCALL jsval    builtin_BoxDouble(JSContext* cx, jsdouble d);
 FASTCALL jsval    builtin_BoxInt32(JSContext* cx, jsint i);
 FASTCALL jsdouble builtin_UnboxDouble(jsval v);
 FASTCALL jsint    builtin_UnboxInt32(jsval v);
 FASTCALL int32    builtin_doubleToInt32(jsdouble d);
 FASTCALL int32    builtin_doubleToUint32(jsdouble d);
 
 /*
- * Trace monitor. Every runtime is associated with a trace monitor that keeps
- * track of loop frequencies for all JavaScript code loaded into that runtime.
- * For this we use a loop table. Adjacent slots in the loop table, one for each
- * loop header in a given script, are requested using lock-free synchronization
- * from the runtime-wide loop table slot space, when the script is compiled.
- *
- * The loop table also doubles as trace tree pointer table once a loop achieves
- * a certain number of iterations and we recorded a tree for that loop.
+ * Trace monitor. Every JSThread (if JS_THREADSAFE) or JSRuntime (if not
+ * JS_THREADSAFE) has an associated trace monitor that keeps track of loop
+ * frequencies for all JavaScript code loaded into that runtime.
  */
 struct JSTraceMonitor {
     nanojit::Fragmento*     fragmento;
     TraceRecorder*          recorder;
 };
 
 #define TRACING_ENABLED(cx)       JS_HAS_OPTION(cx, JSOPTION_JIT)