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

Unified Diff: src/code-stubs.h

Issue 523583002: Multiple stubs can point to the same calling convention. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Ports. Created 6 years, 4 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/interface-descriptors-arm64.cc ('k') | src/code-stubs.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 e689cb5f2bf1d34a8f5b2ee93fea86bfb6e686c2..5bc59f46f87da7213d22e90d9792a2bea7c58a31 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -281,19 +281,19 @@ enum StubFunctionMode { NOT_JS_FUNCTION_STUB_MODE, JS_FUNCTION_STUB_MODE };
enum HandlerArgumentsMode { DONT_PASS_ARGUMENTS, PASS_ARGUMENTS };
-class CodeStubInterfaceDescriptor: public InterfaceDescriptor {
+class CodeStubInterfaceDescriptor {
public:
CodeStubInterfaceDescriptor();
- void Initialize(CodeStub::Major major, int register_parameter_count,
- Register* registers, Address deoptimization_handler = NULL,
- Representation* register_param_representations = NULL,
+ void Initialize(CodeStub::Major major,
+ CallInterfaceDescriptor* call_descriptor,
+ Address deoptimization_handler = NULL,
int hint_stack_parameter_count = -1,
StubFunctionMode function_mode = NOT_JS_FUNCTION_STUB_MODE);
- void Initialize(CodeStub::Major major, int register_parameter_count,
- Register* registers, Register stack_parameter_count,
+ void Initialize(CodeStub::Major major,
+ CallInterfaceDescriptor* call_descriptor,
+ Register stack_parameter_count,
Address deoptimization_handler = NULL,
- Representation* register_param_representations = NULL,
int hint_stack_parameter_count = -1,
StubFunctionMode function_mode = NOT_JS_FUNCTION_STUB_MODE,
HandlerArgumentsMode handler_mode = DONT_PASS_ARGUMENTS);
@@ -306,6 +306,38 @@ class CodeStubInterfaceDescriptor: public InterfaceDescriptor {
DCHECK(!stack_parameter_count_.is_valid());
}
+ bool IsInitialized() const { return call_descriptor_ != NULL; }
+
+ CallInterfaceDescriptor* call_descriptor() const { return call_descriptor_; }
+
+ int GetEnvironmentLength() const {
+ return call_descriptor()->GetEnvironmentLength();
+ }
+
+ int GetRegisterParameterCount() const {
+ return call_descriptor()->GetRegisterParameterCount();
+ }
+
+ Register GetParameterRegister(int index) const {
+ return call_descriptor()->GetParameterRegister(index);
+ }
+
+ Representation GetParameterRepresentation(int index) const {
+ return call_descriptor()->GetParameterRepresentation(index);
+ }
+
+ int GetEnvironmentParameterCount() const {
+ return call_descriptor()->GetEnvironmentParameterCount();
+ }
+
+ Register GetEnvironmentParameterRegister(int index) const {
+ return call_descriptor()->GetEnvironmentParameterRegister(index);
+ }
+
+ Representation GetEnvironmentParameterRepresentation(int index) const {
+ return call_descriptor()->GetEnvironmentParameterRepresentation(index);
+ }
+
ExternalReference miss_handler() const {
DCHECK(has_miss_handler_);
return miss_handler_;
@@ -316,11 +348,12 @@ class CodeStubInterfaceDescriptor: public InterfaceDescriptor {
}
bool IsEnvironmentParameterCountRegister(int index) const {
- return GetEnvironmentParameterRegister(index).is(stack_parameter_count_);
+ return call_descriptor()->GetEnvironmentParameterRegister(index).is(
+ stack_parameter_count_);
}
int GetHandlerParameterCount() const {
- int params = GetEnvironmentParameterCount();
+ int params = call_descriptor()->GetEnvironmentParameterCount();
if (handler_arguments_mode_ == PASS_ARGUMENTS) {
params += 1;
}
@@ -334,6 +367,7 @@ class CodeStubInterfaceDescriptor: public InterfaceDescriptor {
CodeStub::Major MajorKey() const { return major_; }
private:
+ CallInterfaceDescriptor* call_descriptor_;
Register stack_parameter_count_;
// If hint_stack_parameter_count_ > 0, the code stub can optimize the
// return sequence. Default value is -1, which means it is ignored.
@@ -671,8 +705,8 @@ class InstanceofStub: public PlatformCodeStub {
void Generate(MacroAssembler* masm);
- static Register left();
- static Register right();
+ static Register left() { return InstanceofConvention::left(); }
+ static Register right() { return InstanceofConvention::right(); }
virtual void InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor);
« no previous file with comments | « src/arm64/interface-descriptors-arm64.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698