Commit 44340e39 authored by ager@chromium.org's avatar ager@chromium.org

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.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@624 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent b595d914
......@@ -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;
}
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment