Index: src/code-stubs.cc |
diff --git a/src/code-stubs.cc b/src/code-stubs.cc |
index 5a3f4e4c34d23aff9289bdf472104d5d0accf652..e24d39e66944995475649ed2f8014c1c339635d8 100644 |
--- a/src/code-stubs.cc |
+++ b/src/code-stubs.cc |
@@ -16,9 +16,12 @@ namespace v8 { |
namespace internal { |
+InterfaceDescriptor::InterfaceDescriptor() |
+ : register_param_count_(-1) { } |
+ |
+ |
CodeStubInterfaceDescriptor::CodeStubInterfaceDescriptor() |
- : register_param_count_(-1), |
- stack_parameter_count_(no_reg), |
+ : stack_parameter_count_(no_reg), |
hint_stack_parameter_count_(-1), |
function_mode_(NOT_JS_FUNCTION_STUB_MODE), |
deoptimization_handler_(NULL), |
@@ -27,17 +30,16 @@ CodeStubInterfaceDescriptor::CodeStubInterfaceDescriptor() |
has_miss_handler_(false) { } |
-void CodeStubInterfaceDescriptor::Initialize( |
+void InterfaceDescriptor::Initialize( |
int register_parameter_count, |
Register* registers, |
- Address deoptimization_handler, |
- Representation* register_param_representations, |
- int hint_stack_parameter_count, |
- StubFunctionMode function_mode) { |
- // CodeStubInterfaceDescriptor owns a copy of the registers array. |
+ Representation* register_param_representations) { |
register_param_count_ = register_parameter_count; |
+ // InterfaceDescriptor owns a copy of the registers array. |
register_params_.Reset(NewArray<Register>(register_parameter_count)); |
for (int i = 0; i < register_parameter_count; i++) { |
+ // InterfaceDescriptors have an implicit context register. |
+ ASSERT(!registers[i].is(ContextRegister())); |
register_params_[i] = registers[i]; |
} |
@@ -50,6 +52,18 @@ void CodeStubInterfaceDescriptor::Initialize( |
register_param_representations_[i] = register_param_representations[i]; |
} |
} |
+} |
+ |
+ |
+void CodeStubInterfaceDescriptor::Initialize( |
+ int register_parameter_count, |
+ Register* registers, |
+ Address deoptimization_handler, |
+ Representation* register_param_representations, |
+ int hint_stack_parameter_count, |
+ StubFunctionMode function_mode) { |
+ InterfaceDescriptor::Initialize(register_parameter_count, registers, |
+ register_param_representations); |
deoptimization_handler_ = deoptimization_handler; |
@@ -82,19 +96,8 @@ void CallInterfaceDescriptor::Initialize( |
Register* registers, |
Representation* param_representations, |
PlatformCallInterfaceDescriptor* platform_descriptor) { |
- // CallInterfaceDescriptor owns a copy of the registers array. |
- register_param_count_ = register_parameter_count; |
- register_params_.Reset(NewArray<Register>(register_parameter_count)); |
- for (int i = 0; i < register_parameter_count; i++) { |
- register_params_[i] = registers[i]; |
- } |
- |
- // Also the register parameter representations. |
- param_representations_.Reset( |
- NewArray<Representation>(register_parameter_count)); |
- for (int i = 0; i < register_parameter_count; i++) { |
- param_representations_[i] = param_representations[i]; |
- } |
+ InterfaceDescriptor::Initialize(register_parameter_count, registers, |
+ param_representations); |
platform_specific_descriptor_ = platform_descriptor; |
} |