Commit 9f91fde0 authored by loislo's avatar loislo Committed by Commit bot

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}
parent 15f82138
...@@ -135,7 +135,7 @@ bool Deoptimizer::HasAlignmentPadding(JSFunction* function) { ...@@ -135,7 +135,7 @@ bool Deoptimizer::HasAlignmentPadding(JSFunction* function) {
// This code tries to be close to ia32 code so that any changes can be // This code tries to be close to ia32 code so that any changes can be
// easily ported. // easily ported.
void Deoptimizer::EntryGenerator::Generate() { void Deoptimizer::TableEntryGenerator::Generate() {
GeneratePrologue(); GeneratePrologue();
// Save all general purpose registers before messing with them. // Save all general purpose registers before messing with them.
......
...@@ -115,7 +115,7 @@ void Deoptimizer::CopyDoubleRegisters(FrameDescription* output_frame) { ...@@ -115,7 +115,7 @@ void Deoptimizer::CopyDoubleRegisters(FrameDescription* output_frame) {
#define __ masm()-> #define __ masm()->
void Deoptimizer::EntryGenerator::Generate() { void Deoptimizer::TableEntryGenerator::Generate() {
GeneratePrologue(); GeneratePrologue();
// TODO(all): This code needs to be revisited. We probably only need to save // TODO(all): This code needs to be revisited. We probably only need to save
......
...@@ -322,11 +322,10 @@ class Deoptimizer : public Malloced { ...@@ -322,11 +322,10 @@ class Deoptimizer : public Malloced {
static const int kNotDeoptimizationEntry = -1; static const int kNotDeoptimizationEntry = -1;
// Generators for the deoptimization entry code. // Generators for the deoptimization entry code.
class EntryGenerator BASE_EMBEDDED { class TableEntryGenerator BASE_EMBEDDED {
public: public:
EntryGenerator(MacroAssembler* masm, BailoutType type) TableEntryGenerator(MacroAssembler* masm, BailoutType type, int count)
: masm_(masm), type_(type) { } : masm_(masm), type_(type), count_(count) {}
virtual ~EntryGenerator() { }
void Generate(); void Generate();
...@@ -335,24 +334,13 @@ class Deoptimizer : public Malloced { ...@@ -335,24 +334,13 @@ class Deoptimizer : public Malloced {
BailoutType type() const { return type_; } BailoutType type() const { return type_; }
Isolate* isolate() const { return masm_->isolate(); } Isolate* isolate() const { return masm_->isolate(); }
virtual void GeneratePrologue() { } 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();
private: private:
int count() const { return count_; } int count() const { return count_; }
MacroAssembler* masm_;
Deoptimizer::BailoutType type_;
int count_; int count_;
}; };
......
...@@ -228,7 +228,7 @@ bool Deoptimizer::HasAlignmentPadding(JSFunction* function) { ...@@ -228,7 +228,7 @@ bool Deoptimizer::HasAlignmentPadding(JSFunction* function) {
#define __ masm()-> #define __ masm()->
void Deoptimizer::EntryGenerator::Generate() { void Deoptimizer::TableEntryGenerator::Generate() {
GeneratePrologue(); GeneratePrologue();
// Save all general purpose registers before messing with them. // Save all general purpose registers before messing with them.
......
...@@ -132,7 +132,7 @@ bool Deoptimizer::HasAlignmentPadding(JSFunction* function) { ...@@ -132,7 +132,7 @@ bool Deoptimizer::HasAlignmentPadding(JSFunction* function) {
// This code tries to be close to ia32 code so that any changes can be // This code tries to be close to ia32 code so that any changes can be
// easily ported. // easily ported.
void Deoptimizer::EntryGenerator::Generate() { void Deoptimizer::TableEntryGenerator::Generate() {
GeneratePrologue(); GeneratePrologue();
// Unlike on ARM we don't save all the registers, just the useful ones. // Unlike on ARM we don't save all the registers, just the useful ones.
......
...@@ -131,7 +131,7 @@ bool Deoptimizer::HasAlignmentPadding(JSFunction* function) { ...@@ -131,7 +131,7 @@ bool Deoptimizer::HasAlignmentPadding(JSFunction* function) {
// This code tries to be close to ia32 code so that any changes can be // This code tries to be close to ia32 code so that any changes can be
// easily ported. // easily ported.
void Deoptimizer::EntryGenerator::Generate() { void Deoptimizer::TableEntryGenerator::Generate() {
GeneratePrologue(); GeneratePrologue();
// Unlike on ARM we don't save all the registers, just the useful ones. // Unlike on ARM we don't save all the registers, just the useful ones.
......
...@@ -142,7 +142,7 @@ bool Deoptimizer::HasAlignmentPadding(JSFunction* function) { ...@@ -142,7 +142,7 @@ bool Deoptimizer::HasAlignmentPadding(JSFunction* function) {
// This code tries to be close to ia32 code so that any changes can be // This code tries to be close to ia32 code so that any changes can be
// easily ported. // easily ported.
void Deoptimizer::EntryGenerator::Generate() { void Deoptimizer::TableEntryGenerator::Generate() {
GeneratePrologue(); GeneratePrologue();
// Unlike on ARM we don't save all the registers, just the useful ones. // Unlike on ARM we don't save all the registers, just the useful ones.
......
...@@ -134,7 +134,7 @@ bool Deoptimizer::HasAlignmentPadding(JSFunction* function) { ...@@ -134,7 +134,7 @@ bool Deoptimizer::HasAlignmentPadding(JSFunction* function) {
#define __ masm()-> #define __ masm()->
void Deoptimizer::EntryGenerator::Generate() { void Deoptimizer::TableEntryGenerator::Generate() {
GeneratePrologue(); GeneratePrologue();
// Save all general purpose registers before messing with them. // Save all general purpose registers before messing with them.
......
...@@ -228,7 +228,7 @@ bool Deoptimizer::HasAlignmentPadding(JSFunction* function) { ...@@ -228,7 +228,7 @@ bool Deoptimizer::HasAlignmentPadding(JSFunction* function) {
#define __ masm()-> #define __ masm()->
void Deoptimizer::EntryGenerator::Generate() { void Deoptimizer::TableEntryGenerator::Generate() {
GeneratePrologue(); GeneratePrologue();
// Save all general purpose registers before messing with them. // Save all general purpose registers before messing with them.
......
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