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

Side by Side Diff: src/objects.cc

Issue 3262001: Check result of JSObject::NormalizeProperties() in JSObject::PreventExtension... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 3 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 | « no previous file | test/mjsunit/regress/regress-851.js » ('j') | test/mjsunit/regress/regress-851.js » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 2665 matching lines...) Expand 10 before | Expand all | Expand 10 after
2676 } 2676 }
2677 2677
2678 // No references to object. 2678 // No references to object.
2679 return false; 2679 return false;
2680 } 2680 }
2681 2681
2682 2682
2683 Object* JSObject::PreventExtensions() { 2683 Object* JSObject::PreventExtensions() {
2684 // If there are fast elements we normalize. 2684 // If there are fast elements we normalize.
2685 if (HasFastElements()) { 2685 if (HasFastElements()) {
2686 NormalizeElements(); 2686 Object* ok = NormalizeElements();
2687 if (ok->IsFailure()) return ok;
2687 } 2688 }
2688 // Make sure that we never go back to fast case. 2689 // Make sure that we never go back to fast case.
2689 element_dictionary()->set_requires_slow_elements(); 2690 element_dictionary()->set_requires_slow_elements();
2690 2691
2691 // Do a map transition, other objects with this map may still 2692 // Do a map transition, other objects with this map may still
2692 // be extensible. 2693 // be extensible.
2693 Object* new_map = map()->CopyDropTransitions(); 2694 Object* new_map = map()->CopyDropTransitions();
2694 if (new_map->IsFailure()) return new_map; 2695 if (new_map->IsFailure()) return new_map;
2695 Map::cast(new_map)->set_is_extensible(false); 2696 Map::cast(new_map)->set_is_extensible(false);
2696 set_map(Map::cast(new_map)); 2697 set_map(Map::cast(new_map));
(...skipping 6190 matching lines...) Expand 10 before | Expand all | Expand 10 after
8887 if (break_point_objects()->IsUndefined()) return 0; 8888 if (break_point_objects()->IsUndefined()) return 0;
8888 // Single beak point. 8889 // Single beak point.
8889 if (!break_point_objects()->IsFixedArray()) return 1; 8890 if (!break_point_objects()->IsFixedArray()) return 1;
8890 // Multiple break points. 8891 // Multiple break points.
8891 return FixedArray::cast(break_point_objects())->length(); 8892 return FixedArray::cast(break_point_objects())->length();
8892 } 8893 }
8893 #endif 8894 #endif
8894 8895
8895 8896
8896 } } // namespace v8::internal 8897 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-851.js » ('j') | test/mjsunit/regress/regress-851.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698