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

Side by Side Diff: src/objects.h

Issue 7529007: Preliminary Harmony weak maps API implementation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Make sure the constructor can be called directly. Created 9 years, 4 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 | « src/messages.js ('k') | 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 // 44 //
45 // Inheritance hierarchy: 45 // Inheritance hierarchy:
46 // - MaybeObject (an object or a failure) 46 // - MaybeObject (an object or a failure)
47 // - Failure (immediate for marking failed operation) 47 // - Failure (immediate for marking failed operation)
48 // - Object 48 // - Object
49 // - Smi (immediate small integer) 49 // - Smi (immediate small integer)
50 // - HeapObject (superclass for everything allocated in the heap) 50 // - HeapObject (superclass for everything allocated in the heap)
51 // - JSReceiver (suitable for property access) 51 // - JSReceiver (suitable for property access)
52 // - JSObject 52 // - JSObject
53 // - JSArray 53 // - JSArray
54 // - JSWeakMap
54 // - JSRegExp 55 // - JSRegExp
55 // - JSFunction 56 // - JSFunction
56 // - GlobalObject 57 // - GlobalObject
57 // - JSGlobalObject 58 // - JSGlobalObject
58 // - JSBuiltinsObject 59 // - JSBuiltinsObject
59 // - JSGlobalProxy 60 // - JSGlobalProxy
60 // - JSValue 61 // - JSValue
61 // - JSMessageObject 62 // - JSMessageObject
62 // - JSProxy 63 // - JSProxy
63 // - JSFunctionProxy 64 // - JSFunctionProxy
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 V(JS_MESSAGE_OBJECT_TYPE) \ 325 V(JS_MESSAGE_OBJECT_TYPE) \
325 \ 326 \
326 V(JS_VALUE_TYPE) \ 327 V(JS_VALUE_TYPE) \
327 V(JS_OBJECT_TYPE) \ 328 V(JS_OBJECT_TYPE) \
328 V(JS_CONTEXT_EXTENSION_OBJECT_TYPE) \ 329 V(JS_CONTEXT_EXTENSION_OBJECT_TYPE) \
329 V(JS_GLOBAL_OBJECT_TYPE) \ 330 V(JS_GLOBAL_OBJECT_TYPE) \
330 V(JS_BUILTINS_OBJECT_TYPE) \ 331 V(JS_BUILTINS_OBJECT_TYPE) \
331 V(JS_GLOBAL_PROXY_TYPE) \ 332 V(JS_GLOBAL_PROXY_TYPE) \
332 V(JS_ARRAY_TYPE) \ 333 V(JS_ARRAY_TYPE) \
333 V(JS_PROXY_TYPE) \ 334 V(JS_PROXY_TYPE) \
335 V(JS_WEAK_MAP_TYPE) \
334 V(JS_REGEXP_TYPE) \ 336 V(JS_REGEXP_TYPE) \
335 \ 337 \
336 V(JS_FUNCTION_TYPE) \ 338 V(JS_FUNCTION_TYPE) \
337 V(JS_FUNCTION_PROXY_TYPE) \ 339 V(JS_FUNCTION_PROXY_TYPE) \
338 340
339 #ifdef ENABLE_DEBUGGER_SUPPORT 341 #ifdef ENABLE_DEBUGGER_SUPPORT
340 #define INSTANCE_TYPE_LIST_DEBUGGER(V) \ 342 #define INSTANCE_TYPE_LIST_DEBUGGER(V) \
341 V(DEBUG_INFO_TYPE) \ 343 V(DEBUG_INFO_TYPE) \
342 V(BREAK_POINT_INFO_TYPE) 344 V(BREAK_POINT_INFO_TYPE)
343 #else 345 #else
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 JS_MESSAGE_OBJECT_TYPE, 563 JS_MESSAGE_OBJECT_TYPE,
562 564
563 JS_VALUE_TYPE, // FIRST_NON_CALLABLE_OBJECT_TYPE, FIRST_JS_RECEIVER_TYPE 565 JS_VALUE_TYPE, // FIRST_NON_CALLABLE_OBJECT_TYPE, FIRST_JS_RECEIVER_TYPE
564 JS_OBJECT_TYPE, 566 JS_OBJECT_TYPE,
565 JS_CONTEXT_EXTENSION_OBJECT_TYPE, 567 JS_CONTEXT_EXTENSION_OBJECT_TYPE,
566 JS_GLOBAL_OBJECT_TYPE, 568 JS_GLOBAL_OBJECT_TYPE,
567 JS_BUILTINS_OBJECT_TYPE, 569 JS_BUILTINS_OBJECT_TYPE,
568 JS_GLOBAL_PROXY_TYPE, 570 JS_GLOBAL_PROXY_TYPE,
569 JS_ARRAY_TYPE, 571 JS_ARRAY_TYPE,
570 JS_PROXY_TYPE, 572 JS_PROXY_TYPE,
573 JS_WEAK_MAP_TYPE,
571 574
572 JS_REGEXP_TYPE, // LAST_NONCALLABLE_SPEC_OBJECT_TYPE 575 JS_REGEXP_TYPE, // LAST_NONCALLABLE_SPEC_OBJECT_TYPE
573 576
574 JS_FUNCTION_TYPE, // FIRST_CALLABLE_SPEC_OBJECT_TYPE 577 JS_FUNCTION_TYPE, // FIRST_CALLABLE_SPEC_OBJECT_TYPE
575 JS_FUNCTION_PROXY_TYPE, // LAST_CALLABLE_SPEC_OBJECT_TYPE 578 JS_FUNCTION_PROXY_TYPE, // LAST_CALLABLE_SPEC_OBJECT_TYPE
576 579
577 // Pseudo-types 580 // Pseudo-types
578 FIRST_TYPE = 0x0, 581 FIRST_TYPE = 0x0,
579 LAST_TYPE = JS_FUNCTION_PROXY_TYPE, 582 LAST_TYPE = JS_FUNCTION_PROXY_TYPE,
580 INVALID_TYPE = FIRST_TYPE - 1, 583 INVALID_TYPE = FIRST_TYPE - 1,
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 V(Oddball) \ 744 V(Oddball) \
742 V(SharedFunctionInfo) \ 745 V(SharedFunctionInfo) \
743 V(JSValue) \ 746 V(JSValue) \
744 V(JSMessageObject) \ 747 V(JSMessageObject) \
745 V(StringWrapper) \ 748 V(StringWrapper) \
746 V(Foreign) \ 749 V(Foreign) \
747 V(Boolean) \ 750 V(Boolean) \
748 V(JSArray) \ 751 V(JSArray) \
749 V(JSProxy) \ 752 V(JSProxy) \
750 V(JSFunctionProxy) \ 753 V(JSFunctionProxy) \
754 V(JSWeakMap) \
751 V(JSRegExp) \ 755 V(JSRegExp) \
752 V(HashTable) \ 756 V(HashTable) \
753 V(Dictionary) \ 757 V(Dictionary) \
754 V(SymbolTable) \ 758 V(SymbolTable) \
755 V(JSFunctionResultCache) \ 759 V(JSFunctionResultCache) \
756 V(NormalizedMapCache) \ 760 V(NormalizedMapCache) \
757 V(CompilationCacheTable) \ 761 V(CompilationCacheTable) \
758 V(CodeCacheHashTable) \ 762 V(CodeCacheHashTable) \
759 V(PolymorphicCodeCacheHashTable) \ 763 V(PolymorphicCodeCacheHashTable) \
760 V(MapCache) \ 764 V(MapCache) \
(...skipping 5850 matching lines...) Expand 10 before | Expand all | Expand 10 after
6611 class JSFunctionProxy: public JSProxy { 6615 class JSFunctionProxy: public JSProxy {
6612 public: 6616 public:
6613 // Casting. 6617 // Casting.
6614 static inline JSFunctionProxy* cast(Object* obj); 6618 static inline JSFunctionProxy* cast(Object* obj);
6615 6619
6616 private: 6620 private:
6617 DISALLOW_IMPLICIT_CONSTRUCTORS(JSFunctionProxy); 6621 DISALLOW_IMPLICIT_CONSTRUCTORS(JSFunctionProxy);
6618 }; 6622 };
6619 6623
6620 6624
6625 // The JSWeakMap describes EcmaScript Harmony weak maps
6626 class JSWeakMap: public JSObject {
6627 public:
6628 // [table]: the backing hash table mapping keys to values.
6629 DECL_ACCESSORS(table, ObjectHashTable)
6630
6631 // Casting.
6632 static inline JSWeakMap* cast(Object* obj);
6633
6634 #ifdef OBJECT_PRINT
6635 inline void JSWeakMapPrint() {
6636 JSWeakMapPrint(stdout);
6637 }
6638 void JSWeakMapPrint(FILE* out);
6639 #endif
6640 #ifdef DEBUG
6641 void JSWeakMapVerify();
6642 #endif
6643
6644 static const int kTableOffset = JSObject::kHeaderSize;
6645 static const int kSize = kTableOffset + kPointerSize;
6646
6647 private:
6648 DISALLOW_IMPLICIT_CONSTRUCTORS(JSWeakMap);
6649 };
6650
6651
6621 // Foreign describes objects pointing from JavaScript to C structures. 6652 // Foreign describes objects pointing from JavaScript to C structures.
6622 // Since they cannot contain references to JS HeapObjects they can be 6653 // Since they cannot contain references to JS HeapObjects they can be
6623 // placed in old_data_space. 6654 // placed in old_data_space.
6624 class Foreign: public HeapObject { 6655 class Foreign: public HeapObject {
6625 public: 6656 public:
6626 // [address]: field containing the address. 6657 // [address]: field containing the address.
6627 inline Address address(); 6658 inline Address address();
6628 inline void set_address(Address value); 6659 inline void set_address(Address value);
6629 6660
6630 // Casting. 6661 // Casting.
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
7254 } else { 7285 } else {
7255 value &= ~(1 << bit_position); 7286 value &= ~(1 << bit_position);
7256 } 7287 }
7257 return value; 7288 return value;
7258 } 7289 }
7259 }; 7290 };
7260 7291
7261 } } // namespace v8::internal 7292 } } // namespace v8::internal
7262 7293
7263 #endif // V8_OBJECTS_H_ 7294 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/messages.js ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698