Moved non-architecture-specific GetFooCodeStub functions to ic.cc, removing

duplicate code and the need for 2 free-floating function prototypes.
Review URL: http://codereview.chromium.org/7134043

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8240 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 827be16b
...@@ -1707,12 +1707,6 @@ void ToBooleanStub::Generate(MacroAssembler* masm) { ...@@ -1707,12 +1707,6 @@ void ToBooleanStub::Generate(MacroAssembler* masm) {
} }
Handle<Code> GetUnaryOpStub(int key, UnaryOpIC::TypeInfo type_info) {
UnaryOpStub stub(key, type_info);
return stub.GetCode();
}
const char* UnaryOpStub::GetName() { const char* UnaryOpStub::GetName() {
if (name_ != NULL) return name_; if (name_ != NULL) return name_;
const int kMaxNameLength = 100; const int kMaxNameLength = 100;
...@@ -2019,14 +2013,6 @@ void UnaryOpStub::GenerateGenericCodeFallback(MacroAssembler* masm) { ...@@ -2019,14 +2013,6 @@ void UnaryOpStub::GenerateGenericCodeFallback(MacroAssembler* masm) {
} }
Handle<Code> GetBinaryOpStub(int key,
BinaryOpIC::TypeInfo type_info,
BinaryOpIC::TypeInfo result_type_info) {
BinaryOpStub stub(key, type_info, result_type_info);
return stub.GetCode();
}
void BinaryOpStub::GenerateTypeTransition(MacroAssembler* masm) { void BinaryOpStub::GenerateTypeTransition(MacroAssembler* masm) {
Label get_result; Label get_result;
......
...@@ -514,12 +514,6 @@ static void IntegerConvert(MacroAssembler* masm, ...@@ -514,12 +514,6 @@ static void IntegerConvert(MacroAssembler* masm,
} }
Handle<Code> GetUnaryOpStub(int key, UnaryOpIC::TypeInfo type_info) {
UnaryOpStub stub(key, type_info);
return stub.GetCode();
}
const char* UnaryOpStub::GetName() { const char* UnaryOpStub::GetName() {
if (name_ != NULL) return name_; if (name_ != NULL) return name_;
const int kMaxNameLength = 100; const int kMaxNameLength = 100;
...@@ -850,14 +844,6 @@ void UnaryOpStub::GenerateGenericCodeFallback(MacroAssembler* masm) { ...@@ -850,14 +844,6 @@ void UnaryOpStub::GenerateGenericCodeFallback(MacroAssembler* masm) {
} }
Handle<Code> GetBinaryOpStub(int key,
BinaryOpIC::TypeInfo type_info,
BinaryOpIC::TypeInfo result_type_info) {
BinaryOpStub stub(key, type_info, result_type_info);
return stub.GetCode();
}
void BinaryOpStub::GenerateTypeTransition(MacroAssembler* masm) { void BinaryOpStub::GenerateTypeTransition(MacroAssembler* masm) {
__ pop(ecx); // Save return address. __ pop(ecx); // Save return address.
__ push(edx); __ push(edx);
......
...@@ -2293,11 +2293,6 @@ BinaryOpIC::TypeInfo BinaryOpIC::GetTypeInfo(Handle<Object> left, ...@@ -2293,11 +2293,6 @@ BinaryOpIC::TypeInfo BinaryOpIC::GetTypeInfo(Handle<Object> left,
} }
// defined in code-stubs-<arch>.cc
// Only needed to remove dependency of ic.cc on code-stubs-<arch>.h.
Handle<Code> GetUnaryOpStub(int key, UnaryOpIC::TypeInfo type_info);
RUNTIME_FUNCTION(MaybeObject*, UnaryOp_Patch) { RUNTIME_FUNCTION(MaybeObject*, UnaryOp_Patch) {
ASSERT(args.length() == 4); ASSERT(args.length() == 4);
...@@ -2311,7 +2306,8 @@ RUNTIME_FUNCTION(MaybeObject*, UnaryOp_Patch) { ...@@ -2311,7 +2306,8 @@ RUNTIME_FUNCTION(MaybeObject*, UnaryOp_Patch) {
UnaryOpIC::TypeInfo type = UnaryOpIC::GetTypeInfo(operand); UnaryOpIC::TypeInfo type = UnaryOpIC::GetTypeInfo(operand);
type = UnaryOpIC::ComputeNewType(type, previous_type); type = UnaryOpIC::ComputeNewType(type, previous_type);
Handle<Code> code = GetUnaryOpStub(key, type); UnaryOpStub stub(key, type);
Handle<Code> code = stub.GetCode();
if (!code.is_null()) { if (!code.is_null()) {
if (FLAG_trace_ic) { if (FLAG_trace_ic) {
PrintF("[UnaryOpIC (%s->%s)#%s]\n", PrintF("[UnaryOpIC (%s->%s)#%s]\n",
...@@ -2348,13 +2344,6 @@ RUNTIME_FUNCTION(MaybeObject*, UnaryOp_Patch) { ...@@ -2348,13 +2344,6 @@ RUNTIME_FUNCTION(MaybeObject*, UnaryOp_Patch) {
return *result; return *result;
} }
// defined in code-stubs-<arch>.cc
// Only needed to remove dependency of ic.cc on code-stubs-<arch>.h.
Handle<Code> GetBinaryOpStub(int key,
BinaryOpIC::TypeInfo type_info,
BinaryOpIC::TypeInfo result_type);
RUNTIME_FUNCTION(MaybeObject*, BinaryOp_Patch) { RUNTIME_FUNCTION(MaybeObject*, BinaryOp_Patch) {
ASSERT(args.length() == 5); ASSERT(args.length() == 5);
...@@ -2393,7 +2382,8 @@ RUNTIME_FUNCTION(MaybeObject*, BinaryOp_Patch) { ...@@ -2393,7 +2382,8 @@ RUNTIME_FUNCTION(MaybeObject*, BinaryOp_Patch) {
result_type = BinaryOpIC::HEAP_NUMBER; result_type = BinaryOpIC::HEAP_NUMBER;
} }
Handle<Code> code = GetBinaryOpStub(key, type, result_type); BinaryOpStub stub(key, type, result_type);
Handle<Code> code = stub.GetCode();
if (!code.is_null()) { if (!code.is_null()) {
if (FLAG_trace_ic) { if (FLAG_trace_ic) {
PrintF("[BinaryOpIC (%s->(%s->%s))#%s]\n", PrintF("[BinaryOpIC (%s->(%s->%s))#%s]\n",
......
...@@ -1805,12 +1805,6 @@ void ToBooleanStub::Generate(MacroAssembler* masm) { ...@@ -1805,12 +1805,6 @@ void ToBooleanStub::Generate(MacroAssembler* masm) {
} }
Handle<Code> GetUnaryOpStub(int key, UnaryOpIC::TypeInfo type_info) {
UnaryOpStub stub(key, type_info);
return stub.GetCode();
}
const char* UnaryOpStub::GetName() { const char* UnaryOpStub::GetName() {
if (name_ != NULL) return name_; if (name_ != NULL) return name_;
const int kMaxNameLength = 100; const int kMaxNameLength = 100;
...@@ -2118,14 +2112,6 @@ void UnaryOpStub::GenerateGenericCodeFallback( ...@@ -2118,14 +2112,6 @@ void UnaryOpStub::GenerateGenericCodeFallback(
} }
Handle<Code> GetBinaryOpStub(int key,
BinaryOpIC::TypeInfo type_info,
BinaryOpIC::TypeInfo result_type_info) {
BinaryOpStub stub(key, type_info, result_type_info);
return stub.GetCode();
}
void BinaryOpStub::GenerateTypeTransition(MacroAssembler* masm) { void BinaryOpStub::GenerateTypeTransition(MacroAssembler* masm) {
Label get_result; Label get_result;
......
...@@ -406,12 +406,6 @@ void IntegerConvert(MacroAssembler* masm, ...@@ -406,12 +406,6 @@ void IntegerConvert(MacroAssembler* masm,
} }
Handle<Code> GetUnaryOpStub(int key, UnaryOpIC::TypeInfo type_info) {
UnaryOpStub stub(key, type_info);
return stub.GetCode();
}
void UnaryOpStub::Generate(MacroAssembler* masm) { void UnaryOpStub::Generate(MacroAssembler* masm) {
switch (operand_type_) { switch (operand_type_) {
case UnaryOpIC::UNINITIALIZED: case UnaryOpIC::UNINITIALIZED:
...@@ -677,14 +671,6 @@ const char* UnaryOpStub::GetName() { ...@@ -677,14 +671,6 @@ const char* UnaryOpStub::GetName() {
} }
Handle<Code> GetBinaryOpStub(int key,
BinaryOpIC::TypeInfo type_info,
BinaryOpIC::TypeInfo result_type_info) {
BinaryOpStub stub(key, type_info, result_type_info);
return stub.GetCode();
}
void BinaryOpStub::GenerateTypeTransition(MacroAssembler* masm) { void BinaryOpStub::GenerateTypeTransition(MacroAssembler* masm) {
__ pop(rcx); // Save return address. __ pop(rcx); // Save return address.
__ push(rdx); __ push(rdx);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment