OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 Object); | 293 Object); |
294 } | 294 } |
295 | 295 |
296 | 296 |
297 Handle<Object> GetPrototype(Handle<Object> obj) { | 297 Handle<Object> GetPrototype(Handle<Object> obj) { |
298 Handle<Object> result(obj->GetPrototype()); | 298 Handle<Object> result(obj->GetPrototype()); |
299 return result; | 299 return result; |
300 } | 300 } |
301 | 301 |
302 | 302 |
| 303 Handle<Object> SetPrototype(Handle<JSObject> obj, Handle<Object> value) { |
| 304 const bool skip_hidden_prototypes = false; |
| 305 CALL_HEAP_FUNCTION(obj->SetPrototype(*value, skip_hidden_prototypes), Object); |
| 306 } |
| 307 |
| 308 |
303 Handle<Object> GetHiddenProperties(Handle<JSObject> obj, | 309 Handle<Object> GetHiddenProperties(Handle<JSObject> obj, |
304 bool create_if_needed) { | 310 bool create_if_needed) { |
305 Object* holder = obj->BypassGlobalProxy(); | 311 Object* holder = obj->BypassGlobalProxy(); |
306 if (holder->IsUndefined()) return Factory::undefined_value(); | 312 if (holder->IsUndefined()) return Factory::undefined_value(); |
307 obj = Handle<JSObject>(JSObject::cast(holder)); | 313 obj = Handle<JSObject>(JSObject::cast(holder)); |
308 | 314 |
309 if (obj->HasFastProperties()) { | 315 if (obj->HasFastProperties()) { |
310 // If the object has fast properties, check whether the first slot | 316 // If the object has fast properties, check whether the first slot |
311 // in the descriptor array matches the hidden symbol. Since the | 317 // in the descriptor array matches the hidden symbol. Since the |
312 // hidden symbols hash code is zero (and no other string has hash | 318 // hidden symbols hash code is zero (and no other string has hash |
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
822 Handle<Map> new_map = Factory::CopyMapDropTransitions(old_map); | 828 Handle<Map> new_map = Factory::CopyMapDropTransitions(old_map); |
823 obj->set_map(*new_map); | 829 obj->set_map(*new_map); |
824 new_map->set_needs_loading(true); | 830 new_map->set_needs_loading(true); |
825 // Store the lazy loading info in the constructor field. We'll | 831 // Store the lazy loading info in the constructor field. We'll |
826 // reestablish the constructor from the fixed array after loading. | 832 // reestablish the constructor from the fixed array after loading. |
827 new_map->set_constructor(*arr); | 833 new_map->set_constructor(*arr); |
828 ASSERT(!obj->IsLoaded()); | 834 ASSERT(!obj->IsLoaded()); |
829 } | 835 } |
830 | 836 |
831 } } // namespace v8::internal | 837 } } // namespace v8::internal |
OLD | NEW |