Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 1950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1961 int GetScriptColumnNumber() const; | 1961 int GetScriptColumnNumber() const; |
| 1962 Handle<Value> GetScriptId() const; | 1962 Handle<Value> GetScriptId() const; |
| 1963 ScriptOrigin GetScriptOrigin() const; | 1963 ScriptOrigin GetScriptOrigin() const; |
| 1964 V8_INLINE(static Function* Cast(Value* obj)); | 1964 V8_INLINE(static Function* Cast(Value* obj)); |
| 1965 static const int kLineOffsetNotFound; | 1965 static const int kLineOffsetNotFound; |
| 1966 | 1966 |
| 1967 private: | 1967 private: |
| 1968 Function(); | 1968 Function(); |
| 1969 static void CheckCast(Value* obj); | 1969 static void CheckCast(Value* obj); |
| 1970 }; | 1970 }; |
| 1971 | 1971 |
|
rossberg
2013/04/25 11:00:55
Style: add empty line
Dmitry Lomov (no reviews)
2013/04/25 11:48:01
Done.
| |
| 1972 /** | |
| 1973 * An instance of the built-in ArrayBuffer construnctor (ES6 draft 15.13.5). | |
|
rossberg
2013/04/25 11:00:55
Add a comment that this is still "experimental".
Dmitry Lomov (no reviews)
2013/04/25 11:48:01
Done.
| |
| 1974 */ | |
| 1975 class V8EXPORT ArrayBuffer : public Object { | |
| 1976 public: | |
| 1977 /** | |
| 1978 * Data length in bytes. | |
| 1979 */ | |
| 1980 size_t ByteLength() const; | |
| 1981 /** | |
| 1982 * Raw pointer to the array buffer data | |
| 1983 */ | |
| 1984 void* Data() const; | |
| 1985 | |
| 1986 /** | |
| 1987 * Create a new ArrayBuffer. Allocate |byte_length| bytes. | |
| 1988 * Allocated memory will be owned by a created ArrayBuffer and | |
| 1989 * will be deallocated when it is garbage-collected. | |
| 1990 */ | |
| 1991 static Local<ArrayBuffer> New(size_t byte_length); | |
| 1992 | |
| 1993 /** | |
| 1994 * Create a new ArrayBuffer over existing memory block. | |
|
rossberg
2013/04/25 11:00:55
Nit: "over an existing..."
Dmitry Lomov (no reviews)
2013/04/25 11:48:01
Done.
| |
| 1995 * The memory block will not be reclaimed when a created ArrayBuffer | |
| 1996 * is garbage-collected. | |
| 1997 */ | |
| 1998 static Local<ArrayBuffer> New(void* data, size_t byte_length); | |
| 1999 | |
| 2000 V8_INLINE(static ArrayBuffer* Cast(Value* obj)); | |
| 2001 | |
| 2002 private: | |
| 2003 ArrayBuffer(); | |
| 2004 static void CheckCast(Value* obj); | |
| 2005 }; | |
| 2006 | |
| 1972 | 2007 |
| 1973 /** | 2008 /** |
| 1974 * An instance of the built-in Date constructor (ECMA-262, 15.9). | 2009 * An instance of the built-in Date constructor (ECMA-262, 15.9). |
| 1975 */ | 2010 */ |
| 1976 class V8EXPORT Date : public Object { | 2011 class V8EXPORT Date : public Object { |
| 1977 public: | 2012 public: |
| 1978 static Local<Value> New(double time); | 2013 static Local<Value> New(double time); |
| 1979 | 2014 |
| 1980 /** | 2015 /** |
| 1981 * A specialization of Value::NumberValue that is more efficient | 2016 * A specialization of Value::NumberValue that is more efficient |
| (...skipping 2440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4422 // the implementation of v8. | 4457 // the implementation of v8. |
| 4423 static const int kHeapObjectMapOffset = 0; | 4458 static const int kHeapObjectMapOffset = 0; |
| 4424 static const int kMapInstanceTypeOffset = 1 * kApiPointerSize + kApiIntSize; | 4459 static const int kMapInstanceTypeOffset = 1 * kApiPointerSize + kApiIntSize; |
| 4425 static const int kStringResourceOffset = 3 * kApiPointerSize; | 4460 static const int kStringResourceOffset = 3 * kApiPointerSize; |
| 4426 | 4461 |
| 4427 static const int kOddballKindOffset = 3 * kApiPointerSize; | 4462 static const int kOddballKindOffset = 3 * kApiPointerSize; |
| 4428 static const int kForeignAddressOffset = kApiPointerSize; | 4463 static const int kForeignAddressOffset = kApiPointerSize; |
| 4429 static const int kJSObjectHeaderSize = 3 * kApiPointerSize; | 4464 static const int kJSObjectHeaderSize = 3 * kApiPointerSize; |
| 4430 static const int kFixedArrayHeaderSize = 2 * kApiPointerSize; | 4465 static const int kFixedArrayHeaderSize = 2 * kApiPointerSize; |
| 4431 static const int kContextHeaderSize = 2 * kApiPointerSize; | 4466 static const int kContextHeaderSize = 2 * kApiPointerSize; |
| 4432 static const int kContextEmbedderDataIndex = 55; | 4467 static const int kContextEmbedderDataIndex = 56; |
| 4433 static const int kFullStringRepresentationMask = 0x07; | 4468 static const int kFullStringRepresentationMask = 0x07; |
| 4434 static const int kStringEncodingMask = 0x4; | 4469 static const int kStringEncodingMask = 0x4; |
| 4435 static const int kExternalTwoByteRepresentationTag = 0x02; | 4470 static const int kExternalTwoByteRepresentationTag = 0x02; |
| 4436 static const int kExternalAsciiRepresentationTag = 0x06; | 4471 static const int kExternalAsciiRepresentationTag = 0x06; |
| 4437 | 4472 |
| 4438 static const int kIsolateStateOffset = 0; | 4473 static const int kIsolateStateOffset = 0; |
| 4439 static const int kIsolateEmbedderDataOffset = 1 * kApiPointerSize; | 4474 static const int kIsolateEmbedderDataOffset = 1 * kApiPointerSize; |
| 4440 static const int kIsolateRootsOffset = 3 * kApiPointerSize; | 4475 static const int kIsolateRootsOffset = 3 * kApiPointerSize; |
| 4441 static const int kUndefinedValueRootIndex = 5; | 4476 static const int kUndefinedValueRootIndex = 5; |
| 4442 static const int kNullValueRootIndex = 7; | 4477 static const int kNullValueRootIndex = 7; |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5093 return static_cast<Object*>(value); | 5128 return static_cast<Object*>(value); |
| 5094 } | 5129 } |
| 5095 | 5130 |
| 5096 | 5131 |
| 5097 Array* Array::Cast(v8::Value* value) { | 5132 Array* Array::Cast(v8::Value* value) { |
| 5098 #ifdef V8_ENABLE_CHECKS | 5133 #ifdef V8_ENABLE_CHECKS |
| 5099 CheckCast(value); | 5134 CheckCast(value); |
| 5100 #endif | 5135 #endif |
| 5101 return static_cast<Array*>(value); | 5136 return static_cast<Array*>(value); |
| 5102 } | 5137 } |
| 5103 | 5138 |
|
rossberg
2013/04/25 11:00:55
STyle: add empty line
Dmitry Lomov (no reviews)
2013/04/25 11:48:01
Done.
| |
| 5139 ArrayBuffer* ArrayBuffer::Cast(v8::Value* value) { | |
| 5140 #ifdef V8_ENABLE_CHECKS | |
| 5141 CheckCast(value); | |
| 5142 #endif | |
| 5143 return static_cast<ArrayBuffer*>(value); | |
| 5144 } | |
| 5145 | |
| 5104 | 5146 |
| 5105 Function* Function::Cast(v8::Value* value) { | 5147 Function* Function::Cast(v8::Value* value) { |
| 5106 #ifdef V8_ENABLE_CHECKS | 5148 #ifdef V8_ENABLE_CHECKS |
| 5107 CheckCast(value); | 5149 CheckCast(value); |
| 5108 #endif | 5150 #endif |
| 5109 return static_cast<Function*>(value); | 5151 return static_cast<Function*>(value); |
| 5110 } | 5152 } |
| 5111 | 5153 |
| 5112 | 5154 |
| 5113 External* External::Cast(v8::Value* value) { | 5155 External* External::Cast(v8::Value* value) { |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5221 | 5263 |
| 5222 | 5264 |
| 5223 } // namespace v8 | 5265 } // namespace v8 |
| 5224 | 5266 |
| 5225 | 5267 |
| 5226 #undef V8EXPORT | 5268 #undef V8EXPORT |
| 5227 #undef TYPE_CHECK | 5269 #undef TYPE_CHECK |
| 5228 | 5270 |
| 5229 | 5271 |
| 5230 #endif // V8_H_ | 5272 #endif // V8_H_ |
| OLD | NEW |