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

Side by Side Diff: src/objects.h

Issue 7369001: Implement delete trap for proxies. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed Mads' comments. Created 9 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 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 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after
1352 1352
1353 private: 1353 private:
1354 DISALLOW_IMPLICIT_CONSTRUCTORS(HeapNumber); 1354 DISALLOW_IMPLICIT_CONSTRUCTORS(HeapNumber);
1355 }; 1355 };
1356 1356
1357 1357
1358 // JSReceiver includes types on which properties can be defined, i.e., 1358 // JSReceiver includes types on which properties can be defined, i.e.,
1359 // JSObject and JSProxy. 1359 // JSObject and JSProxy.
1360 class JSReceiver: public HeapObject { 1360 class JSReceiver: public HeapObject {
1361 public: 1361 public:
1362 enum DeleteMode {
1363 NORMAL_DELETION,
1364 STRICT_DELETION,
1365 FORCE_DELETION
1366 };
1367
1362 // Casting. 1368 // Casting.
1363 static inline JSReceiver* cast(Object* obj); 1369 static inline JSReceiver* cast(Object* obj);
1364 1370
1365 // Can cause GC. 1371 // Can cause GC.
1366 MUST_USE_RESULT MaybeObject* SetProperty(String* key, 1372 MUST_USE_RESULT MaybeObject* SetProperty(String* key,
1367 Object* value, 1373 Object* value,
1368 PropertyAttributes attributes, 1374 PropertyAttributes attributes,
1369 StrictModeFlag strict_mode); 1375 StrictModeFlag strict_mode);
1370 MUST_USE_RESULT MaybeObject* SetProperty(LookupResult* result, 1376 MUST_USE_RESULT MaybeObject* SetProperty(LookupResult* result,
1371 String* key, 1377 String* key,
1372 Object* value, 1378 Object* value,
1373 PropertyAttributes attributes, 1379 PropertyAttributes attributes,
1374 StrictModeFlag strict_mode); 1380 StrictModeFlag strict_mode);
1375 1381
1382 MUST_USE_RESULT MaybeObject* DeleteProperty(String* name, DeleteMode mode);
1383
1376 // Returns the class name ([[Class]] property in the specification). 1384 // Returns the class name ([[Class]] property in the specification).
1377 String* class_name(); 1385 String* class_name();
1378 1386
1379 // Returns the constructor name (the name (possibly, inferred name) of the 1387 // Returns the constructor name (the name (possibly, inferred name) of the
1380 // function that was used to instantiate the object). 1388 // function that was used to instantiate the object).
1381 String* constructor_name(); 1389 String* constructor_name();
1382 1390
1383 inline PropertyAttributes GetPropertyAttribute(String* name); 1391 inline PropertyAttributes GetPropertyAttribute(String* name);
1384 PropertyAttributes GetPropertyAttributeWithReceiver(JSReceiver* receiver, 1392 PropertyAttributes GetPropertyAttributeWithReceiver(JSReceiver* receiver,
1385 String* name); 1393 String* name);
(...skipping 29 matching lines...) Expand all
1415 1423
1416 DISALLOW_IMPLICIT_CONSTRUCTORS(JSReceiver); 1424 DISALLOW_IMPLICIT_CONSTRUCTORS(JSReceiver);
1417 }; 1425 };
1418 1426
1419 // The JSObject describes real heap allocated JavaScript objects with 1427 // The JSObject describes real heap allocated JavaScript objects with
1420 // properties. 1428 // properties.
1421 // Note that the map of JSObject changes during execution to enable inline 1429 // Note that the map of JSObject changes during execution to enable inline
1422 // caching. 1430 // caching.
1423 class JSObject: public JSReceiver { 1431 class JSObject: public JSReceiver {
1424 public: 1432 public:
1425 enum DeleteMode {
1426 NORMAL_DELETION,
1427 STRICT_DELETION,
1428 FORCE_DELETION
1429 };
1430
1431 enum ElementsKind { 1433 enum ElementsKind {
1432 // The "fast" kind for tagged values. Must be first to make it possible 1434 // The "fast" kind for tagged values. Must be first to make it possible
1433 // to efficiently check maps if they have fast elements. 1435 // to efficiently check maps if they have fast elements.
1434 FAST_ELEMENTS, 1436 FAST_ELEMENTS,
1435 1437
1436 // The "fast" kind for unwrapped, non-tagged double values. 1438 // The "fast" kind for unwrapped, non-tagged double values.
1437 FAST_DOUBLE_ELEMENTS, 1439 FAST_DOUBLE_ELEMENTS,
1438 1440
1439 // The "slow" kind. 1441 // The "slow" kind.
1440 DICTIONARY_ELEMENTS, 1442 DICTIONARY_ELEMENTS,
(...skipping 5043 matching lines...) Expand 10 before | Expand all | Expand 10 after
6484 // The JSProxy describes EcmaScript Harmony proxies 6486 // The JSProxy describes EcmaScript Harmony proxies
6485 class JSProxy: public JSReceiver { 6487 class JSProxy: public JSReceiver {
6486 public: 6488 public:
6487 // [handler]: The handler property. 6489 // [handler]: The handler property.
6488 DECL_ACCESSORS(handler, Object) 6490 DECL_ACCESSORS(handler, Object)
6489 6491
6490 // Casting. 6492 // Casting.
6491 static inline JSProxy* cast(Object* obj); 6493 static inline JSProxy* cast(Object* obj);
6492 6494
6493 MUST_USE_RESULT MaybeObject* SetPropertyWithHandler( 6495 MUST_USE_RESULT MaybeObject* SetPropertyWithHandler(
6494 String* name_raw, 6496 String* name,
6495 Object* value_raw, 6497 Object* value,
6496 PropertyAttributes attributes, 6498 PropertyAttributes attributes,
6497 StrictModeFlag strict_mode); 6499 StrictModeFlag strict_mode);
6498 6500
6501 MUST_USE_RESULT MaybeObject* DeletePropertyWithHandler(
6502 String* name,
6503 DeleteMode mode);
6504
6499 MUST_USE_RESULT PropertyAttributes GetPropertyAttributeWithHandler( 6505 MUST_USE_RESULT PropertyAttributes GetPropertyAttributeWithHandler(
6500 JSReceiver* receiver, 6506 JSReceiver* receiver,
6501 String* name_raw, 6507 String* name,
6502 bool* has_exception); 6508 bool* has_exception);
6503 6509
6504 // Dispatched behavior. 6510 // Dispatched behavior.
6505 #ifdef OBJECT_PRINT 6511 #ifdef OBJECT_PRINT
6506 inline void JSProxyPrint() { 6512 inline void JSProxyPrint() {
6507 JSProxyPrint(stdout); 6513 JSProxyPrint(stdout);
6508 } 6514 }
6509 void JSProxyPrint(FILE* out); 6515 void JSProxyPrint(FILE* out);
6510 #endif 6516 #endif
6511 #ifdef DEBUG 6517 #ifdef DEBUG
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
7172 } else { 7178 } else {
7173 value &= ~(1 << bit_position); 7179 value &= ~(1 << bit_position);
7174 } 7180 }
7175 return value; 7181 return value;
7176 } 7182 }
7177 }; 7183 };
7178 7184
7179 } } // namespace v8::internal 7185 } } // namespace v8::internal
7180 7186
7181 #endif // V8_OBJECTS_H_ 7187 #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