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

Unified Diff: src/code-stubs.h

Issue 70203002: Simplify Hydrogen code stubs with variable argument count (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE Created 7 years, 1 month 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/arm/lithium-arm.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 b56a3ecfcb24b94535408b6734aeb8364aa0924a..8f1b686743317a39f95b764933a901de4b788214 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -277,23 +277,23 @@ class PlatformCodeStub : public CodeStub {
enum StubFunctionMode { NOT_JS_FUNCTION_STUB_MODE, JS_FUNCTION_STUB_MODE };
-
+enum HandlerArgumentsMode { DONT_PASS_ARGUMENTS, PASS_ARGUMENTS };
struct CodeStubInterfaceDescriptor {
CodeStubInterfaceDescriptor();
int register_param_count_;
+
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.
int hint_stack_parameter_count_;
StubFunctionMode function_mode_;
Register* register_params_;
+
Address deoptimization_handler_;
+ HandlerArgumentsMode handler_arguments_mode_;
int environment_length() const {
- if (stack_parameter_count_.is_valid()) {
- return register_param_count_ + 1;
- }
return register_param_count_;
}
@@ -302,6 +302,9 @@ struct CodeStubInterfaceDescriptor {
void SetMissHandler(ExternalReference handler) {
miss_handler_ = handler;
has_miss_handler_ = true;
+ // Our miss handler infrastructure doesn't currently support
+ // variable stack parameter counts.
+ ASSERT(!stack_parameter_count_.is_valid());
}
ExternalReference miss_handler() {
@@ -313,18 +316,27 @@ struct CodeStubInterfaceDescriptor {
return has_miss_handler_;
}
+ Register GetParameterRegister(int index) {
+ return register_params_[index];
+ }
+
+ bool IsParameterCountRegister(int index) {
+ return GetParameterRegister(index).is(stack_parameter_count_);
+ }
+
+ int GetHandlerParameterCount() {
+ int params = environment_length();
+ if (handler_arguments_mode_ == PASS_ARGUMENTS) {
+ params += 1;
+ }
+ return params;
+ }
+
private:
ExternalReference miss_handler_;
bool has_miss_handler_;
};
-// A helper to make up for the fact that type Register is not fully
-// defined outside of the platform directories
-#define DESCRIPTOR_GET_PARAMETER_REGISTER(descriptor, index) \
- ((index) == (descriptor)->register_param_count_) \
- ? (descriptor)->stack_parameter_count_ \
- : (descriptor)->register_params_[(index)]
-
class HydrogenCodeStub : public CodeStub {
public:
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698