Change the order of two assignments, to make sure that the script type
authorager@chromium.org <ager@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 28 Oct 2008 13:46:04 +0000 (13:46 +0000)
committerager@chromium.org <ager@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 28 Oct 2008 13:46:04 +0000 (13:46 +0000)
field is always initialized to a Smi before we get any GCs.

Review URL: http://codereview.chromium.org/8833

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@624 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/factory.cc
src/objects-inl.h

index 55af33d..435f4c1 100644 (file)
@@ -138,8 +138,8 @@ Handle<Script> Factory::NewScript(Handle<String> source) {
   script->set_name(Heap::undefined_value());
   script->set_line_offset(Smi::FromInt(0));
   script->set_column_offset(Smi::FromInt(0));
-  script->set_wrapper(*Factory::NewProxy(0, TENURED));
   script->set_type(Smi::FromInt(SCRIPT_TYPE_NORMAL));
+  script->set_wrapper(*Factory::NewProxy(0, TENURED));
   return script;
 }
 
index beb6c0e..3694e30 100644 (file)
@@ -382,7 +382,7 @@ bool Object::IsJSGlobalProxy() {
 bool Object::IsGlobalObject() {
   if (!IsHeapObject()) return false;
 
-  InstanceType type =  HeapObject::cast(this)->map()->instance_type();
+  InstanceType type = HeapObject::cast(this)->map()->instance_type();
   return type == JS_GLOBAL_OBJECT_TYPE ||
          type == JS_BUILTINS_OBJECT_TYPE;
 }