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

Side by Side Diff: include/v8.h

Issue 18695004: Add internal fields to JSArrayBufferViews (JSTypedArray and JSDataView) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: CR feedback 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/bootstrapper.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 2359 matching lines...) Expand 10 before | Expand all | Expand 10 after
2370 ScriptOrigin GetScriptOrigin() const; 2370 ScriptOrigin GetScriptOrigin() const;
2371 V8_INLINE(static Function* Cast(Value* obj)); 2371 V8_INLINE(static Function* Cast(Value* obj));
2372 static const int kLineOffsetNotFound; 2372 static const int kLineOffsetNotFound;
2373 2373
2374 private: 2374 private:
2375 Function(); 2375 Function();
2376 static void CheckCast(Value* obj); 2376 static void CheckCast(Value* obj);
2377 }; 2377 };
2378 2378
2379 #ifndef V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT 2379 #ifndef V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT
2380 // The number of required internal fields can be defined by embedder.
2380 #define V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT 2 2381 #define V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT 2
2381 #endif 2382 #endif
2382 2383
2383 /** 2384 /**
2384 * An instance of the built-in ArrayBuffer constructor (ES6 draft 15.13.5). 2385 * An instance of the built-in ArrayBuffer constructor (ES6 draft 15.13.5).
2385 * This API is experimental and may change significantly. 2386 * This API is experimental and may change significantly.
2386 */ 2387 */
2387 class V8EXPORT ArrayBuffer : public Object { 2388 class V8EXPORT ArrayBuffer : public Object {
2388 public: 2389 public:
2389 /** 2390 /**
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
2482 V8_INLINE(static ArrayBuffer* Cast(Value* obj)); 2483 V8_INLINE(static ArrayBuffer* Cast(Value* obj));
2483 2484
2484 static const int kInternalFieldCount = V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT; 2485 static const int kInternalFieldCount = V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT;
2485 2486
2486 private: 2487 private:
2487 ArrayBuffer(); 2488 ArrayBuffer();
2488 static void CheckCast(Value* obj); 2489 static void CheckCast(Value* obj);
2489 }; 2490 };
2490 2491
2491 2492
2493 #ifndef V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT
2494 // The number of required internal fields can be defined by embedder.
2495 #define V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT 2
2496 #endif
2497
2498
2492 /** 2499 /**
2493 * A base class for an instance of one of "views" over ArrayBuffer, 2500 * A base class for an instance of one of "views" over ArrayBuffer,
2494 * including TypedArrays and DataView (ES6 draft 15.13). 2501 * including TypedArrays and DataView (ES6 draft 15.13).
2495 * 2502 *
2496 * This API is experimental and may change significantly. 2503 * This API is experimental and may change significantly.
2497 */ 2504 */
2498 class V8EXPORT ArrayBufferView : public Object { 2505 class V8EXPORT ArrayBufferView : public Object {
2499 public: 2506 public:
2500 /** 2507 /**
2501 * Returns underlying ArrayBuffer. 2508 * Returns underlying ArrayBuffer.
2502 */ 2509 */
2503 Local<ArrayBuffer> Buffer(); 2510 Local<ArrayBuffer> Buffer();
2504 /** 2511 /**
2505 * Byte offset in |Buffer|. 2512 * Byte offset in |Buffer|.
2506 */ 2513 */
2507 size_t ByteOffset(); 2514 size_t ByteOffset();
2508 /** 2515 /**
2509 * Size of a view in bytes. 2516 * Size of a view in bytes.
2510 */ 2517 */
2511 size_t ByteLength(); 2518 size_t ByteLength();
2512 /** 2519 /**
2513 * Base address of a view. 2520 * Base address of a view.
2514 */ 2521 */
2515 void* BaseAddress(); 2522 void* BaseAddress();
2516 2523
2517 V8_INLINE(static ArrayBufferView* Cast(Value* obj)); 2524 V8_INLINE(static ArrayBufferView* Cast(Value* obj));
2518 2525
2526 static const int kInternalFieldCount =
2527 V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT;
2528
2519 private: 2529 private:
2520 ArrayBufferView(); 2530 ArrayBufferView();
2521 static void CheckCast(Value* obj); 2531 static void CheckCast(Value* obj);
2522 }; 2532 };
2523 2533
2524 2534
2525 /** 2535 /**
2526 * A base class for an instance of TypedArray series of constructors 2536 * A base class for an instance of TypedArray series of constructors
2527 * (ES6 draft 15.13.6). 2537 * (ES6 draft 15.13.6).
2528 * This API is experimental and may change significantly. 2538 * This API is experimental and may change significantly.
(...skipping 3936 matching lines...) Expand 10 before | Expand all | Expand 10 after
6465 6475
6466 6476
6467 } // namespace v8 6477 } // namespace v8
6468 6478
6469 6479
6470 #undef V8EXPORT 6480 #undef V8EXPORT
6471 #undef TYPE_CHECK 6481 #undef TYPE_CHECK
6472 6482
6473 6483
6474 #endif // V8_H_ 6484 #endif // V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698