| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1082 neander_map_ = Map::cast(obj); | 1082 neander_map_ = Map::cast(obj); |
| 1083 | 1083 |
| 1084 obj = Heap::AllocateJSObjectFromMap(neander_map_); | 1084 obj = Heap::AllocateJSObjectFromMap(neander_map_); |
| 1085 if (obj->IsFailure()) return false; | 1085 if (obj->IsFailure()) return false; |
| 1086 Object* elements = AllocateFixedArray(2); | 1086 Object* elements = AllocateFixedArray(2); |
| 1087 if (elements->IsFailure()) return false; | 1087 if (elements->IsFailure()) return false; |
| 1088 FixedArray::cast(elements)->set(0, Smi::FromInt(0)); | 1088 FixedArray::cast(elements)->set(0, Smi::FromInt(0)); |
| 1089 JSObject::cast(obj)->set_elements(FixedArray::cast(elements)); | 1089 JSObject::cast(obj)->set_elements(FixedArray::cast(elements)); |
| 1090 message_listeners_ = JSObject::cast(obj); | 1090 message_listeners_ = JSObject::cast(obj); |
| 1091 | 1091 |
| 1092 obj = Heap::AllocateJSObjectFromMap(neander_map_); | |
| 1093 if (obj->IsFailure()) return false; | |
| 1094 elements = AllocateFixedArray(2); | |
| 1095 if (elements->IsFailure()) return false; | |
| 1096 FixedArray::cast(elements)->set(0, Smi::FromInt(0)); | |
| 1097 JSObject::cast(obj)->set_elements(FixedArray::cast(elements)); | |
| 1098 debug_event_listeners_ = JSObject::cast(obj); | |
| 1099 | |
| 1100 return true; | 1092 return true; |
| 1101 } | 1093 } |
| 1102 | 1094 |
| 1103 void Heap::CreateFixedStubs() { | 1095 void Heap::CreateFixedStubs() { |
| 1104 // Here we create roots for fixed stubs. They are needed at GC | 1096 // Here we create roots for fixed stubs. They are needed at GC |
| 1105 // for cooking and uncooking (check out frames.cc). | 1097 // for cooking and uncooking (check out frames.cc). |
| 1106 // The eliminates the need for doing dictionary lookup in the | 1098 // The eliminates the need for doing dictionary lookup in the |
| 1107 // stub cache for these stubs. | 1099 // stub cache for these stubs. |
| 1108 HandleScope scope; | 1100 HandleScope scope; |
| 1109 { | 1101 { |
| (...skipping 2250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3360 #ifdef DEBUG | 3352 #ifdef DEBUG |
| 3361 bool Heap::GarbageCollectionGreedyCheck() { | 3353 bool Heap::GarbageCollectionGreedyCheck() { |
| 3362 ASSERT(FLAG_gc_greedy); | 3354 ASSERT(FLAG_gc_greedy); |
| 3363 if (Bootstrapper::IsActive()) return true; | 3355 if (Bootstrapper::IsActive()) return true; |
| 3364 if (disallow_allocation_failure()) return true; | 3356 if (disallow_allocation_failure()) return true; |
| 3365 return CollectGarbage(0, NEW_SPACE); | 3357 return CollectGarbage(0, NEW_SPACE); |
| 3366 } | 3358 } |
| 3367 #endif | 3359 #endif |
| 3368 | 3360 |
| 3369 } } // namespace v8::internal | 3361 } } // namespace v8::internal |
| OLD | NEW |