Index: src/heap.cc |
=================================================================== |
--- src/heap.cc (revision 9511) |
+++ src/heap.cc (working copy) |
@@ -1804,9 +1804,16 @@ |
{ MaybeObject* maybe_obj = Allocate(oddball_map(), OLD_POINTER_SPACE); |
if (!maybe_obj->ToObject(&obj)) return false; |
} |
- set_null_value(obj); |
+ set_null_value(Oddball::cast(obj)); |
Oddball::cast(obj)->set_kind(Oddball::kNull); |
+ { MaybeObject* maybe_obj = Allocate(oddball_map(), OLD_POINTER_SPACE); |
+ if (!maybe_obj->ToObject(&obj)) return false; |
+ } |
+ set_undefined_value(Oddball::cast(obj)); |
+ Oddball::cast(obj)->set_kind(Oddball::kUndefined); |
+ ASSERT(!InNewSpace(undefined_value())); |
+ |
// Allocate the empty descriptor array. |
{ MaybeObject* maybe_obj = AllocateEmptyFixedArray(); |
if (!maybe_obj->ToObject(&obj)) return false; |
@@ -2178,26 +2185,19 @@ |
{ MaybeObject* maybe_obj = AllocateHeapNumber(-0.0, TENURED); |
if (!maybe_obj->ToObject(&obj)) return false; |
} |
- set_minus_zero_value(obj); |
+ set_minus_zero_value(HeapNumber::cast(obj)); |
ASSERT(signbit(minus_zero_value()->Number()) != 0); |
{ MaybeObject* maybe_obj = AllocateHeapNumber(OS::nan_value(), TENURED); |
if (!maybe_obj->ToObject(&obj)) return false; |
} |
- set_nan_value(obj); |
+ set_nan_value(HeapNumber::cast(obj)); |
{ MaybeObject* maybe_obj = AllocateHeapNumber(V8_INFINITY, TENURED); |
if (!maybe_obj->ToObject(&obj)) return false; |
} |
- set_infinity_value(obj); |
+ set_infinity_value(HeapNumber::cast(obj)); |
- { MaybeObject* maybe_obj = Allocate(oddball_map(), OLD_POINTER_SPACE); |
- if (!maybe_obj->ToObject(&obj)) return false; |
- } |
- set_undefined_value(obj); |
- Oddball::cast(obj)->set_kind(Oddball::kUndefined); |
- ASSERT(!InNewSpace(undefined_value())); |
- |
// Allocate initial symbol table. |
{ MaybeObject* maybe_obj = SymbolTable::Allocate(kInitialSymbolTableSize); |
if (!maybe_obj->ToObject(&obj)) return false; |
@@ -2205,19 +2205,17 @@ |
// Don't use set_symbol_table() due to asserts. |
roots_[kSymbolTableRootIndex] = obj; |
- // Assign the print strings for oddballs after creating symboltable. |
- Object* symbol; |
- { MaybeObject* maybe_symbol = LookupAsciiSymbol("undefined"); |
- if (!maybe_symbol->ToObject(&symbol)) return false; |
+ // Finish initializing oddballs after creating symboltable. |
+ { MaybeObject* maybe_obj = |
+ undefined_value()->Initialize("undefined", |
+ nan_value(), |
+ Oddball::kUndefined); |
+ if (!maybe_obj->ToObject(&obj)) return false; |
} |
- Oddball::cast(undefined_value())->set_to_string(String::cast(symbol)); |
- Oddball::cast(undefined_value())->set_to_number(nan_value()); |
- // Allocate the null_value |
+ // Initialize the null_value. |
{ MaybeObject* maybe_obj = |
- Oddball::cast(null_value())->Initialize("null", |
- Smi::FromInt(0), |
- Oddball::kNull); |
+ null_value()->Initialize("null", Smi::FromInt(0), Oddball::kNull); |
if (!maybe_obj->ToObject(&obj)) return false; |
} |
@@ -2226,28 +2224,28 @@ |
Oddball::kTrue); |
if (!maybe_obj->ToObject(&obj)) return false; |
} |
- set_true_value(obj); |
+ set_true_value(Oddball::cast(obj)); |
{ MaybeObject* maybe_obj = CreateOddball("false", |
Smi::FromInt(0), |
Oddball::kFalse); |
if (!maybe_obj->ToObject(&obj)) return false; |
} |
- set_false_value(obj); |
+ set_false_value(Oddball::cast(obj)); |
{ MaybeObject* maybe_obj = CreateOddball("hole", |
Smi::FromInt(-1), |
Oddball::kTheHole); |
if (!maybe_obj->ToObject(&obj)) return false; |
} |
- set_the_hole_value(obj); |
+ set_the_hole_value(Oddball::cast(obj)); |
{ MaybeObject* maybe_obj = CreateOddball("arguments_marker", |
Smi::FromInt(-2), |
Oddball::kArgumentMarker); |
if (!maybe_obj->ToObject(&obj)) return false; |
} |
- set_arguments_marker(obj); |
+ set_arguments_marker(Oddball::cast(obj)); |
{ MaybeObject* maybe_obj = CreateOddball("no_interceptor_result_sentinel", |
Smi::FromInt(-3), |
@@ -2268,7 +2266,7 @@ |
Oddball::kOther); |
if (!maybe_obj->ToObject(&obj)) return false; |
} |
- set_frame_alignment_marker(obj); |
+ set_frame_alignment_marker(Oddball::cast(obj)); |
STATIC_ASSERT(Oddball::kLeastHiddenOddballNumber == -5); |
// Allocate the empty string. |