| 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 return result; | 355 return result; |
| 356 } | 356 } |
| 357 | 357 |
| 358 | 358 |
| 359 Handle<Object> SetPrototype(Handle<JSObject> obj, Handle<Object> value) { | 359 Handle<Object> SetPrototype(Handle<JSObject> obj, Handle<Object> value) { |
| 360 const bool skip_hidden_prototypes = false; | 360 const bool skip_hidden_prototypes = false; |
| 361 CALL_HEAP_FUNCTION(obj->SetPrototype(*value, skip_hidden_prototypes), Object); | 361 CALL_HEAP_FUNCTION(obj->SetPrototype(*value, skip_hidden_prototypes), Object); |
| 362 } | 362 } |
| 363 | 363 |
| 364 | 364 |
| 365 Handle<Object> PreventExtensions(Handle<JSObject> object) { |
| 366 CALL_HEAP_FUNCTION(object->PreventExtensions(), Object); |
| 367 } |
| 368 |
| 369 |
| 365 Handle<Object> GetHiddenProperties(Handle<JSObject> obj, | 370 Handle<Object> GetHiddenProperties(Handle<JSObject> obj, |
| 366 bool create_if_needed) { | 371 bool create_if_needed) { |
| 367 Object* holder = obj->BypassGlobalProxy(); | 372 Object* holder = obj->BypassGlobalProxy(); |
| 368 if (holder->IsUndefined()) return Factory::undefined_value(); | 373 if (holder->IsUndefined()) return Factory::undefined_value(); |
| 369 obj = Handle<JSObject>(JSObject::cast(holder)); | 374 obj = Handle<JSObject>(JSObject::cast(holder)); |
| 370 | 375 |
| 371 if (obj->HasFastProperties()) { | 376 if (obj->HasFastProperties()) { |
| 372 // If the object has fast properties, check whether the first slot | 377 // If the object has fast properties, check whether the first slot |
| 373 // in the descriptor array matches the hidden symbol. Since the | 378 // in the descriptor array matches the hidden symbol. Since the |
| 374 // hidden symbols hash code is zero (and no other string has hash | 379 // hidden symbols hash code is zero (and no other string has hash |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 905 | 910 |
| 906 OptimizedObjectForAddingMultipleProperties:: | 911 OptimizedObjectForAddingMultipleProperties:: |
| 907 ~OptimizedObjectForAddingMultipleProperties() { | 912 ~OptimizedObjectForAddingMultipleProperties() { |
| 908 // Reoptimize the object to allow fast property access. | 913 // Reoptimize the object to allow fast property access. |
| 909 if (has_been_transformed_) { | 914 if (has_been_transformed_) { |
| 910 TransformToFastProperties(object_, unused_property_fields_); | 915 TransformToFastProperties(object_, unused_property_fields_); |
| 911 } | 916 } |
| 912 } | 917 } |
| 913 | 918 |
| 914 } } // namespace v8::internal | 919 } } // namespace v8::internal |
| OLD | NEW |