OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** \mainpage V8 API Reference Guide | 5 /** \mainpage V8 API Reference Guide |
6 * | 6 * |
7 * V8 is Google's open source JavaScript engine. | 7 * V8 is Google's open source JavaScript engine. |
8 * | 8 * |
9 * This set of documents provides reference material generated from the | 9 * This set of documents provides reference material generated from the |
10 * V8 header file, include/v8.h. | 10 * V8 header file, include/v8.h. |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
129 class Data; | 129 class Data; |
130 template<typename T> class FunctionCallbackInfo; | 130 template<typename T> class FunctionCallbackInfo; |
131 template<typename T> class PropertyCallbackInfo; | 131 template<typename T> class PropertyCallbackInfo; |
132 class StackTrace; | 132 class StackTrace; |
133 class StackFrame; | 133 class StackFrame; |
134 class Isolate; | 134 class Isolate; |
135 class CallHandlerHelper; | 135 class CallHandlerHelper; |
136 class EscapableHandleScope; | 136 class EscapableHandleScope; |
137 template<typename T> class ReturnValue; | 137 template<typename T> class ReturnValue; |
138 | 138 |
139 namespace experimental { | |
140 class FastAccessorBuilder; | |
141 } // namespace experimental | |
142 | |
139 namespace internal { | 143 namespace internal { |
140 class Arguments; | 144 class Arguments; |
141 class Heap; | 145 class Heap; |
142 class HeapObject; | 146 class HeapObject; |
143 class Isolate; | 147 class Isolate; |
144 class Object; | 148 class Object; |
145 struct StreamedSource; | 149 struct StreamedSource; |
146 template<typename T> class CustomArguments; | 150 template<typename T> class CustomArguments; |
147 class PropertyCallbackArguments; | 151 class PropertyCallbackArguments; |
148 class FunctionCallbackArguments; | 152 class FunctionCallbackArguments; |
(...skipping 4260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4409 static Local<FunctionTemplate> New( | 4413 static Local<FunctionTemplate> New( |
4410 Isolate* isolate, FunctionCallback callback = 0, | 4414 Isolate* isolate, FunctionCallback callback = 0, |
4411 Local<Value> data = Local<Value>(), | 4415 Local<Value> data = Local<Value>(), |
4412 Local<Signature> signature = Local<Signature>(), int length = 0); | 4416 Local<Signature> signature = Local<Signature>(), int length = 0); |
4413 | 4417 |
4414 /** | 4418 /** |
4415 * Creates a function template with a fast handler. If a fast handler is set, | 4419 * Creates a function template with a fast handler. If a fast handler is set, |
4416 * the callback cannot be null. | 4420 * the callback cannot be null. |
4417 */ | 4421 */ |
4418 static Local<FunctionTemplate> NewWithFastHandler( | 4422 static Local<FunctionTemplate> NewWithFastHandler( |
4423 Isolate* isolate, FunctionCallback callback, | |
4424 experimental::FastAccessorBuilder* fast_handler = nullptr, | |
4425 Local<Value> data = Local<Value>(), | |
4426 Local<Signature> signature = Local<Signature>(), int length = 0); | |
4427 | |
4428 /** | |
4429 * Creates a function template with a fast handler. If a fast handler is set, | |
4430 * the callback cannot be null. | |
4431 */ | |
4432 static Local<FunctionTemplate> NewWithFastHandler( | |
4419 Isolate* isolate, FunctionCallback callback, Local<Value> fast_handler, | 4433 Isolate* isolate, FunctionCallback callback, Local<Value> fast_handler, |
4420 Local<Value> data = Local<Value>(), | 4434 Local<Value> data = Local<Value>(), |
4421 Local<Signature> signature = Local<Signature>(), int length = 0); | 4435 Local<Signature> signature = Local<Signature>(), int length = 0); |
4422 | 4436 |
4423 /** Returns the unique function instance in the current execution context.*/ | 4437 /** Returns the unique function instance in the current execution context.*/ |
4424 V8_DEPRECATE_SOON("Use maybe version", Local<Function> GetFunction()); | 4438 V8_DEPRECATE_SOON("Use maybe version", Local<Function> GetFunction()); |
4425 V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction( | 4439 V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction( |
4426 Local<Context> context); | 4440 Local<Context> context); |
4427 | 4441 |
4428 /** | 4442 /** |
4429 * Set the call-handler callback for a FunctionTemplate. This | 4443 * Set the call-handler callback for a FunctionTemplate. This |
4430 * callback is called whenever the function created from this | 4444 * callback is called whenever the function created from this |
4431 * FunctionTemplate is called. | 4445 * FunctionTemplate is called. |
4432 */ | 4446 */ |
4433 void SetCallHandler(FunctionCallback callback, | 4447 void SetCallHandler( |
4434 Local<Value> data = Local<Value>(), | 4448 FunctionCallback callback, Local<Value> data = Local<Value>(), |
4435 Local<Value> fast_handler = Local<Value>()); | 4449 experimental::FastAccessorBuilder* fast_handler = nullptr); |
4436 | 4450 |
4437 /** Set the predefined length property for the FunctionTemplate. */ | 4451 /** Set the predefined length property for the FunctionTemplate. */ |
4438 void SetLength(int length); | 4452 void SetLength(int length); |
4439 | 4453 |
4440 /** Get the InstanceTemplate. */ | 4454 /** Get the InstanceTemplate. */ |
4441 Local<ObjectTemplate> InstanceTemplate(); | 4455 Local<ObjectTemplate> InstanceTemplate(); |
4442 | 4456 |
4443 /** Causes the function template to inherit from a parent function template.*/ | 4457 /** Causes the function template to inherit from a parent function template.*/ |
4444 void Inherit(Local<FunctionTemplate> parent); | 4458 void Inherit(Local<FunctionTemplate> parent); |
4445 | 4459 |
(...skipping 2512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6958 bool has_lock_; | 6972 bool has_lock_; |
6959 bool top_level_; | 6973 bool top_level_; |
6960 internal::Isolate* isolate_; | 6974 internal::Isolate* isolate_; |
6961 | 6975 |
6962 // Disallow copying and assigning. | 6976 // Disallow copying and assigning. |
6963 Locker(const Locker&); | 6977 Locker(const Locker&); |
6964 void operator=(const Locker&); | 6978 void operator=(const Locker&); |
6965 }; | 6979 }; |
6966 | 6980 |
6967 | 6981 |
6982 namespace experimental { | |
jochen (gone - plz use gerrit)
2015/11/27 08:33:45
i wonder whether we should move this to a separate
Michael Starzinger
2015/11/27 09:15:52
+1
vogelheim
2015/11/30 13:41:54
Done.
In a separate CL, I'll also move the api-*
| |
6983 | |
6984 class V8_EXPORT FastAccessorBuilder { | |
6985 public: | |
6986 struct ValueId { | |
jochen (gone - plz use gerrit)
2015/11/27 08:33:45
why not using size_t = ValudId or typedef?
epertoso
2015/11/27 09:13:13
It was my suggestion. We don't want to pass ValueI
vogelheim
2015/11/27 16:24:50
^^^ This.
The original version used a single type
| |
6987 size_t value_id; | |
6988 }; | |
6989 struct LabelId { | |
6990 size_t label_id; | |
6991 }; | |
6992 | |
6993 ~FastAccessorBuilder(); | |
6994 static FastAccessorBuilder* New(Isolate* isolate); | |
6995 | |
6996 ValueId IntegerConstant(int int_constant); | |
6997 ValueId GetCallTarget(); | |
6998 ValueId GetParameter(size_t parameter_no); | |
6999 ValueId GetInternalField(ValueId value_id, int field_no); | |
7000 ValueId LoadValue(ValueId value_id, int offset); | |
7001 ValueId LoadObject(ValueId value_id, int offset); | |
7002 void ReturnValue(ValueId value_id); | |
7003 void CheckFlagSetOrReturnNull(ValueId value_id, int mask); | |
7004 void CheckNotNullOrReturnNull(ValueId value_id); | |
7005 ValueId SetLabel(); | |
7006 void CheckNotNullOrJump(ValueId value_id, ValueId label_id); | |
7007 | |
7008 private: | |
7009 FastAccessorBuilder(); | |
7010 | |
7011 void* impl_; | |
7012 }; | |
jochen (gone - plz use gerrit)
2015/11/27 08:33:45
disallow copy/assign
vogelheim
2015/11/27 16:24:50
Done.
v8.h can't include macros.h, so done manual
| |
7013 | |
7014 } // namespace experimental | |
7015 | |
7016 | |
6968 // --- Implementation --- | 7017 // --- Implementation --- |
6969 | 7018 |
6970 | 7019 |
6971 namespace internal { | 7020 namespace internal { |
6972 | 7021 |
6973 const int kApiPointerSize = sizeof(void*); // NOLINT | 7022 const int kApiPointerSize = sizeof(void*); // NOLINT |
6974 const int kApiIntSize = sizeof(int); // NOLINT | 7023 const int kApiIntSize = sizeof(int); // NOLINT |
6975 const int kApiInt64Size = sizeof(int64_t); // NOLINT | 7024 const int kApiInt64Size = sizeof(int64_t); // NOLINT |
6976 | 7025 |
6977 // Tag information for HeapObject. | 7026 // Tag information for HeapObject. |
(...skipping 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8476 */ | 8525 */ |
8477 | 8526 |
8478 | 8527 |
8479 } // namespace v8 | 8528 } // namespace v8 |
8480 | 8529 |
8481 | 8530 |
8482 #undef TYPE_CHECK | 8531 #undef TYPE_CHECK |
8483 | 8532 |
8484 | 8533 |
8485 #endif // V8_H_ | 8534 #endif // V8_H_ |
OLD | NEW |