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

Side by Side Diff: src/api-experimental.cc

Issue 1513203002: Revert of 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
« no previous file with comments | « src/api-experimental.h ('k') | src/compiler/fast-accessor-assembler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 * Implementation for v8-experimental.h.
7 */
8
9 #include "src/api-experimental.h"
10
11 #include "include/v8.h"
12 #include "include/v8-experimental.h"
13 #include "src/api.h"
14 #include "src/compiler/fast-accessor-assembler.h"
15
16 namespace {
17
18
19 v8::internal::compiler::FastAccessorAssembler* FromApi(
20 v8::experimental::FastAccessorBuilder* builder) {
21 return reinterpret_cast<v8::internal::compiler::FastAccessorAssembler*>(
22 builder);
23 }
24
25
26 v8::experimental::FastAccessorBuilder* FromInternal(
27 v8::internal::compiler::FastAccessorAssembler* fast_accessor_assembler) {
28 return reinterpret_cast<v8::experimental::FastAccessorBuilder*>(
29 fast_accessor_assembler);
30 }
31
32 } // namespace
33
34 namespace v8 {
35 namespace internal {
36 namespace experimental {
37
38
39 MaybeHandle<Code> BuildCodeFromFastAccessorBuilder(
40 v8::experimental::FastAccessorBuilder* fast_handler) {
41 i::MaybeHandle<i::Code> code;
42 if (fast_handler != nullptr) {
43 auto faa = FromApi(fast_handler);
44 code = faa->Build();
45 CHECK(!code.is_null());
46 delete faa;
47 }
48 return code;
49 }
50
51 } // namespace experimental
52 } // namespace internal
53
54
55 namespace experimental {
56
57
58 FastAccessorBuilder* FastAccessorBuilder::New(Isolate* isolate) {
59 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
60 internal::compiler::FastAccessorAssembler* faa =
61 new internal::compiler::FastAccessorAssembler(i_isolate);
62 return FromInternal(faa);
63 }
64
65
66 FastAccessorBuilder::ValueId FastAccessorBuilder::IntegerConstant(
67 int const_value) {
68 return FromApi(this)->IntegerConstant(const_value);
69 }
70
71
72 FastAccessorBuilder::ValueId FastAccessorBuilder::GetReceiver() {
73 return FromApi(this)->GetReceiver();
74 }
75
76
77 FastAccessorBuilder::ValueId FastAccessorBuilder::LoadInternalField(
78 ValueId value, int field_no) {
79 return FromApi(this)->LoadInternalField(value, field_no);
80 }
81
82
83 FastAccessorBuilder::ValueId FastAccessorBuilder::LoadValue(ValueId value_id,
84 int offset) {
85 return FromApi(this)->LoadValue(value_id, offset);
86 }
87
88
89 FastAccessorBuilder::ValueId FastAccessorBuilder::LoadObject(ValueId value_id,
90 int offset) {
91 return FromApi(this)->LoadObject(value_id, offset);
92 }
93
94
95 void FastAccessorBuilder::ReturnValue(ValueId value) {
96 FromApi(this)->ReturnValue(value);
97 }
98
99
100 void FastAccessorBuilder::CheckFlagSetOrReturnNull(ValueId value_id, int mask) {
101 FromApi(this)->CheckFlagSetOrReturnNull(value_id, mask);
102 }
103
104
105 void FastAccessorBuilder::CheckNotZeroOrReturnNull(ValueId value_id) {
106 FromApi(this)->CheckNotZeroOrReturnNull(value_id);
107 }
108
109
110 FastAccessorBuilder::LabelId FastAccessorBuilder::MakeLabel() {
111 return FromApi(this)->MakeLabel();
112 }
113
114
115 void FastAccessorBuilder::SetLabel(LabelId label_id) {
116 FromApi(this)->SetLabel(label_id);
117 }
118
119
120 void FastAccessorBuilder::CheckNotZeroOrJump(ValueId value_id,
121 LabelId label_id) {
122 FromApi(this)->CheckNotZeroOrJump(value_id, label_id);
123 }
124
125 } // namespace experimental
126 } // namespace v8
OLDNEW
« no previous file with comments | « src/api-experimental.h ('k') | src/compiler/fast-accessor-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698