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 5969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5980 } else if (object->HasFastProperties() && old_map->CanHaveMoreTransitions()) { | 5980 } else if (object->HasFastProperties() && old_map->CanHaveMoreTransitions()) { |
5981 new_map = Map::CopyForObserved(old_map); | 5981 new_map = Map::CopyForObserved(old_map); |
5982 } else { | 5982 } else { |
5983 new_map = Map::Copy(old_map); | 5983 new_map = Map::Copy(old_map); |
5984 new_map->set_is_observed(); | 5984 new_map->set_is_observed(); |
5985 } | 5985 } |
5986 JSObject::MigrateToMap(object, new_map); | 5986 JSObject::MigrateToMap(object, new_map); |
5987 } | 5987 } |
5988 | 5988 |
5989 | 5989 |
5990 Handle<JSObject> JSObject::Copy(Handle<JSObject> object, | |
5991 Handle<AllocationSite> site) { | |
5992 Isolate* isolate = object->GetIsolate(); | |
5993 CALL_HEAP_FUNCTION(isolate, | |
5994 isolate->heap()->CopyJSObject( | |
5995 *object, | |
5996 site.is_null() ? NULL : *site), | |
5997 JSObject); | |
5998 } | |
5999 | |
6000 | |
6001 Handle<JSObject> JSObject::Copy(Handle<JSObject> object) { | |
6002 Isolate* isolate = object->GetIsolate(); | |
6003 CALL_HEAP_FUNCTION(isolate, | |
6004 isolate->heap()->CopyJSObject(*object, NULL), | |
6005 JSObject); | |
6006 } | |
6007 | |
6008 | |
6009 Handle<Object> JSObject::FastPropertyAt(Handle<JSObject> object, | 5990 Handle<Object> JSObject::FastPropertyAt(Handle<JSObject> object, |
6010 Representation representation, | 5991 Representation representation, |
6011 int index) { | 5992 int index) { |
6012 Isolate* isolate = object->GetIsolate(); | 5993 Isolate* isolate = object->GetIsolate(); |
6013 Handle<Object> raw_value(object->RawFastPropertyAt(index), isolate); | 5994 Handle<Object> raw_value(object->RawFastPropertyAt(index), isolate); |
6014 return Object::NewStorageFor(isolate, raw_value, representation); | 5995 return Object::NewStorageFor(isolate, raw_value, representation); |
6015 } | 5996 } |
6016 | 5997 |
6017 | 5998 |
6018 template<class ContextObject> | 5999 template<class ContextObject> |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6067 if (object->map()->is_deprecated()) { | 6048 if (object->map()->is_deprecated()) { |
6068 JSObject::MigrateInstance(object); | 6049 JSObject::MigrateInstance(object); |
6069 } | 6050 } |
6070 | 6051 |
6071 Handle<JSObject> copy; | 6052 Handle<JSObject> copy; |
6072 if (copying) { | 6053 if (copying) { |
6073 Handle<AllocationSite> site_to_pass; | 6054 Handle<AllocationSite> site_to_pass; |
6074 if (site_context()->ShouldCreateMemento(object)) { | 6055 if (site_context()->ShouldCreateMemento(object)) { |
6075 site_to_pass = site_context()->current(); | 6056 site_to_pass = site_context()->current(); |
6076 } | 6057 } |
6077 copy = JSObject::Copy(object, site_to_pass); | 6058 copy = isolate->factory()->CopyJSObjectWithMemento(object, site_to_pass); |
mvstanton
2014/04/28 15:41:10
I think this method should be called CopyJSObjectW
| |
6078 } else { | 6059 } else { |
6079 copy = object; | 6060 copy = object; |
6080 } | 6061 } |
6081 | 6062 |
6082 ASSERT(copying || copy.is_identical_to(object)); | 6063 ASSERT(copying || copy.is_identical_to(object)); |
6083 | 6064 |
6084 ElementsKind kind = copy->GetElementsKind(); | 6065 ElementsKind kind = copy->GetElementsKind(); |
6085 if (copying && IsFastSmiOrObjectElementsKind(kind) && | 6066 if (copying && IsFastSmiOrObjectElementsKind(kind) && |
6086 FixedArray::cast(copy->elements())->map() == | 6067 FixedArray::cast(copy->elements())->map() == |
6087 isolate->heap()->fixed_cow_array_map()) { | 6068 isolate->heap()->fixed_cow_array_map()) { |
(...skipping 11238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
17326 #define ERROR_MESSAGES_TEXTS(C, T) T, | 17307 #define ERROR_MESSAGES_TEXTS(C, T) T, |
17327 static const char* error_messages_[] = { | 17308 static const char* error_messages_[] = { |
17328 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 17309 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
17329 }; | 17310 }; |
17330 #undef ERROR_MESSAGES_TEXTS | 17311 #undef ERROR_MESSAGES_TEXTS |
17331 return error_messages_[reason]; | 17312 return error_messages_[reason]; |
17332 } | 17313 } |
17333 | 17314 |
17334 | 17315 |
17335 } } // namespace v8::internal | 17316 } } // namespace v8::internal |
OLD | NEW |