Reviewers: Kasper Lund, Description: Change the order of two assignments, to make sure that the script type field is always initialized to a Smi before we get any GCs.
Please review this at http://codereview.chromium.org/8833 SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/ Affected files: M src/factory.cc M src/objects-inl.h Index: src/objects-inl.h =================================================================== --- src/objects-inl.h (revision 622) +++ src/objects-inl.h (working copy) @@ -382,7 +382,7 @@ 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; } Index: src/factory.cc =================================================================== --- src/factory.cc (revision 622) +++ src/factory.cc (working copy) @@ -138,8 +138,8 @@ script->set_name(Heap::undefined_value()); script->set_line_offset(Smi::FromInt(0)); script->set_column_offset(Smi::FromInt(0)); + script->set_type(Smi::FromInt(SCRIPT_TYPE_NORMAL)); script->set_wrapper(*Factory::NewProxy(0, TENURED)); - script->set_type(Smi::FromInt(SCRIPT_TYPE_NORMAL)); return script; } --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---
