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

Side by Side Diff: src/objects.h

Issue 13064003: First steps towards implementing ArrayBuffer &co in V8 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added forgotten tests Created 7 years, 9 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 // 49 //
50 // Inheritance hierarchy: 50 // Inheritance hierarchy:
51 // - MaybeObject (an object or a failure) 51 // - MaybeObject (an object or a failure)
52 // - Failure (immediate for marking failed operation) 52 // - Failure (immediate for marking failed operation)
53 // - Object 53 // - Object
54 // - Smi (immediate small integer) 54 // - Smi (immediate small integer)
55 // - HeapObject (superclass for everything allocated in the heap) 55 // - HeapObject (superclass for everything allocated in the heap)
56 // - JSReceiver (suitable for property access) 56 // - JSReceiver (suitable for property access)
57 // - JSObject 57 // - JSObject
58 // - JSArray 58 // - JSArray
59 // - JSArrayBuffer
59 // - JSSet 60 // - JSSet
60 // - JSMap 61 // - JSMap
61 // - JSWeakMap 62 // - JSWeakMap
62 // - JSRegExp 63 // - JSRegExp
63 // - JSFunction 64 // - JSFunction
64 // - JSModule 65 // - JSModule
65 // - GlobalObject 66 // - GlobalObject
66 // - JSGlobalObject 67 // - JSGlobalObject
67 // - JSBuiltinsObject 68 // - JSBuiltinsObject
68 // - JSGlobalProxy 69 // - JSGlobalProxy
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 \ 393 \
393 V(JS_VALUE_TYPE) \ 394 V(JS_VALUE_TYPE) \
394 V(JS_DATE_TYPE) \ 395 V(JS_DATE_TYPE) \
395 V(JS_OBJECT_TYPE) \ 396 V(JS_OBJECT_TYPE) \
396 V(JS_CONTEXT_EXTENSION_OBJECT_TYPE) \ 397 V(JS_CONTEXT_EXTENSION_OBJECT_TYPE) \
397 V(JS_MODULE_TYPE) \ 398 V(JS_MODULE_TYPE) \
398 V(JS_GLOBAL_OBJECT_TYPE) \ 399 V(JS_GLOBAL_OBJECT_TYPE) \
399 V(JS_BUILTINS_OBJECT_TYPE) \ 400 V(JS_BUILTINS_OBJECT_TYPE) \
400 V(JS_GLOBAL_PROXY_TYPE) \ 401 V(JS_GLOBAL_PROXY_TYPE) \
401 V(JS_ARRAY_TYPE) \ 402 V(JS_ARRAY_TYPE) \
403 V(JS_ARRAY_BUFFER_TYPE) \
402 V(JS_PROXY_TYPE) \ 404 V(JS_PROXY_TYPE) \
403 V(JS_WEAK_MAP_TYPE) \ 405 V(JS_WEAK_MAP_TYPE) \
404 V(JS_REGEXP_TYPE) \ 406 V(JS_REGEXP_TYPE) \
405 \ 407 \
406 V(JS_FUNCTION_TYPE) \ 408 V(JS_FUNCTION_TYPE) \
407 V(JS_FUNCTION_PROXY_TYPE) \ 409 V(JS_FUNCTION_PROXY_TYPE) \
408 410
409 #ifdef ENABLE_DEBUGGER_SUPPORT 411 #ifdef ENABLE_DEBUGGER_SUPPORT
410 #define INSTANCE_TYPE_LIST_DEBUGGER(V) \ 412 #define INSTANCE_TYPE_LIST_DEBUGGER(V) \
411 V(DEBUG_INFO_TYPE) \ 413 V(DEBUG_INFO_TYPE) \
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 724
723 JS_VALUE_TYPE, // FIRST_JS_OBJECT_TYPE 725 JS_VALUE_TYPE, // FIRST_JS_OBJECT_TYPE
724 JS_DATE_TYPE, 726 JS_DATE_TYPE,
725 JS_OBJECT_TYPE, 727 JS_OBJECT_TYPE,
726 JS_CONTEXT_EXTENSION_OBJECT_TYPE, 728 JS_CONTEXT_EXTENSION_OBJECT_TYPE,
727 JS_MODULE_TYPE, 729 JS_MODULE_TYPE,
728 JS_GLOBAL_OBJECT_TYPE, 730 JS_GLOBAL_OBJECT_TYPE,
729 JS_BUILTINS_OBJECT_TYPE, 731 JS_BUILTINS_OBJECT_TYPE,
730 JS_GLOBAL_PROXY_TYPE, 732 JS_GLOBAL_PROXY_TYPE,
731 JS_ARRAY_TYPE, 733 JS_ARRAY_TYPE,
734 JS_ARRAY_BUFFER_TYPE,
732 JS_SET_TYPE, 735 JS_SET_TYPE,
733 JS_MAP_TYPE, 736 JS_MAP_TYPE,
734 JS_WEAK_MAP_TYPE, 737 JS_WEAK_MAP_TYPE,
735 738
736 JS_REGEXP_TYPE, 739 JS_REGEXP_TYPE,
737 740
738 JS_FUNCTION_TYPE, // LAST_JS_OBJECT_TYPE, LAST_JS_RECEIVER_TYPE 741 JS_FUNCTION_TYPE, // LAST_JS_OBJECT_TYPE, LAST_JS_RECEIVER_TYPE
739 742
740 // Pseudo-types 743 // Pseudo-types
741 FIRST_TYPE = 0x0, 744 FIRST_TYPE = 0x0,
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 V(Code) \ 970 V(Code) \
968 V(Oddball) \ 971 V(Oddball) \
969 V(SharedFunctionInfo) \ 972 V(SharedFunctionInfo) \
970 V(JSValue) \ 973 V(JSValue) \
971 V(JSDate) \ 974 V(JSDate) \
972 V(JSMessageObject) \ 975 V(JSMessageObject) \
973 V(StringWrapper) \ 976 V(StringWrapper) \
974 V(Foreign) \ 977 V(Foreign) \
975 V(Boolean) \ 978 V(Boolean) \
976 V(JSArray) \ 979 V(JSArray) \
980 V(JSArrayBuffer) \
977 V(JSProxy) \ 981 V(JSProxy) \
978 V(JSFunctionProxy) \ 982 V(JSFunctionProxy) \
979 V(JSSet) \ 983 V(JSSet) \
980 V(JSMap) \ 984 V(JSMap) \
981 V(JSWeakMap) \ 985 V(JSWeakMap) \
982 V(JSRegExp) \ 986 V(JSRegExp) \
983 V(HashTable) \ 987 V(HashTable) \
984 V(Dictionary) \ 988 V(Dictionary) \
985 V(StringTable) \ 989 V(StringTable) \
986 V(JSFunctionResultCache) \ 990 V(JSFunctionResultCache) \
(...skipping 7478 matching lines...) Expand 10 before | Expand all | Expand 10 after
8465 8469
8466 static const int kTableOffset = JSObject::kHeaderSize; 8470 static const int kTableOffset = JSObject::kHeaderSize;
8467 static const int kNextOffset = kTableOffset + kPointerSize; 8471 static const int kNextOffset = kTableOffset + kPointerSize;
8468 static const int kSize = kNextOffset + kPointerSize; 8472 static const int kSize = kNextOffset + kPointerSize;
8469 8473
8470 private: 8474 private:
8471 DISALLOW_IMPLICIT_CONSTRUCTORS(JSWeakMap); 8475 DISALLOW_IMPLICIT_CONSTRUCTORS(JSWeakMap);
8472 }; 8476 };
8473 8477
8474 8478
8479 class JSArrayBuffer: public JSObject {
8480 public:
8481 // [backing_store]: backing memory for thsi array
8482 DECL_ACCESSORS(backing_store, void)
8483
8484 // [byte_length]: length in bytes
8485 DECL_ACCESSORS(byte_length, Object)
8486
8487 // Casting.
8488 static inline JSArrayBuffer* cast(Object* obj);
8489
8490 // Dispatched behavior.
8491 DECLARE_PRINTER(JSArrayBuffer)
8492 DECLARE_VERIFIER(JSArrayBuffer)
8493
8494 static const int kBackingStoreOffset = JSObject::kHeaderSize;
8495 static const int kByteLengthOffset = kBackingStoreOffset + kPointerSize;
8496 static const int kSize = kByteLengthOffset + kPointerSize;
8497
8498 private:
8499 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArrayBuffer);
8500 };
8501
8502
8475 // Foreign describes objects pointing from JavaScript to C structures. 8503 // Foreign describes objects pointing from JavaScript to C structures.
8476 // Since they cannot contain references to JS HeapObjects they can be 8504 // Since they cannot contain references to JS HeapObjects they can be
8477 // placed in old_data_space. 8505 // placed in old_data_space.
8478 class Foreign: public HeapObject { 8506 class Foreign: public HeapObject {
8479 public: 8507 public:
8480 // [address]: field containing the address. 8508 // [address]: field containing the address.
8481 inline Address foreign_address(); 8509 inline Address foreign_address();
8482 inline void set_foreign_address(Address value); 8510 inline void set_foreign_address(Address value);
8483 8511
8484 // Casting. 8512 // Casting.
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
9269 } else { 9297 } else {
9270 value &= ~(1 << bit_position); 9298 value &= ~(1 << bit_position);
9271 } 9299 }
9272 return value; 9300 return value;
9273 } 9301 }
9274 }; 9302 };
9275 9303
9276 } } // namespace v8::internal 9304 } } // namespace v8::internal
9277 9305
9278 #endif // V8_OBJECTS_H_ 9306 #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