| 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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 } | 394 } |
| 395 | 395 |
| 396 | 396 |
| 397 Handle<Object> SetPrototype(Handle<JSObject> obj, Handle<Object> value) { | 397 Handle<Object> SetPrototype(Handle<JSObject> obj, Handle<Object> value) { |
| 398 const bool skip_hidden_prototypes = false; | 398 const bool skip_hidden_prototypes = false; |
| 399 CALL_HEAP_FUNCTION(obj->GetIsolate(), | 399 CALL_HEAP_FUNCTION(obj->GetIsolate(), |
| 400 obj->SetPrototype(*value, skip_hidden_prototypes), Object); | 400 obj->SetPrototype(*value, skip_hidden_prototypes), Object); |
| 401 } | 401 } |
| 402 | 402 |
| 403 | 403 |
| 404 Handle<Object> PreventExtensions(Handle<JSObject> object) { |
| 405 CALL_HEAP_FUNCTION(object->GetIsolate(), object->PreventExtensions(), Object); |
| 406 } |
| 407 |
| 408 |
| 404 Handle<Object> GetHiddenProperties(Handle<JSObject> obj, | 409 Handle<Object> GetHiddenProperties(Handle<JSObject> obj, |
| 405 bool create_if_needed) { | 410 bool create_if_needed) { |
| 406 Isolate* isolate = obj->GetIsolate(); | 411 Isolate* isolate = obj->GetIsolate(); |
| 407 Object* holder = obj->BypassGlobalProxy(); | 412 Object* holder = obj->BypassGlobalProxy(); |
| 408 if (holder->IsUndefined()) return isolate->factory()->undefined_value(); | 413 if (holder->IsUndefined()) return isolate->factory()->undefined_value(); |
| 409 obj = Handle<JSObject>(JSObject::cast(holder)); | 414 obj = Handle<JSObject>(JSObject::cast(holder)); |
| 410 | 415 |
| 411 if (obj->HasFastProperties()) { | 416 if (obj->HasFastProperties()) { |
| 412 // If the object has fast properties, check whether the first slot | 417 // If the object has fast properties, check whether the first slot |
| 413 // in the descriptor array matches the hidden symbol. Since the | 418 // in the descriptor array matches the hidden symbol. Since the |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 977 | 982 |
| 978 OptimizedObjectForAddingMultipleProperties:: | 983 OptimizedObjectForAddingMultipleProperties:: |
| 979 ~OptimizedObjectForAddingMultipleProperties() { | 984 ~OptimizedObjectForAddingMultipleProperties() { |
| 980 // Reoptimize the object to allow fast property access. | 985 // Reoptimize the object to allow fast property access. |
| 981 if (has_been_transformed_) { | 986 if (has_been_transformed_) { |
| 982 TransformToFastProperties(object_, unused_property_fields_); | 987 TransformToFastProperties(object_, unused_property_fields_); |
| 983 } | 988 } |
| 984 } | 989 } |
| 985 | 990 |
| 986 } } // namespace v8::internal | 991 } } // namespace v8::internal |
| OLD | NEW |