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