CodeCleanup: eliminate unnecessary base class and make the children unvirtual.

I found some strange split in deopt entry points generator.
The code for table entry generator had two classes.
It is safe to join these classes together and drop virtual.

BUG=
LOG=n

Review URL: https://codereview.chromium.org/1010413003

Cr-Commit-Position: refs/heads/master@{#27264}
This commit is contained in:
loislo 2015-03-18 03:34:09 -07:00 committed by Commit bot
parent 15f8213809
commit 9f91fde045
9 changed files with 14 additions and 26 deletions

View File

@ -135,7 +135,7 @@ bool Deoptimizer::HasAlignmentPadding(JSFunction* function) {
// This code tries to be close to ia32 code so that any changes can be
// easily ported.
void Deoptimizer::EntryGenerator::Generate() {
void Deoptimizer::TableEntryGenerator::Generate() {
GeneratePrologue();
// Save all general purpose registers before messing with them.

View File

@ -115,7 +115,7 @@ void Deoptimizer::CopyDoubleRegisters(FrameDescription* output_frame) {
#define __ masm()->
void Deoptimizer::EntryGenerator::Generate() {
void Deoptimizer::TableEntryGenerator::Generate() {
GeneratePrologue();
// TODO(all): This code needs to be revisited. We probably only need to save

View File

@ -322,11 +322,10 @@ class Deoptimizer : public Malloced {
static const int kNotDeoptimizationEntry = -1;
// Generators for the deoptimization entry code.
class EntryGenerator BASE_EMBEDDED {
class TableEntryGenerator BASE_EMBEDDED {
public:
EntryGenerator(MacroAssembler* masm, BailoutType type)
: masm_(masm), type_(type) { }
virtual ~EntryGenerator() { }
TableEntryGenerator(MacroAssembler* masm, BailoutType type, int count)
: masm_(masm), type_(type), count_(count) {}
void Generate();
@ -335,24 +334,13 @@ class Deoptimizer : public Malloced {
BailoutType type() const { return type_; }
Isolate* isolate() const { return masm_->isolate(); }
virtual void GeneratePrologue() { }
private:
MacroAssembler* masm_;
Deoptimizer::BailoutType type_;
};
class TableEntryGenerator : public EntryGenerator {
public:
TableEntryGenerator(MacroAssembler* masm, BailoutType type, int count)
: EntryGenerator(masm, type), count_(count) { }
protected:
virtual void GeneratePrologue();
void GeneratePrologue();
private:
int count() const { return count_; }
MacroAssembler* masm_;
Deoptimizer::BailoutType type_;
int count_;
};

View File

@ -228,7 +228,7 @@ bool Deoptimizer::HasAlignmentPadding(JSFunction* function) {
#define __ masm()->
void Deoptimizer::EntryGenerator::Generate() {
void Deoptimizer::TableEntryGenerator::Generate() {
GeneratePrologue();
// Save all general purpose registers before messing with them.

View File

@ -132,7 +132,7 @@ bool Deoptimizer::HasAlignmentPadding(JSFunction* function) {
// This code tries to be close to ia32 code so that any changes can be
// easily ported.
void Deoptimizer::EntryGenerator::Generate() {
void Deoptimizer::TableEntryGenerator::Generate() {
GeneratePrologue();
// Unlike on ARM we don't save all the registers, just the useful ones.

View File

@ -131,7 +131,7 @@ bool Deoptimizer::HasAlignmentPadding(JSFunction* function) {
// This code tries to be close to ia32 code so that any changes can be
// easily ported.
void Deoptimizer::EntryGenerator::Generate() {
void Deoptimizer::TableEntryGenerator::Generate() {
GeneratePrologue();
// Unlike on ARM we don't save all the registers, just the useful ones.

View File

@ -142,7 +142,7 @@ bool Deoptimizer::HasAlignmentPadding(JSFunction* function) {
// This code tries to be close to ia32 code so that any changes can be
// easily ported.
void Deoptimizer::EntryGenerator::Generate() {
void Deoptimizer::TableEntryGenerator::Generate() {
GeneratePrologue();
// Unlike on ARM we don't save all the registers, just the useful ones.

View File

@ -134,7 +134,7 @@ bool Deoptimizer::HasAlignmentPadding(JSFunction* function) {
#define __ masm()->
void Deoptimizer::EntryGenerator::Generate() {
void Deoptimizer::TableEntryGenerator::Generate() {
GeneratePrologue();
// Save all general purpose registers before messing with them.

View File

@ -228,7 +228,7 @@ bool Deoptimizer::HasAlignmentPadding(JSFunction* function) {
#define __ masm()->
void Deoptimizer::EntryGenerator::Generate() {
void Deoptimizer::TableEntryGenerator::Generate() {
GeneratePrologue();
// Save all general purpose registers before messing with them.