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

Unified Diff: src/objects.h

Issue 18774002: Handlify JSReceiver/JSObject::DeleteProperty method. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Toon Verwaest. Created 7 years, 5 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/isolate.h ('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 231b69440299dadb7837501a03658534aa764c47..f2d0c014f0ecd4199f541f728395a2c360937691 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -1663,8 +1663,12 @@ class JSReceiver: public HeapObject {
MUST_USE_RESULT MaybeObject* SetPropertyWithDefinedSetter(JSReceiver* setter,
Object* value);
- MUST_USE_RESULT MaybeObject* DeleteProperty(Name* name, DeleteMode mode);
- MUST_USE_RESULT MaybeObject* DeleteElement(uint32_t index, DeleteMode mode);
+ static Handle<Object> DeleteProperty(Handle<JSReceiver> object,
+ Handle<Name> name,
+ DeleteMode mode = NORMAL_DELETION);
+ static Handle<Object> DeleteElement(Handle<JSReceiver> object,
+ uint32_t index,
+ DeleteMode mode);
// Set the index'th array element.
// Can cause GC, or return failure if GC is required.
@@ -1901,10 +1905,6 @@ class JSObject: public JSReceiver {
Object* value,
PropertyDetails details);
- // Deletes the named property in a normalized object.
- MUST_USE_RESULT MaybeObject* DeleteNormalizedProperty(Name* name,
- DeleteMode mode);
-
static void OptimizeAsPrototype(Handle<JSObject> object);
MUST_USE_RESULT MaybeObject* OptimizeAsPrototype();
@@ -1995,12 +1995,9 @@ class JSObject: public JSReceiver {
MUST_USE_RESULT MaybeObject* GetIdentityHash(CreationFlag flag);
MUST_USE_RESULT MaybeObject* SetIdentityHash(Smi* hash, CreationFlag flag);
- static Handle<Object> DeleteProperty(Handle<JSObject> obj,
- Handle<Name> name);
- // Can cause GC.
- MUST_USE_RESULT MaybeObject* DeleteProperty(Name* name, DeleteMode mode);
-
- static Handle<Object> DeleteElement(Handle<JSObject> obj, uint32_t index);
+ static Handle<Object> DeleteElement(Handle<JSObject> obj,
+ uint32_t index,
+ DeleteMode mode = NORMAL_DELETION);
MUST_USE_RESULT MaybeObject* DeleteElement(uint32_t index, DeleteMode mode);
inline void ValidateElements();
@@ -2430,6 +2427,7 @@ class JSObject: public JSReceiver {
private:
friend class DictionaryElementsAccessor;
+ friend class JSReceiver;
MUST_USE_RESULT MaybeObject* GetElementWithCallback(Object* receiver,
Object* structure,
@@ -2475,9 +2473,19 @@ class JSObject: public JSReceiver {
StrictModeFlag strict_mode,
bool* done);
- MUST_USE_RESULT MaybeObject* DeletePropertyPostInterceptor(Name* name,
- DeleteMode mode);
- MUST_USE_RESULT MaybeObject* DeletePropertyWithInterceptor(Name* name);
+ static Handle<Object> DeleteProperty(Handle<JSObject> object,
+ Handle<Name> name,
+ DeleteMode mode);
+ static Handle<Object> DeletePropertyPostInterceptor(Handle<JSObject> object,
+ Handle<Name> name,
+ DeleteMode mode);
+ static Handle<Object> DeletePropertyWithInterceptor(Handle<JSObject> object,
+ Handle<Name> name);
+
+ // Deletes the named property in a normalized object.
+ static Handle<Object> DeleteNormalizedProperty(Handle<JSObject> object,
+ Handle<Name> name,
+ DeleteMode mode);
MUST_USE_RESULT MaybeObject* DeleteElementWithInterceptor(uint32_t index);
@@ -5451,6 +5459,7 @@ class Map: public HeapObject {
MUST_USE_RESULT MaybeObject* RawCopy(int instance_size);
MUST_USE_RESULT MaybeObject* CopyWithPreallocatedFieldDescriptors();
+ static Handle<Map> CopyDropDescriptors(Handle<Map> map);
MUST_USE_RESULT MaybeObject* CopyDropDescriptors();
MUST_USE_RESULT MaybeObject* CopyReplaceDescriptors(
DescriptorArray* descriptors,
@@ -8662,13 +8671,6 @@ class JSProxy: public JSReceiver {
StrictModeFlag strict_mode,
bool* done);
- MUST_USE_RESULT MaybeObject* DeletePropertyWithHandler(
- Name* name,
- DeleteMode mode);
- MUST_USE_RESULT MaybeObject* DeleteElementWithHandler(
- uint32_t index,
- DeleteMode mode);
-
MUST_USE_RESULT PropertyAttributes GetPropertyAttributeWithHandler(
JSReceiver* receiver,
Name* name);
@@ -8712,6 +8714,15 @@ class JSProxy: public JSReceiver {
kSize> BodyDescriptor;
private:
+ friend class JSReceiver;
+
+ static Handle<Object> DeletePropertyWithHandler(Handle<JSProxy> object,
+ Handle<Name> name,
+ DeleteMode mode);
+ static Handle<Object> DeleteElementWithHandler(Handle<JSProxy> object,
+ uint32_t index,
+ DeleteMode mode);
+
DISALLOW_IMPLICIT_CONSTRUCTORS(JSProxy);
};
« no previous file with comments | « src/isolate.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698