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

Side by Side Diff: include/v8.h

Issue 1474543004: Implement Fast Accessor Builder (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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
OLDNEW
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
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 4255 matching lines...) Expand 10 before | Expand all | Expand 10 after
4404 * \endcode 4408 * \endcode
4405 */ 4409 */
4406 class V8_EXPORT FunctionTemplate : public Template { 4410 class V8_EXPORT FunctionTemplate : public Template {
4407 public: 4411 public:
4408 /** Creates a function template.*/ 4412 /** Creates a function template.*/
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
4418 /**
4419 * Creates a function template with a fast handler. If a fast handler is set,
4420 * the callback cannot be null.
4421 */
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
4414 /** Returns the unique function instance in the current execution context.*/ 4428 /** Returns the unique function instance in the current execution context.*/
4415 V8_DEPRECATE_SOON("Use maybe version", Local<Function> GetFunction()); 4429 V8_DEPRECATE_SOON("Use maybe version", Local<Function> GetFunction());
4416 V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction( 4430 V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
4417 Local<Context> context); 4431 Local<Context> context);
4418 4432
4419 /** 4433 /**
4420 * Set the call-handler callback for a FunctionTemplate. This 4434 * Set the call-handler callback for a FunctionTemplate. This
4421 * callback is called whenever the function created from this 4435 * callback is called whenever the function created from this
4422 * FunctionTemplate is called. 4436 * FunctionTemplate is called.
4423 */ 4437 */
4424 void SetCallHandler(FunctionCallback callback, 4438 void SetCallHandler(
4425 Local<Value> data = Local<Value>()); 4439 FunctionCallback callback, Local<Value> data = Local<Value>(),
4440 experimental::FastAccessorBuilder* fast_handler = nullptr);
4426 4441
4427 /** Set the predefined length property for the FunctionTemplate. */ 4442 /** Set the predefined length property for the FunctionTemplate. */
4428 void SetLength(int length); 4443 void SetLength(int length);
4429 4444
4430 /** Get the InstanceTemplate. */ 4445 /** Get the InstanceTemplate. */
4431 Local<ObjectTemplate> InstanceTemplate(); 4446 Local<ObjectTemplate> InstanceTemplate();
4432 4447
4433 /** Causes the function template to inherit from a parent function template.*/ 4448 /** Causes the function template to inherit from a parent function template.*/
4434 void Inherit(Local<FunctionTemplate> parent); 4449 void Inherit(Local<FunctionTemplate> parent);
4435 4450
(...skipping 2512 matching lines...) Expand 10 before | Expand all | Expand 10 after
6948 bool has_lock_; 6963 bool has_lock_;
6949 bool top_level_; 6964 bool top_level_;
6950 internal::Isolate* isolate_; 6965 internal::Isolate* isolate_;
6951 6966
6952 // Disallow copying and assigning. 6967 // Disallow copying and assigning.
6953 Locker(const Locker&); 6968 Locker(const Locker&);
6954 void operator=(const Locker&); 6969 void operator=(const Locker&);
6955 }; 6970 };
6956 6971
6957 6972
6973 namespace experimental {
6974
6975 class V8_EXPORT FastAccessorBuilder {
6976 public:
6977 typedef size_t ValueId;
6978
6979 ~FastAccessorBuilder();
6980 static FastAccessorBuilder* New(Isolate* isolate);
6981
6982 ValueId IntegerConstant(int int_constant);
6983 void ReturnValue(ValueId value_id);
6984 ValueId GetParameter(size_t parameter_no);
6985 ValueId GetInternalField(ValueId value_id, int field_no);
6986 ValueId LoadValue(ValueId value_id, int offset);
6987 ValueId LoadObject(ValueId value_id, int offset);
6988 void CheckFlagSetOrReturnNull(ValueId value_id, int mask);
6989 void CheckNotNullOrReturnNull(ValueId value_id);
6990 ValueId SetLabel();
6991 void CheckNotNullOrJump(ValueId value_id, ValueId label_id);
6992
6993 private:
6994 FastAccessorBuilder();
6995
6996 void* impl_;
6997 };
6998
6999 } // namespace experimental
7000
7001
6958 // --- Implementation --- 7002 // --- Implementation ---
6959 7003
6960 7004
6961 namespace internal { 7005 namespace internal {
6962 7006
6963 const int kApiPointerSize = sizeof(void*); // NOLINT 7007 const int kApiPointerSize = sizeof(void*); // NOLINT
6964 const int kApiIntSize = sizeof(int); // NOLINT 7008 const int kApiIntSize = sizeof(int); // NOLINT
6965 const int kApiInt64Size = sizeof(int64_t); // NOLINT 7009 const int kApiInt64Size = sizeof(int64_t); // NOLINT
6966 7010
6967 // Tag information for HeapObject. 7011 // Tag information for HeapObject.
(...skipping 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after
8466 */ 8510 */
8467 8511
8468 8512
8469 } // namespace v8 8513 } // namespace v8
8470 8514
8471 8515
8472 #undef TYPE_CHECK 8516 #undef TYPE_CHECK
8473 8517
8474 8518
8475 #endif // V8_H_ 8519 #endif // V8_H_
OLDNEW
« no previous file with comments | « build/features.gypi ('k') | src/DEPS » ('j') | src/compiler/fast-accessor-assembler.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698