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 4461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4472 | 4472 |
4473 | 4473 |
4474 void NormalizedMapCache::Clear() { | 4474 void NormalizedMapCache::Clear() { |
4475 int entries = length(); | 4475 int entries = length(); |
4476 for (int i = 0; i != entries; i++) { | 4476 for (int i = 0; i != entries; i++) { |
4477 set_undefined(i); | 4477 set_undefined(i); |
4478 } | 4478 } |
4479 } | 4479 } |
4480 | 4480 |
4481 | 4481 |
4482 void JSObject::UpdateMapCodeCache(Handle<JSObject> object, | 4482 void HeapObject::UpdateMapCodeCache(Handle<HeapObject> object, |
4483 Handle<Name> name, | 4483 Handle<Name> name, |
4484 Handle<Code> code) { | 4484 Handle<Code> code) { |
4485 Handle<Map> map(object->map()); | 4485 Handle<Map> map(object->map()); |
4486 if (map->is_shared()) { | 4486 if (map->is_shared()) { |
| 4487 Handle<JSObject> receiver = Handle<JSObject>::cast(object); |
4487 // Fast case maps are never marked as shared. | 4488 // Fast case maps are never marked as shared. |
4488 ASSERT(!object->HasFastProperties()); | 4489 ASSERT(!receiver->HasFastProperties()); |
4489 // Replace the map with an identical copy that can be safely modified. | 4490 // Replace the map with an identical copy that can be safely modified. |
4490 map = Map::CopyNormalized(map, KEEP_INOBJECT_PROPERTIES, | 4491 map = Map::CopyNormalized(map, KEEP_INOBJECT_PROPERTIES, |
4491 UNIQUE_NORMALIZED_MAP); | 4492 UNIQUE_NORMALIZED_MAP); |
4492 object->GetIsolate()->counters()->normalized_maps()->Increment(); | 4493 receiver->GetIsolate()->counters()->normalized_maps()->Increment(); |
4493 object->set_map(*map); | 4494 receiver->set_map(*map); |
4494 } | 4495 } |
4495 Map::UpdateCodeCache(map, name, code); | 4496 Map::UpdateCodeCache(map, name, code); |
4496 } | 4497 } |
4497 | 4498 |
4498 | 4499 |
4499 void JSObject::NormalizeProperties(Handle<JSObject> object, | 4500 void JSObject::NormalizeProperties(Handle<JSObject> object, |
4500 PropertyNormalizationMode mode, | 4501 PropertyNormalizationMode mode, |
4501 int expected_additional_properties) { | 4502 int expected_additional_properties) { |
4502 CALL_HEAP_FUNCTION_VOID(object->GetIsolate(), | 4503 CALL_HEAP_FUNCTION_VOID(object->GetIsolate(), |
4503 object->NormalizeProperties( | 4504 object->NormalizeProperties( |
(...skipping 11640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16144 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16145 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16145 static const char* error_messages_[] = { | 16146 static const char* error_messages_[] = { |
16146 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16147 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16147 }; | 16148 }; |
16148 #undef ERROR_MESSAGES_TEXTS | 16149 #undef ERROR_MESSAGES_TEXTS |
16149 return error_messages_[reason]; | 16150 return error_messages_[reason]; |
16150 } | 16151 } |
16151 | 16152 |
16152 | 16153 |
16153 } } // namespace v8::internal | 16154 } } // namespace v8::internal |
OLD | NEW |