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

Unified Diff: src/objects.h

Issue 14888005: Make Object.freeze fast (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Handle review comments 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 6787da5ce8663365214418d23f280e25629c0c9b..69f27ba9adf5e6ff941cb23786049f8c16d77781 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -2295,6 +2295,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);
@@ -2832,7 +2835,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();
@@ -3367,8 +3376,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);
@@ -5069,6 +5080,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
@@ -5371,6 +5383,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();
@@ -5386,9 +5400,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