OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 5806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5817 } else if (old_map->CanHaveMoreTransitions()) { | 5817 } else if (old_map->CanHaveMoreTransitions()) { |
5818 new_map = Map::CopyForObserved(old_map); | 5818 new_map = Map::CopyForObserved(old_map); |
5819 } else { | 5819 } else { |
5820 new_map = Map::Copy(old_map); | 5820 new_map = Map::Copy(old_map); |
5821 new_map->set_is_observed(); | 5821 new_map->set_is_observed(); |
5822 } | 5822 } |
5823 JSObject::MigrateToMap(object, new_map); | 5823 JSObject::MigrateToMap(object, new_map); |
5824 } | 5824 } |
5825 | 5825 |
5826 | 5826 |
| 5827 Handle<JSObject> JSObject::Copy(Handle<JSObject> object, |
| 5828 Handle<AllocationSite> site) { |
| 5829 Isolate* isolate = object->GetIsolate(); |
| 5830 CALL_HEAP_FUNCTION(isolate, |
| 5831 isolate->heap()->CopyJSObject( |
| 5832 *object, |
| 5833 site.is_null() ? NULL : *site), |
| 5834 JSObject); |
| 5835 } |
| 5836 |
| 5837 |
5827 Handle<JSObject> JSObject::Copy(Handle<JSObject> object) { | 5838 Handle<JSObject> JSObject::Copy(Handle<JSObject> object) { |
5828 Isolate* isolate = object->GetIsolate(); | 5839 Isolate* isolate = object->GetIsolate(); |
5829 CALL_HEAP_FUNCTION(isolate, | 5840 CALL_HEAP_FUNCTION(isolate, |
5830 isolate->heap()->CopyJSObject(*object), JSObject); | 5841 isolate->heap()->CopyJSObject(*object, NULL), |
| 5842 JSObject); |
5831 } | 5843 } |
5832 | 5844 |
5833 | 5845 |
5834 Handle<Object> JSObject::FastPropertyAt(Handle<JSObject> object, | 5846 Handle<Object> JSObject::FastPropertyAt(Handle<JSObject> object, |
5835 Representation representation, | 5847 Representation representation, |
5836 int index) { | 5848 int index) { |
5837 Isolate* isolate = object->GetIsolate(); | 5849 Isolate* isolate = object->GetIsolate(); |
5838 Handle<Object> raw_value(object->RawFastPropertyAt(index), isolate); | 5850 Handle<Object> raw_value(object->RawFastPropertyAt(index), isolate); |
5839 return Object::NewStorageFor(isolate, raw_value, representation); | 5851 return Object::NewStorageFor(isolate, raw_value, representation); |
5840 } | 5852 } |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5891 if (object->map()->is_deprecated()) { | 5903 if (object->map()->is_deprecated()) { |
5892 JSObject::MigrateInstance(object); | 5904 JSObject::MigrateInstance(object); |
5893 } | 5905 } |
5894 | 5906 |
5895 Handle<JSObject> copy; | 5907 Handle<JSObject> copy; |
5896 if (copying) { | 5908 if (copying) { |
5897 Handle<AllocationSite> site_to_pass; | 5909 Handle<AllocationSite> site_to_pass; |
5898 if (site_context()->ShouldCreateMemento(object)) { | 5910 if (site_context()->ShouldCreateMemento(object)) { |
5899 site_to_pass = site_context()->current(); | 5911 site_to_pass = site_context()->current(); |
5900 } | 5912 } |
5901 CALL_AND_RETRY_OR_DIE(isolate, | 5913 copy = JSObject::Copy(object, site_to_pass); |
5902 isolate->heap()->CopyJSObject(*object, | |
5903 site_to_pass.is_null() ? NULL : *site_to_pass), | |
5904 { copy = Handle<JSObject>(JSObject::cast(__object__), | |
5905 isolate); | |
5906 break; | |
5907 }, | |
5908 return Handle<JSObject>()); | |
5909 } else { | 5914 } else { |
5910 copy = object; | 5915 copy = object; |
5911 } | 5916 } |
5912 | 5917 |
5913 ASSERT(copying || copy.is_identical_to(object)); | 5918 ASSERT(copying || copy.is_identical_to(object)); |
5914 | 5919 |
5915 ElementsKind kind = copy->GetElementsKind(); | 5920 ElementsKind kind = copy->GetElementsKind(); |
5916 if (copying && IsFastSmiOrObjectElementsKind(kind) && | 5921 if (copying && IsFastSmiOrObjectElementsKind(kind) && |
5917 FixedArray::cast(copy->elements())->map() == | 5922 FixedArray::cast(copy->elements())->map() == |
5918 isolate->heap()->fixed_cow_array_map()) { | 5923 isolate->heap()->fixed_cow_array_map()) { |
(...skipping 10675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16594 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16599 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16595 static const char* error_messages_[] = { | 16600 static const char* error_messages_[] = { |
16596 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16601 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16597 }; | 16602 }; |
16598 #undef ERROR_MESSAGES_TEXTS | 16603 #undef ERROR_MESSAGES_TEXTS |
16599 return error_messages_[reason]; | 16604 return error_messages_[reason]; |
16600 } | 16605 } |
16601 | 16606 |
16602 | 16607 |
16603 } } // namespace v8::internal | 16608 } } // namespace v8::internal |
OLD | NEW |