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 | |
370 Handle<Object> GetHiddenProperties(Handle<JSObject> obj, | 365 Handle<Object> GetHiddenProperties(Handle<JSObject> obj, |
371 bool create_if_needed) { | 366 bool create_if_needed) { |
372 Object* holder = obj->BypassGlobalProxy(); | 367 Object* holder = obj->BypassGlobalProxy(); |
373 if (holder->IsUndefined()) return Factory::undefined_value(); | 368 if (holder->IsUndefined()) return Factory::undefined_value(); |
374 obj = Handle<JSObject>(JSObject::cast(holder)); | 369 obj = Handle<JSObject>(JSObject::cast(holder)); |
375 | 370 |
376 if (obj->HasFastProperties()) { | 371 if (obj->HasFastProperties()) { |
377 // If the object has fast properties, check whether the first slot | 372 // If the object has fast properties, check whether the first slot |
378 // in the descriptor array matches the hidden symbol. Since the | 373 // in the descriptor array matches the hidden symbol. Since the |
379 // hidden symbols hash code is zero (and no other string has hash | 374 // 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... |
910 | 905 |
911 OptimizedObjectForAddingMultipleProperties:: | 906 OptimizedObjectForAddingMultipleProperties:: |
912 ~OptimizedObjectForAddingMultipleProperties() { | 907 ~OptimizedObjectForAddingMultipleProperties() { |
913 // Reoptimize the object to allow fast property access. | 908 // Reoptimize the object to allow fast property access. |
914 if (has_been_transformed_) { | 909 if (has_been_transformed_) { |
915 TransformToFastProperties(object_, unused_property_fields_); | 910 TransformToFastProperties(object_, unused_property_fields_); |
916 } | 911 } |
917 } | 912 } |
918 | 913 |
919 } } // namespace v8::internal | 914 } } // namespace v8::internal |
OLD | NEW |