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

Unified Diff: src/objects.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 441c6ef4e4b7ff222097d90c0021eeb19e5be298..d27af577387e7081b3bbf3ad416cb551342a5fa3 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -2297,6 +2297,9 @@ class JSObject: public JSReceiver {
static Handle<Object> PreventExtensions(Handle<JSObject> object);
MUST_USE_RESULT MaybeObject* PreventExtensions();
+ // ES5 Object.freeze
+ MUST_USE_RESULT MaybeObject* Freeze(Isolate* isolate);
+
// Copy object
MUST_USE_RESULT MaybeObject* DeepCopy(Isolate* isolate);
@@ -2834,7 +2837,13 @@ class DescriptorArray: public FixedArray {
int new_size,
DescriptorArray* other);
- MUST_USE_RESULT MaybeObject* CopyUpTo(int enumeration_index);
+ MUST_USE_RESULT MaybeObject* CopyUpTo(int enumeration_index) {
+ return CopyUpToAddAttributes(enumeration_index, NONE);
+ }
+
+ MUST_USE_RESULT MaybeObject* CopyUpToAddAttributes(
+ int enumeration_index,
+ PropertyAttributes attributes);
// Sort the instance descriptors by the hash codes of their keys.
void Sort();
@@ -3369,8 +3378,10 @@ class Dictionary: public HashTable<Shape, Key> {
}
// Returns a new array for dictionary usage. Might return Failure.
- MUST_USE_RESULT static MaybeObject* Allocate(Heap* heap,
- int at_least_space_for);
+ MUST_USE_RESULT static MaybeObject* Allocate(
+ Heap* heap,
+ int at_least_space_for,
+ PretenureFlag pretenure = NOT_TENURED);
// Ensure enough space for n additional elements.
MUST_USE_RESULT MaybeObject* EnsureCapacity(int n, Key key);
@@ -5071,6 +5082,7 @@ class Map: public HeapObject {
class OwnsDescriptors: public BitField<bool, 25, 1> {};
class IsObserved: public BitField<bool, 26, 1> {};
class Deprecated: public BitField<bool, 27, 1> {};
+ class IsFrozen: public BitField<bool, 28, 1> {};
// Tells whether the object in the prototype property will be used
// for instances created from this function. If the prototype
@@ -5373,6 +5385,8 @@ class Map: public HeapObject {
inline void set_owns_descriptors(bool is_shared);
inline bool is_observed();
inline void set_is_observed(bool is_observed);
+ inline void freeze();
+ inline bool is_frozen();
inline void deprecate();
inline bool is_deprecated();
inline bool CanBeDeprecated();
@@ -5387,9 +5401,9 @@ class Map: public HeapObject {
MUST_USE_RESULT MaybeObject* CopyDropDescriptors();
MUST_USE_RESULT MaybeObject* CopyReplaceDescriptors(
DescriptorArray* descriptors,
- Name* name,
TransitionFlag flag,
- int descriptor_index);
+ Name* name = NULL,
+ SimpleTransitionFlag simple_flag = FULL_TRANSITION);
MUST_USE_RESULT MaybeObject* CopyInstallDescriptors(
int new_descriptor,
DescriptorArray* descriptors);
« no previous file with comments | « src/heap.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698