Bug 910896 - Move StructField constructor into TypeRepresentation.cpp r=shu
authorNicholas D. Matsakis <nmatsakis@mozilla.com>
Thu, 29 Aug 2013 17:22:37 -0400
changeset 145017 8e94b0e0d4fe9b9db111cc1f80d8e5b0ca1bc3f7
parent 145016 17a114e7922af3fb73d3753096953330cae1c2f7
child 145018 c456e82b5e0765a4877b35be767a474303784bd4
push id33126
push usernmatsakis@mozilla.com
push dateThu, 29 Aug 2013 22:29:16 +0000
treeherdermozilla-inbound@8e94b0e0d4fe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersshu
bugs910896
milestone26.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 910896 - Move StructField constructor into TypeRepresentation.cpp r=shu
js/src/builtin/TypeRepresentation.cpp
js/src/builtin/TypeRepresentation.h
--- a/js/src/builtin/TypeRepresentation.cpp
+++ b/js/src/builtin/TypeRepresentation.cpp
@@ -185,16 +185,26 @@ ArrayTypeRepresentation::ArrayTypeRepres
 {
 }
 
 static inline size_t alignTo(size_t address, size_t align) {
     JS_ASSERT(IsPowerOfTwo(align));
     return (address + align - 1) & -align;
 }
 
+StructField::StructField(size_t index,
+                         jsid &id,
+                         TypeRepresentation *typeRepr,
+                         size_t offset)
+  : index(index),
+    id(id),
+    typeRepr(typeRepr),
+    offset(offset)
+{}
+
 StructTypeRepresentation::StructTypeRepresentation()
   : TypeRepresentation(Struct, 0, 1),
     fieldCount_(0) // see ::init() below!
 {
 }
 
 bool
 StructTypeRepresentation::init(JSContext *cx,
--- a/js/src/builtin/TypeRepresentation.h
+++ b/js/src/builtin/TypeRepresentation.h
@@ -245,22 +245,17 @@ struct StructField {
     size_t index;
     HeapId id;
     TypeRepresentation *typeRepr;
     size_t offset;
 
     explicit StructField(size_t index,
                          jsid &id,
                          TypeRepresentation *typeRepr,
-                         size_t offset)
-      : index(index),
-        id(id),
-        typeRepr(typeRepr),
-        offset(offset)
-    {}
+                         size_t offset);
 };
 
 class StructTypeRepresentation : public TypeRepresentation {
   private:
     // so TypeRepresentation can call appendStringStruct() etc
     friend class TypeRepresentation;
 
     size_t fieldCount_;