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

Side by Side Diff: src/objects.h

Issue 13975012: First cut at impementing ES6 TypedArrays in V8. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: CR feedback Created 7 years, 8 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // - JSArrayBuffer
60 // - JSTypedArray
60 // - JSSet 61 // - JSSet
61 // - JSMap 62 // - JSMap
62 // - JSWeakMap 63 // - JSWeakMap
63 // - JSRegExp 64 // - JSRegExp
64 // - JSFunction 65 // - JSFunction
65 // - JSModule 66 // - JSModule
66 // - GlobalObject 67 // - GlobalObject
67 // - JSGlobalObject 68 // - JSGlobalObject
68 // - JSBuiltinsObject 69 // - JSBuiltinsObject
69 // - JSGlobalProxy 70 // - JSGlobalProxy
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 V(JS_VALUE_TYPE) \ 395 V(JS_VALUE_TYPE) \
395 V(JS_DATE_TYPE) \ 396 V(JS_DATE_TYPE) \
396 V(JS_OBJECT_TYPE) \ 397 V(JS_OBJECT_TYPE) \
397 V(JS_CONTEXT_EXTENSION_OBJECT_TYPE) \ 398 V(JS_CONTEXT_EXTENSION_OBJECT_TYPE) \
398 V(JS_MODULE_TYPE) \ 399 V(JS_MODULE_TYPE) \
399 V(JS_GLOBAL_OBJECT_TYPE) \ 400 V(JS_GLOBAL_OBJECT_TYPE) \
400 V(JS_BUILTINS_OBJECT_TYPE) \ 401 V(JS_BUILTINS_OBJECT_TYPE) \
401 V(JS_GLOBAL_PROXY_TYPE) \ 402 V(JS_GLOBAL_PROXY_TYPE) \
402 V(JS_ARRAY_TYPE) \ 403 V(JS_ARRAY_TYPE) \
403 V(JS_ARRAY_BUFFER_TYPE) \ 404 V(JS_ARRAY_BUFFER_TYPE) \
405 V(JS_TYPED_ARRAY_TYPE) \
404 V(JS_PROXY_TYPE) \ 406 V(JS_PROXY_TYPE) \
405 V(JS_WEAK_MAP_TYPE) \ 407 V(JS_WEAK_MAP_TYPE) \
406 V(JS_REGEXP_TYPE) \ 408 V(JS_REGEXP_TYPE) \
407 \ 409 \
408 V(JS_FUNCTION_TYPE) \ 410 V(JS_FUNCTION_TYPE) \
409 V(JS_FUNCTION_PROXY_TYPE) \ 411 V(JS_FUNCTION_PROXY_TYPE) \
410 412
411 #ifdef ENABLE_DEBUGGER_SUPPORT 413 #ifdef ENABLE_DEBUGGER_SUPPORT
412 #define INSTANCE_TYPE_LIST_DEBUGGER(V) \ 414 #define INSTANCE_TYPE_LIST_DEBUGGER(V) \
413 V(DEBUG_INFO_TYPE) \ 415 V(DEBUG_INFO_TYPE) \
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 JS_VALUE_TYPE, // FIRST_JS_OBJECT_TYPE 727 JS_VALUE_TYPE, // FIRST_JS_OBJECT_TYPE
726 JS_DATE_TYPE, 728 JS_DATE_TYPE,
727 JS_OBJECT_TYPE, 729 JS_OBJECT_TYPE,
728 JS_CONTEXT_EXTENSION_OBJECT_TYPE, 730 JS_CONTEXT_EXTENSION_OBJECT_TYPE,
729 JS_MODULE_TYPE, 731 JS_MODULE_TYPE,
730 JS_GLOBAL_OBJECT_TYPE, 732 JS_GLOBAL_OBJECT_TYPE,
731 JS_BUILTINS_OBJECT_TYPE, 733 JS_BUILTINS_OBJECT_TYPE,
732 JS_GLOBAL_PROXY_TYPE, 734 JS_GLOBAL_PROXY_TYPE,
733 JS_ARRAY_TYPE, 735 JS_ARRAY_TYPE,
734 JS_ARRAY_BUFFER_TYPE, 736 JS_ARRAY_BUFFER_TYPE,
737 JS_TYPED_ARRAY_TYPE,
735 JS_SET_TYPE, 738 JS_SET_TYPE,
736 JS_MAP_TYPE, 739 JS_MAP_TYPE,
737 JS_WEAK_MAP_TYPE, 740 JS_WEAK_MAP_TYPE,
738 741
739 JS_REGEXP_TYPE, 742 JS_REGEXP_TYPE,
740 743
741 JS_FUNCTION_TYPE, // LAST_JS_OBJECT_TYPE, LAST_JS_RECEIVER_TYPE 744 JS_FUNCTION_TYPE, // LAST_JS_OBJECT_TYPE, LAST_JS_RECEIVER_TYPE
742 745
743 // Pseudo-types 746 // Pseudo-types
744 FIRST_TYPE = 0x0, 747 FIRST_TYPE = 0x0,
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 V(Oddball) \ 974 V(Oddball) \
972 V(SharedFunctionInfo) \ 975 V(SharedFunctionInfo) \
973 V(JSValue) \ 976 V(JSValue) \
974 V(JSDate) \ 977 V(JSDate) \
975 V(JSMessageObject) \ 978 V(JSMessageObject) \
976 V(StringWrapper) \ 979 V(StringWrapper) \
977 V(Foreign) \ 980 V(Foreign) \
978 V(Boolean) \ 981 V(Boolean) \
979 V(JSArray) \ 982 V(JSArray) \
980 V(JSArrayBuffer) \ 983 V(JSArrayBuffer) \
984 V(JSTypedArray) \
981 V(JSProxy) \ 985 V(JSProxy) \
982 V(JSFunctionProxy) \ 986 V(JSFunctionProxy) \
983 V(JSSet) \ 987 V(JSSet) \
984 V(JSMap) \ 988 V(JSMap) \
985 V(JSWeakMap) \ 989 V(JSWeakMap) \
986 V(JSRegExp) \ 990 V(JSRegExp) \
987 V(HashTable) \ 991 V(HashTable) \
988 V(Dictionary) \ 992 V(Dictionary) \
989 V(StringTable) \ 993 V(StringTable) \
990 V(JSFunctionResultCache) \ 994 V(JSFunctionResultCache) \
(...skipping 7523 matching lines...) Expand 10 before | Expand all | Expand 10 after
8514 8518
8515 static const int kBackingStoreOffset = JSObject::kHeaderSize; 8519 static const int kBackingStoreOffset = JSObject::kHeaderSize;
8516 static const int kByteLengthOffset = kBackingStoreOffset + kPointerSize; 8520 static const int kByteLengthOffset = kBackingStoreOffset + kPointerSize;
8517 static const int kSize = kByteLengthOffset + kPointerSize; 8521 static const int kSize = kByteLengthOffset + kPointerSize;
8518 8522
8519 private: 8523 private:
8520 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArrayBuffer); 8524 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArrayBuffer);
8521 }; 8525 };
8522 8526
8523 8527
8528 class JSTypedArray: public JSObject {
8529 public:
8530 // [buffer]: ArrayBuffer that this typed array views.
8531 DECL_ACCESSORS(buffer, Object)
8532
8533 // [byte_length]: offset of typed array in bytes.
8534 DECL_ACCESSORS(byte_offset, Object)
8535
8536 // [byte_length]: length of typed array in bytes.
8537 DECL_ACCESSORS(byte_length, Object)
8538
8539 // [length]: length of typed array in elements.
8540 DECL_ACCESSORS(length, Object)
8541
8542 // Casting.
8543 static inline JSTypedArray* cast(Object* obj);
8544
8545 // Dispatched behavior.
8546 DECLARE_PRINTER(JSTypedArray)
8547 DECLARE_VERIFIER(JSTypedArray)
8548
8549 static const int kBufferOffset = JSObject::kHeaderSize;
8550 static const int kByteOffsetOffset = kBufferOffset + kPointerSize;
8551 static const int kByteLengthOffset = kByteOffsetOffset + kPointerSize;
8552 static const int kLengthOffset = kByteLengthOffset + kPointerSize;
8553 static const int kSize = kLengthOffset + kPointerSize;
8554
8555 private:
8556 DISALLOW_IMPLICIT_CONSTRUCTORS(JSTypedArray);
8557 };
8558
8559
8524 // Foreign describes objects pointing from JavaScript to C structures. 8560 // Foreign describes objects pointing from JavaScript to C structures.
8525 // Since they cannot contain references to JS HeapObjects they can be 8561 // Since they cannot contain references to JS HeapObjects they can be
8526 // placed in old_data_space. 8562 // placed in old_data_space.
8527 class Foreign: public HeapObject { 8563 class Foreign: public HeapObject {
8528 public: 8564 public:
8529 // [address]: field containing the address. 8565 // [address]: field containing the address.
8530 inline Address foreign_address(); 8566 inline Address foreign_address();
8531 inline void set_foreign_address(Address value); 8567 inline void set_foreign_address(Address value);
8532 8568
8533 // Casting. 8569 // Casting.
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
9318 } else { 9354 } else {
9319 value &= ~(1 << bit_position); 9355 value &= ~(1 << bit_position);
9320 } 9356 }
9321 return value; 9357 return value;
9322 } 9358 }
9323 }; 9359 };
9324 9360
9325 } } // namespace v8::internal 9361 } } // namespace v8::internal
9326 9362
9327 #endif // V8_OBJECTS_H_ 9363 #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