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

Side by Side Diff: src/code-stubs.h

Issue 847913005: move HandleApiCall builtin to assembly (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: cleanup Created 5 years, 11 months 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/builtins.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef V8_CODE_STUBS_H_ 5 #ifndef V8_CODE_STUBS_H_
6 #define V8_CODE_STUBS_H_ 6 #define V8_CODE_STUBS_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/assembler.h" 9 #include "src/assembler.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
11 #include "src/globals.h" 11 #include "src/globals.h"
12 #include "src/ic/ic-state.h" 12 #include "src/ic/ic-state.h"
13 #include "src/interface-descriptors.h" 13 #include "src/interface-descriptors.h"
14 #include "src/macro-assembler.h" 14 #include "src/macro-assembler.h"
15 #include "src/ostreams.h" 15 #include "src/ostreams.h"
16 16
17 namespace v8 { 17 namespace v8 {
18 namespace internal { 18 namespace internal {
19 19
20 // List of code stubs used on all platforms. 20 // List of code stubs used on all platforms.
21 #define CODE_STUB_LIST_ALL_PLATFORMS(V) \ 21 #define CODE_STUB_LIST_ALL_PLATFORMS(V) \
22 /* PlatformCodeStubs */ \ 22 /* PlatformCodeStubs */ \
23 V(ArgumentsAccess) \ 23 V(ArgumentsAccess) \
24 V(ArrayConstructor) \ 24 V(ArrayConstructor) \
25 V(BinaryOpICWithAllocationSite) \ 25 V(BinaryOpICWithAllocationSite) \
26 V(CallApiFunction) \ 26 V(CallApiFunction) \
27 V(JSApiFunction) \
27 V(CallApiAccessor) \ 28 V(CallApiAccessor) \
28 V(CallApiGetter) \ 29 V(CallApiGetter) \
29 V(CallConstruct) \ 30 V(CallConstruct) \
30 V(CallFunction) \ 31 V(CallFunction) \
31 V(CallIC) \ 32 V(CallIC) \
32 V(CallIC_Array) \ 33 V(CallIC_Array) \
33 V(CEntry) \ 34 V(CEntry) \
34 V(CompareIC) \ 35 V(CompareIC) \
35 V(DoubleToI) \ 36 V(DoubleToI) \
36 V(FunctionPrototype) \ 37 V(FunctionPrototype) \
(...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1141 return CallDataUndefinedBits::decode(minor_key_); 1142 return CallDataUndefinedBits::decode(minor_key_);
1142 } 1143 }
1143 1144
1144 class CallDataUndefinedBits : public BitField<bool, 0, 1> {}; 1145 class CallDataUndefinedBits : public BitField<bool, 0, 1> {};
1145 1146
1146 DEFINE_CALL_INTERFACE_DESCRIPTOR(ApiFunction); 1147 DEFINE_CALL_INTERFACE_DESCRIPTOR(ApiFunction);
1147 DEFINE_PLATFORM_CODE_STUB(CallApiFunction, PlatformCodeStub); 1148 DEFINE_PLATFORM_CODE_STUB(CallApiFunction, PlatformCodeStub);
1148 }; 1149 };
1149 1150
1150 1151
1152 // Like CallApiFunctionStub above, but conforms to the JS call abi.
1153 class JSApiFunctionStub : public PlatformCodeStub {
1154 public:
1155 JSApiFunctionStub(Isolate* isolate, Handle<FunctionTemplateInfo> info);
1156
1157 private:
1158 bool call_data_undefined() const {
1159 return CallDataUndefinedBits::decode(minor_key_);
1160 }
1161 bool has_call_code() const { return HasCallCodeBits::decode(minor_key_); }
1162 bool has_signature() const { return HasSignatureBits::decode(minor_key_); }
1163
1164 class CallDataUndefinedBits : public BitField<bool, 0, 1> {};
1165 class HasCallCodeBits : public BitField<bool, 1, 1> {};
1166 class HasSignatureBits : public BitField<bool, 2, 1> {};
1167
1168 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR();
1169 DEFINE_PLATFORM_CODE_STUB(JSApiFunction, PlatformCodeStub);
1170 };
1171
1172
1151 class CallApiAccessorStub : public PlatformCodeStub { 1173 class CallApiAccessorStub : public PlatformCodeStub {
1152 public: 1174 public:
1153 CallApiAccessorStub(Isolate* isolate, bool is_store, bool call_data_undefined) 1175 CallApiAccessorStub(Isolate* isolate, bool is_store, bool call_data_undefined)
1154 : PlatformCodeStub(isolate) { 1176 : PlatformCodeStub(isolate) {
1155 minor_key_ = IsStoreBits::encode(is_store) | 1177 minor_key_ = IsStoreBits::encode(is_store) |
1156 CallDataUndefinedBits::encode(call_data_undefined) | 1178 CallDataUndefinedBits::encode(call_data_undefined) |
1157 ArgumentBits::encode(is_store ? 1 : 0); 1179 ArgumentBits::encode(is_store ? 1 : 0);
1158 } 1180 }
1159 1181
1160 protected: 1182 protected:
(...skipping 1473 matching lines...) Expand 10 before | Expand all | Expand 10 after
2634 2656
2635 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR 2657 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR
2636 #undef DEFINE_PLATFORM_CODE_STUB 2658 #undef DEFINE_PLATFORM_CODE_STUB
2637 #undef DEFINE_HANDLER_CODE_STUB 2659 #undef DEFINE_HANDLER_CODE_STUB
2638 #undef DEFINE_HYDROGEN_CODE_STUB 2660 #undef DEFINE_HYDROGEN_CODE_STUB
2639 #undef DEFINE_CODE_STUB 2661 #undef DEFINE_CODE_STUB
2640 #undef DEFINE_CODE_STUB_BASE 2662 #undef DEFINE_CODE_STUB_BASE
2641 } } // namespace v8::internal 2663 } } // namespace v8::internal
2642 2664
2643 #endif // V8_CODE_STUBS_H_ 2665 #endif // V8_CODE_STUBS_H_
OLDNEW
« no previous file with comments | « src/builtins.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698