Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: src/objects-inl.h

Issue 15691007: Make Object.freeze fast (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects.cc ('k') | src/property-details.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 3574 matching lines...) Expand 10 before | Expand all | Expand 10 after
3585 set_bit_field3(Deprecated::update(bit_field3(), true)); 3585 set_bit_field3(Deprecated::update(bit_field3(), true));
3586 } 3586 }
3587 3587
3588 3588
3589 bool Map::is_deprecated() { 3589 bool Map::is_deprecated() {
3590 if (!FLAG_track_fields) return false; 3590 if (!FLAG_track_fields) return false;
3591 return Deprecated::decode(bit_field3()); 3591 return Deprecated::decode(bit_field3());
3592 } 3592 }
3593 3593
3594 3594
3595 void Map::freeze() {
3596 set_bit_field3(IsFrozen::update(bit_field3(), true));
3597 }
3598
3599
3600 bool Map::is_frozen() {
3601 return IsFrozen::decode(bit_field3());
3602 }
3603
3604
3595 bool Map::CanBeDeprecated() { 3605 bool Map::CanBeDeprecated() {
3596 int descriptor = LastAdded(); 3606 int descriptor = LastAdded();
3597 for (int i = 0; i <= descriptor; i++) { 3607 for (int i = 0; i <= descriptor; i++) {
3598 PropertyDetails details = instance_descriptors()->GetDetails(i); 3608 PropertyDetails details = instance_descriptors()->GetDetails(i);
3599 if (FLAG_track_fields && details.representation().IsSmi()) { 3609 if (FLAG_track_fields && details.representation().IsSmi()) {
3600 return true; 3610 return true;
3601 } 3611 }
3602 if (FLAG_track_double_fields && details.representation().IsDouble()) { 3612 if (FLAG_track_double_fields && details.representation().IsDouble()) {
3603 return true; 3613 return true;
3604 } 3614 }
(...skipping 2597 matching lines...) Expand 10 before | Expand all | Expand 10 after
6202 #undef WRITE_UINT32_FIELD 6212 #undef WRITE_UINT32_FIELD
6203 #undef READ_SHORT_FIELD 6213 #undef READ_SHORT_FIELD
6204 #undef WRITE_SHORT_FIELD 6214 #undef WRITE_SHORT_FIELD
6205 #undef READ_BYTE_FIELD 6215 #undef READ_BYTE_FIELD
6206 #undef WRITE_BYTE_FIELD 6216 #undef WRITE_BYTE_FIELD
6207 6217
6208 6218
6209 } } // namespace v8::internal 6219 } } // namespace v8::internal
6210 6220
6211 #endif // V8_OBJECTS_INL_H_ 6221 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/property-details.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698