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

Unified Diff: src/code-stubs.h

Issue 836093007: split api call stubs into accessor and function call stubs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/arm64/macro-assembler-arm64.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.h
diff --git a/src/code-stubs.h b/src/code-stubs.h
index ab56f3424eb32fa876314e0b44aaff9112e64ef2..4fa440bb70658f9131bf71d36e674a9623b50ef4 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -24,6 +24,7 @@ namespace internal {
V(ArrayConstructor) \
V(BinaryOpICWithAllocationSite) \
V(CallApiFunction) \
+ V(CallApiAccessor) \
V(CallApiGetter) \
V(CallConstruct) \
V(CallFunction) \
@@ -1130,14 +1131,29 @@ class StoreGlobalStub : public HandlerStub {
class CallApiFunctionStub : public PlatformCodeStub {
public:
- CallApiFunctionStub(Isolate* isolate,
- bool is_store,
- bool call_data_undefined,
- int argc) : PlatformCodeStub(isolate) {
+ explicit CallApiFunctionStub(Isolate* isolate, bool call_data_undefined)
+ : PlatformCodeStub(isolate) {
+ minor_key_ = CallDataUndefinedBits::encode(call_data_undefined);
+ }
+
+ private:
+ bool call_data_undefined() const {
+ return CallDataUndefinedBits::decode(minor_key_);
+ }
+
+ class CallDataUndefinedBits : public BitField<bool, 0, 1> {};
+
+ DEFINE_CALL_INTERFACE_DESCRIPTOR(ApiFunction);
+ DEFINE_PLATFORM_CODE_STUB(CallApiFunction, PlatformCodeStub);
+};
+
+
+class CallApiAccessorStub : public PlatformCodeStub {
+ public:
+ CallApiAccessorStub(Isolate* isolate, bool is_store, bool call_data_undefined)
+ : PlatformCodeStub(isolate) {
minor_key_ = IsStoreBits::encode(is_store) |
- CallDataUndefinedBits::encode(call_data_undefined) |
- ArgumentBits::encode(argc);
- DCHECK(!is_store || argc == 1);
+ CallDataUndefinedBits::encode(call_data_undefined);
}
private:
@@ -1145,15 +1161,12 @@ class CallApiFunctionStub : public PlatformCodeStub {
bool call_data_undefined() const {
return CallDataUndefinedBits::decode(minor_key_);
}
- int argc() const { return ArgumentBits::decode(minor_key_); }
class IsStoreBits: public BitField<bool, 0, 1> {};
class CallDataUndefinedBits: public BitField<bool, 1, 1> {};
- class ArgumentBits: public BitField<int, 2, Code::kArgumentsBits> {};
- STATIC_ASSERT(Code::kArgumentsBits + 2 <= kStubMinorKeyBits);
- DEFINE_CALL_INTERFACE_DESCRIPTOR(ApiFunction);
- DEFINE_PLATFORM_CODE_STUB(CallApiFunction, PlatformCodeStub);
+ DEFINE_CALL_INTERFACE_DESCRIPTOR(ApiAccessor);
+ DEFINE_PLATFORM_CODE_STUB(CallApiAccessor, PlatformCodeStub);
};
« no previous file with comments | « src/arm64/macro-assembler-arm64.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698