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

Side by Side Diff: src/objects.h

Issue 8968042: Rollback 10309 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 11 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 | src/objects.cc » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1626 matching lines...) Expand 10 before | Expand all | Expand 10 after
1637 1637
1638 // Do we want to keep the elements in fast case when increasing the 1638 // Do we want to keep the elements in fast case when increasing the
1639 // capacity? 1639 // capacity?
1640 bool ShouldConvertToSlowElements(int new_capacity); 1640 bool ShouldConvertToSlowElements(int new_capacity);
1641 // Returns true if the backing storage for the slow-case elements of 1641 // Returns true if the backing storage for the slow-case elements of
1642 // this object takes up nearly as much space as a fast-case backing 1642 // this object takes up nearly as much space as a fast-case backing
1643 // storage would. In that case the JSObject should have fast 1643 // storage would. In that case the JSObject should have fast
1644 // elements. 1644 // elements.
1645 bool ShouldConvertToFastElements(); 1645 bool ShouldConvertToFastElements();
1646 // Returns true if the elements of JSObject contains only values that can be 1646 // Returns true if the elements of JSObject contains only values that can be
1647 // represented in a FixedDoubleArray and has at least one value that can only 1647 // represented in a FixedDoubleArray.
1648 // be represented as a double and not a Smi. 1648 bool CanConvertToFastDoubleElements();
1649 bool ShouldConvertToFastDoubleElements(bool* has_smi_only_elements);
1650 1649
1651 // Tells whether the index'th element is present. 1650 // Tells whether the index'th element is present.
1652 bool HasElementWithReceiver(JSReceiver* receiver, uint32_t index); 1651 bool HasElementWithReceiver(JSReceiver* receiver, uint32_t index);
1653 1652
1654 // Computes the new capacity when expanding the elements of a JSObject. 1653 // Computes the new capacity when expanding the elements of a JSObject.
1655 static int NewElementsCapacity(int old_capacity) { 1654 static int NewElementsCapacity(int old_capacity) {
1656 // (old_capacity + 50%) + 16 1655 // (old_capacity + 50%) + 16
1657 return old_capacity + (old_capacity >> 1) + 16; 1656 return old_capacity + (old_capacity >> 1) + 16;
1658 } 1657 }
1659 1658
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1702 Object* value, 1701 Object* value,
1703 StrictModeFlag strict_mode, 1702 StrictModeFlag strict_mode,
1704 bool check_prototype); 1703 bool check_prototype);
1705 1704
1706 // Returns the index'th element. 1705 // Returns the index'th element.
1707 // The undefined object if index is out of bounds. 1706 // The undefined object if index is out of bounds.
1708 MaybeObject* GetElementWithInterceptor(Object* receiver, uint32_t index); 1707 MaybeObject* GetElementWithInterceptor(Object* receiver, uint32_t index);
1709 1708
1710 enum SetFastElementsCapacityMode { 1709 enum SetFastElementsCapacityMode {
1711 kAllowSmiOnlyElements, 1710 kAllowSmiOnlyElements,
1712 kForceSmiOnlyElements,
1713 kDontAllowSmiOnlyElements 1711 kDontAllowSmiOnlyElements
1714 }; 1712 };
1715 1713
1716 // Replace the elements' backing store with fast elements of the given 1714 // Replace the elements' backing store with fast elements of the given
1717 // capacity. Update the length for JSArrays. Returns the new backing 1715 // capacity. Update the length for JSArrays. Returns the new backing
1718 // store. 1716 // store.
1719 MUST_USE_RESULT MaybeObject* SetFastElementsCapacityAndLength( 1717 MUST_USE_RESULT MaybeObject* SetFastElementsCapacityAndLength(
1720 int capacity, 1718 int capacity,
1721 int length, 1719 int length,
1722 SetFastElementsCapacityMode set_capacity_mode); 1720 SetFastElementsCapacityMode set_capacity_mode);
(...skipping 6280 matching lines...) Expand 10 before | Expand all | Expand 10 after
8003 } else { 8001 } else {
8004 value &= ~(1 << bit_position); 8002 value &= ~(1 << bit_position);
8005 } 8003 }
8006 return value; 8004 return value;
8007 } 8005 }
8008 }; 8006 };
8009 8007
8010 } } // namespace v8::internal 8008 } } // namespace v8::internal
8011 8009
8012 #endif // V8_OBJECTS_H_ 8010 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698