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

Side by Side Diff: include/v8-experimental.h

Issue 1474543004: Implement Fast Accessor Builder (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review feedback. 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
(Empty)
1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /**
6 * This header contains a set of experimental V8 APIs. We hope these will
7 * become a part of standard V8, but they may also be removed if we deem the
8 * experiment to not be successul.
9 */
10 #ifndef V8_INCLUDE_V8_EXPERIMENTAL_H_
11 #define V8_INCLUDE_V8_EXPERIMENTAL_H_
12
13 #include "include/v8.h"
14
15 namespace v8 {
16 namespace experimental {
17
18 // Allow the embedder to construct accessors that V8 can compile and use
19 // directly, without jumping into the runtime.
20 class V8_EXPORT FastAccessorBuilder {
21 public:
22 struct ValueId {
23 size_t value_id;
24 };
25 struct LabelId {
26 size_t label_id;
27 };
28
29 ~FastAccessorBuilder();
30 static FastAccessorBuilder* New(Isolate* isolate);
31
32 ValueId IntegerConstant(int int_constant);
33 ValueId GetReceiver();
34 ValueId LoadInternalField(ValueId value_id, int field_no);
35 ValueId LoadValue(ValueId value_id, int offset);
36 ValueId LoadObject(ValueId value_id, int offset);
37 void ReturnValue(ValueId value_id);
38 void CheckFlagSetOrReturnNull(ValueId value_id, int mask);
39 void CheckNotZeroOrReturnNull(ValueId value_id);
40 LabelId MakeLabel();
41 void SetLabel(LabelId label_id);
42 void CheckNotZeroOrJump(ValueId value_id, LabelId label_id);
43
44 private:
45 FastAccessorBuilder();
46 FastAccessorBuilder(const FastAccessorBuilder&) = delete;
47 void operator=(const FastAccessorBuilder&) = delete;
48
49 void* impl_;
epertoso 2015/12/04 09:56:32 Why don't you just forward-declare internal::compi
vogelheim 2015/12/08 12:52:56 Well... I'm trying to emulate the rest of v8.h, wh
jochen (gone - plz use gerrit) 2015/12/08 13:00:42 There are examples of both patterns, e.g. v8::Disa
50 };
51
52 } // namespace experimental
53 } // namespace v8
54
55 #endif // V8_INCLUDE_V8_EXPERIMENTAL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698