Chromium Code Reviews| 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 10206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 10217 static void GetMinInobjectSlack(Map* map, void* data) { | 10217 static void GetMinInobjectSlack(Map* map, void* data) { |
| 10218 int slack = map->unused_property_fields(); | 10218 int slack = map->unused_property_fields(); |
| 10219 if (*reinterpret_cast<int*>(data) > slack) { | 10219 if (*reinterpret_cast<int*>(data) > slack) { |
| 10220 *reinterpret_cast<int*>(data) = slack; | 10220 *reinterpret_cast<int*>(data) = slack; |
| 10221 } | 10221 } |
| 10222 } | 10222 } |
| 10223 | 10223 |
| 10224 | 10224 |
| 10225 static void ShrinkInstanceSize(Map* map, void* data) { | 10225 static void ShrinkInstanceSize(Map* map, void* data) { |
| 10226 int slack = *reinterpret_cast<int*>(data); | 10226 int slack = *reinterpret_cast<int*>(data); |
| 10227 map->set_inobject_properties(map->inobject_properties() - slack); | 10227 map->Shrink(slack); |
|
Michael Starzinger
2014/04/08 11:34:22
nit: Can we call that Map::ShrinkInstanceSize for
| |
| 10228 map->set_unused_property_fields(map->unused_property_fields() - slack); | |
| 10229 map->set_instance_size(map->instance_size() - slack * kPointerSize); | |
| 10230 | |
| 10231 // Visitor id might depend on the instance size, recalculate it. | |
| 10232 map->set_visitor_id(StaticVisitorBase::GetVisitorId(map)); | |
| 10233 } | 10228 } |
| 10234 | 10229 |
| 10235 | 10230 |
| 10236 void SharedFunctionInfo::CompleteInobjectSlackTracking() { | 10231 void SharedFunctionInfo::CompleteInobjectSlackTracking() { |
| 10237 ASSERT(live_objects_may_exist() && IsInobjectSlackTrackingInProgress()); | 10232 ASSERT(live_objects_may_exist() && IsInobjectSlackTrackingInProgress()); |
| 10238 Map* map = Map::cast(initial_map()); | 10233 Map* map = Map::cast(initial_map()); |
| 10239 | 10234 |
| 10240 Heap* heap = map->GetHeap(); | 10235 Heap* heap = map->GetHeap(); |
| 10241 set_initial_map(heap->undefined_value()); | 10236 set_initial_map(heap->undefined_value()); |
| 10242 Builtins* builtins = heap->isolate()->builtins(); | 10237 Builtins* builtins = heap->isolate()->builtins(); |
| (...skipping 6434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 16677 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16672 #define ERROR_MESSAGES_TEXTS(C, T) T, |
| 16678 static const char* error_messages_[] = { | 16673 static const char* error_messages_[] = { |
| 16679 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16674 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
| 16680 }; | 16675 }; |
| 16681 #undef ERROR_MESSAGES_TEXTS | 16676 #undef ERROR_MESSAGES_TEXTS |
| 16682 return error_messages_[reason]; | 16677 return error_messages_[reason]; |
| 16683 } | 16678 } |
| 16684 | 16679 |
| 16685 | 16680 |
| 16686 } } // namespace v8::internal | 16681 } } // namespace v8::internal |
| OLD | NEW |