diff options
author | Ali Ijaz Sheikh <ofrobots@google.com> | 2015-08-23 06:09:40 -0700 |
---|---|---|
committer | Rod Vagg <rod@vagg.org> | 2015-09-06 21:38:01 +1000 |
commit | 9fddd83cf9adf505bce2e2373881df0c4d41b261 (patch) | |
tree | 4272ce14c10fea496af2e78fc6debb187d613451 /deps/v8/src/interface-descriptors.h | |
parent | 46b7d151674d138e7ea4342d5f3ada1208b87ff2 (diff) | |
download | android-node-v8-9fddd83cf9adf505bce2e2373881df0c4d41b261.tar.gz android-node-v8-9fddd83cf9adf505bce2e2373881df0c4d41b261.tar.bz2 android-node-v8-9fddd83cf9adf505bce2e2373881df0c4d41b261.zip |
deps: upgrade V8 to 4.5.103.24
Upgrade to the latest branch-head for V8 4.5. For the full commit log see
https://github.com/v8/v8-git-mirror/commits/4.5.103.24
PR-URL: https://github.com/nodejs/node/pull/2509
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'deps/v8/src/interface-descriptors.h')
-rw-r--r-- | deps/v8/src/interface-descriptors.h | 210 |
1 files changed, 136 insertions, 74 deletions
diff --git a/deps/v8/src/interface-descriptors.h b/deps/v8/src/interface-descriptors.h index ab1517e0df..f206b55841 100644 --- a/deps/v8/src/interface-descriptors.h +++ b/deps/v8/src/interface-descriptors.h @@ -18,9 +18,10 @@ class PlatformInterfaceDescriptor; V(Store) \ V(StoreTransition) \ V(ElementTransitionAndStore) \ + V(VectorStoreICTrampoline) \ + V(VectorStoreIC) \ V(Instanceof) \ - V(VectorLoadICTrampoline) \ - V(VectorLoadIC) \ + V(LoadWithVector) \ V(FastNewClosure) \ V(FastNewContext) \ V(ToNumber) \ @@ -59,40 +60,50 @@ class PlatformInterfaceDescriptor; V(MathPowTagged) \ V(MathPowInteger) \ V(ContextOnly) \ - V(GrowArrayElements) + V(GrowArrayElements) \ + V(MathRoundVariant) class CallInterfaceDescriptorData { public: - CallInterfaceDescriptorData() : register_param_count_(-1) {} + CallInterfaceDescriptorData() + : stack_paramater_count_(-1), + register_param_count_(-1), + function_type_(nullptr) {} // A copy of the passed in registers and param_representations is made // and owned by the CallInterfaceDescriptorData. + void InitializePlatformIndependent(int stack_paramater_count, + Type::FunctionType* function_type) { + function_type_ = function_type; + stack_paramater_count_ = stack_paramater_count; + } + // TODO(mvstanton): Instead of taking parallel arrays register and // param_representations, how about a struct that puts the representation // and register side by side (eg, RegRep(r1, Representation::Tagged()). // The same should go for the CodeStubDescriptor class. - void Initialize(int register_parameter_count, Register* registers, - Representation* param_representations, - PlatformInterfaceDescriptor* platform_descriptor = NULL); + void InitializePlatformSpecific( + int register_parameter_count, Register* registers, + PlatformInterfaceDescriptor* platform_descriptor = NULL); bool IsInitialized() const { return register_param_count_ >= 0; } int register_param_count() const { return register_param_count_; } Register register_param(int index) const { return register_params_[index]; } Register* register_params() const { return register_params_.get(); } - Representation register_param_representation(int index) const { - return register_param_representations_[index]; - } - Representation* register_param_representations() const { - return register_param_representations_.get(); + Type* register_param_type(int index) const { + return function_type_->Parameter(index); } PlatformInterfaceDescriptor* platform_specific_descriptor() const { return platform_specific_descriptor_; } + Type::FunctionType* function_type() const { return function_type_; } + private: + int stack_paramater_count_; int register_param_count_; // The Register params are allocated dynamically by the @@ -100,11 +111,9 @@ class CallInterfaceDescriptorData { // arrays of Registers cause creation of runtime static initializers // which we don't want. SmartArrayPointer<Register> register_params_; - // Specifies Representations for the stub's parameter. Points to an array of - // Representations of the same length of the numbers of parameters to the - // stub, or if NULL (the default value), Representation of each parameter - // assumed to be Tagged(). - SmartArrayPointer<Representation> register_param_representations_; + + // Specifies types for parameters and return + Type::FunctionType* function_type_; PlatformInterfaceDescriptor* platform_specific_descriptor_; @@ -126,41 +135,26 @@ class CallDescriptors { class CallInterfaceDescriptor { public: CallInterfaceDescriptor() : data_(NULL) {} + virtual ~CallInterfaceDescriptor() {} CallInterfaceDescriptor(Isolate* isolate, CallDescriptors::Key key) : data_(isolate->call_descriptor_data(key)) {} - int GetEnvironmentLength() const { return data()->register_param_count(); } - int GetRegisterParameterCount() const { return data()->register_param_count(); } - Register GetParameterRegister(int index) const { - return data()->register_param(index); - } - - Representation GetParameterRepresentation(int index) const { - DCHECK(index < data()->register_param_count()); - if (data()->register_param_representations() == NULL) { - return Representation::Tagged(); - } - - return data()->register_param_representation(index); - } - - // "Environment" versions of parameter functions. The first register - // parameter (context) is not included. - int GetEnvironmentParameterCount() const { - return GetEnvironmentLength() - 1; + int GetStackParameterCount() const { + return data()->function_type()->Arity() - data()->register_param_count(); } - Register GetEnvironmentParameterRegister(int index) const { - return GetParameterRegister(index + 1); + Register GetRegisterParameter(int index) const { + return data()->register_param(index); } - Representation GetEnvironmentParameterRepresentation(int index) const { - return GetParameterRepresentation(index + 1); + Type* GetParameterType(int index) const { + DCHECK(index < data()->register_param_count()); + return data()->register_param_type(index); } // Some platforms have extra information to associate with the descriptor. @@ -168,40 +162,75 @@ class CallInterfaceDescriptor { return data()->platform_specific_descriptor(); } + Type::FunctionType* GetFunctionType() const { + return data()->function_type(); + } + static const Register ContextRegister(); const char* DebugName(Isolate* isolate) const; + static Type::FunctionType* BuildDefaultFunctionType(Isolate* isolate, + int paramater_count); + protected: const CallInterfaceDescriptorData* data() const { return data_; } + virtual Type::FunctionType* BuildCallInterfaceDescriptorFunctionType( + Isolate* isolate, int register_param_count) { + return BuildDefaultFunctionType(isolate, register_param_count); + } + + virtual void InitializePlatformSpecific(CallInterfaceDescriptorData* data) { + UNREACHABLE(); + } + + void Initialize(Isolate* isolate, CallDescriptors::Key key) { + if (!data()->IsInitialized()) { + CallInterfaceDescriptorData* d = isolate->call_descriptor_data(key); + InitializePlatformSpecific(d); + Type::FunctionType* function_type = + BuildCallInterfaceDescriptorFunctionType(isolate, + d->register_param_count()); + d->InitializePlatformIndependent(0, function_type); + } + } + private: const CallInterfaceDescriptorData* data_; }; -#define DECLARE_DESCRIPTOR(name, base) \ - explicit name(Isolate* isolate) : base(isolate, key()) { \ - if (!data()->IsInitialized()) \ - Initialize(isolate->call_descriptor_data(key())); \ - } \ - \ - protected: \ - void Initialize(CallInterfaceDescriptorData* data); \ - name(Isolate* isolate, CallDescriptors::Key key) : base(isolate, key) {} \ - \ - public: \ +#define DECLARE_DESCRIPTOR(name, base) \ + explicit name(Isolate* isolate) : base(isolate, key()) { \ + Initialize(isolate, key()); \ + } \ + \ + protected: \ + void InitializePlatformSpecific(CallInterfaceDescriptorData* data) override; \ + name(Isolate* isolate, CallDescriptors::Key key) : base(isolate, key) {} \ + \ + public: \ static inline CallDescriptors::Key key(); +#define DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(name, base) \ + DECLARE_DESCRIPTOR(name, base) \ + protected: \ + virtual Type::FunctionType* BuildCallInterfaceDescriptorFunctionType( \ + Isolate* isolate, int register_param_count) override; \ + \ + public: // LoadDescriptor is used by all stubs that implement Load/KeyedLoad ICs. class LoadDescriptor : public CallInterfaceDescriptor { public: - DECLARE_DESCRIPTOR(LoadDescriptor, CallInterfaceDescriptor) + DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(LoadDescriptor, + CallInterfaceDescriptor) - enum ParameterIndices { kReceiverIndex, kNameIndex }; + enum ParameterIndices { kReceiverIndex, kNameIndex, kSlotIndex }; static const Register ReceiverRegister(); static const Register NameRegister(); + static const Register SlotRegister(); }; @@ -255,19 +284,38 @@ class InstanceofDescriptor : public CallInterfaceDescriptor { }; -class VectorLoadICTrampolineDescriptor : public LoadDescriptor { +class VectorStoreICTrampolineDescriptor : public StoreDescriptor { public: - DECLARE_DESCRIPTOR(VectorLoadICTrampolineDescriptor, LoadDescriptor) + DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE( + VectorStoreICTrampolineDescriptor, StoreDescriptor) - enum ParameterIndices { kReceiverIndex, kNameIndex, kSlotIndex }; + enum ParameterIndices { kReceiverIndex, kNameIndex, kValueIndex, kSlotIndex }; static const Register SlotRegister(); }; -class VectorLoadICDescriptor : public VectorLoadICTrampolineDescriptor { +class VectorStoreICDescriptor : public VectorStoreICTrampolineDescriptor { public: - DECLARE_DESCRIPTOR(VectorLoadICDescriptor, VectorLoadICTrampolineDescriptor) + DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE( + VectorStoreICDescriptor, VectorStoreICTrampolineDescriptor) + + enum ParameterIndices { + kReceiverIndex, + kNameIndex, + kValueIndex, + kSlotIndex, + kVectorIndex + }; + + static const Register VectorRegister(); +}; + + +class LoadWithVectorDescriptor : public LoadDescriptor { + public: + DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(LoadWithVectorDescriptor, + LoadDescriptor) enum ParameterIndices { kReceiverIndex, @@ -312,7 +360,8 @@ class TypeofDescriptor : public CallInterfaceDescriptor { class FastCloneShallowArrayDescriptor : public CallInterfaceDescriptor { public: - DECLARE_DESCRIPTOR(FastCloneShallowArrayDescriptor, CallInterfaceDescriptor) + DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(FastCloneShallowArrayDescriptor, + CallInterfaceDescriptor) }; @@ -324,7 +373,8 @@ class FastCloneShallowObjectDescriptor : public CallInterfaceDescriptor { class CreateAllocationSiteDescriptor : public CallInterfaceDescriptor { public: - DECLARE_DESCRIPTOR(CreateAllocationSiteDescriptor, CallInterfaceDescriptor) + DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(CreateAllocationSiteDescriptor, + CallInterfaceDescriptor) }; @@ -337,7 +387,8 @@ class CreateWeakCellDescriptor : public CallInterfaceDescriptor { kParameterCount }; - DECLARE_DESCRIPTOR(CreateWeakCellDescriptor, CallInterfaceDescriptor) + DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(CreateWeakCellDescriptor, + CallInterfaceDescriptor) }; @@ -349,16 +400,16 @@ class CallFunctionDescriptor : public CallInterfaceDescriptor { class CallFunctionWithFeedbackDescriptor : public CallInterfaceDescriptor { public: - DECLARE_DESCRIPTOR(CallFunctionWithFeedbackDescriptor, - CallInterfaceDescriptor) + DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE( + CallFunctionWithFeedbackDescriptor, CallInterfaceDescriptor) }; class CallFunctionWithFeedbackAndVectorDescriptor : public CallInterfaceDescriptor { public: - DECLARE_DESCRIPTOR(CallFunctionWithFeedbackAndVectorDescriptor, - CallInterfaceDescriptor) + DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE( + CallFunctionWithFeedbackAndVectorDescriptor, CallInterfaceDescriptor) }; @@ -396,7 +447,8 @@ class ArrayConstructorConstantArgCountDescriptor class ArrayConstructorDescriptor : public CallInterfaceDescriptor { public: - DECLARE_DESCRIPTOR(ArrayConstructorDescriptor, CallInterfaceDescriptor) + DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ArrayConstructorDescriptor, + CallInterfaceDescriptor) }; @@ -410,8 +462,8 @@ class InternalArrayConstructorConstantArgCountDescriptor class InternalArrayConstructorDescriptor : public CallInterfaceDescriptor { public: - DECLARE_DESCRIPTOR(InternalArrayConstructorDescriptor, - CallInterfaceDescriptor) + DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE( + InternalArrayConstructorDescriptor, CallInterfaceDescriptor) }; @@ -472,25 +524,29 @@ class CallHandlerDescriptor : public CallInterfaceDescriptor { class ArgumentAdaptorDescriptor : public CallInterfaceDescriptor { public: - DECLARE_DESCRIPTOR(ArgumentAdaptorDescriptor, CallInterfaceDescriptor) + DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ArgumentAdaptorDescriptor, + CallInterfaceDescriptor) }; class ApiFunctionDescriptor : public CallInterfaceDescriptor { public: - DECLARE_DESCRIPTOR(ApiFunctionDescriptor, CallInterfaceDescriptor) + DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ApiFunctionDescriptor, + CallInterfaceDescriptor) }; class ApiAccessorDescriptor : public CallInterfaceDescriptor { public: - DECLARE_DESCRIPTOR(ApiAccessorDescriptor, CallInterfaceDescriptor) + DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ApiAccessorDescriptor, + CallInterfaceDescriptor) }; class ApiGetterDescriptor : public CallInterfaceDescriptor { public: - DECLARE_DESCRIPTOR(ApiGetterDescriptor, CallInterfaceDescriptor) + DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ApiGetterDescriptor, + CallInterfaceDescriptor) static const Register function_address(); }; @@ -528,6 +584,13 @@ class MathPowIntegerDescriptor : public CallInterfaceDescriptor { }; +class MathRoundVariantDescriptor : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(MathRoundVariantDescriptor, + CallInterfaceDescriptor) +}; + + class ContextOnlyDescriptor : public CallInterfaceDescriptor { public: DECLARE_DESCRIPTOR(ContextOnlyDescriptor, CallInterfaceDescriptor) @@ -538,10 +601,9 @@ class GrowArrayElementsDescriptor : public CallInterfaceDescriptor { public: DECLARE_DESCRIPTOR(GrowArrayElementsDescriptor, CallInterfaceDescriptor) - enum RegisterInfo { kObjectIndex, kKeyIndex, kCapacityIndex }; + enum RegisterInfo { kObjectIndex, kKeyIndex }; static const Register ObjectRegister(); static const Register KeyRegister(); - static const Register CapacityRegister(); }; #undef DECLARE_DESCRIPTOR |