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

Unified Diff: include/v8.h

Issue 1474543004: Implement Fast Accessor Builder (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review feedback; all of the easy stuff. Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « BUILD.gn ('k') | src/DEPS » ('j') | src/compiler/fast-accessor-assembler.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index c5479c518ed374fbd6c58586cef6481b3182eeb0..8c1b769add5f1cdb2b6ff37e0fbe01eac566ed28 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -136,6 +136,10 @@ class CallHandlerHelper;
class EscapableHandleScope;
template<typename T> class ReturnValue;
+namespace experimental {
+class FastAccessorBuilder;
+} // namespace experimental
+
namespace internal {
class Arguments;
class Heap;
@@ -4416,6 +4420,16 @@ class V8_EXPORT FunctionTemplate : public Template {
* the callback cannot be null.
*/
static Local<FunctionTemplate> NewWithFastHandler(
+ Isolate* isolate, FunctionCallback callback,
+ experimental::FastAccessorBuilder* fast_handler = nullptr,
+ Local<Value> data = Local<Value>(),
+ Local<Signature> signature = Local<Signature>(), int length = 0);
+
+ /**
+ * Creates a function template with a fast handler. If a fast handler is set,
+ * the callback cannot be null.
+ */
+ static Local<FunctionTemplate> NewWithFastHandler(
Isolate* isolate, FunctionCallback callback, Local<Value> fast_handler,
Local<Value> data = Local<Value>(),
Local<Signature> signature = Local<Signature>(), int length = 0);
@@ -4430,9 +4444,9 @@ class V8_EXPORT FunctionTemplate : public Template {
* callback is called whenever the function created from this
* FunctionTemplate is called.
*/
- void SetCallHandler(FunctionCallback callback,
- Local<Value> data = Local<Value>(),
- Local<Value> fast_handler = Local<Value>());
+ void SetCallHandler(
+ FunctionCallback callback, Local<Value> data = Local<Value>(),
+ experimental::FastAccessorBuilder* fast_handler = nullptr);
/** Set the predefined length property for the FunctionTemplate. */
void SetLength(int length);
@@ -6965,6 +6979,43 @@ class V8_EXPORT Locker {
};
+namespace experimental {
+
+class V8_EXPORT FastAccessorBuilder {
+ public:
+ struct ValueId {
+ size_t value_id;
+ };
+ struct LabelId {
+ size_t label_id;
+ };
+
+ ~FastAccessorBuilder();
+ static FastAccessorBuilder* New(Isolate* isolate);
+
+ ValueId IntegerConstant(int int_constant);
+ ValueId GetCallTarget();
+ ValueId GetParameter(size_t parameter_no);
+ ValueId GetInternalField(ValueId value_id, int field_no);
+ ValueId LoadValue(ValueId value_id, int offset);
+ ValueId LoadObject(ValueId value_id, int offset);
+ void ReturnValue(ValueId value_id);
+ void CheckFlagSetOrReturnNull(ValueId value_id, int mask);
+ void CheckNotNullOrReturnNull(ValueId value_id);
+ ValueId SetLabel();
+ void CheckNotNullOrJump(ValueId value_id, ValueId label_id);
+
+ private:
+ FastAccessorBuilder();
+ FastAccessorBuilder(const FastAccessorBuilder&) = delete;
+ void operator=(const FastAccessorBuilder&) = delete;
+
+ void* impl_;
+};
+
+} // namespace experimental
+
+
// --- Implementation ---
« no previous file with comments | « BUILD.gn ('k') | src/DEPS » ('j') | src/compiler/fast-accessor-assembler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698