Commit 7ba6bb4e authored by jochen's avatar jochen Committed by Commit bot

Pass Isolate to CodeAgingHelper

This is a preparation for requiring an isolate to construct a
CodePatcher

BUG=2487
R=epertoso@chromium.org
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#32283}
parent 8452a753
...@@ -885,7 +885,8 @@ void MathExpGenerator::EmitMathExp(MacroAssembler* masm, ...@@ -885,7 +885,8 @@ void MathExpGenerator::EmitMathExp(MacroAssembler* masm,
static const uint32_t kCodeAgePatchFirstInstruction = 0xe24f0008; static const uint32_t kCodeAgePatchFirstInstruction = 0xe24f0008;
#endif #endif
CodeAgingHelper::CodeAgingHelper() { CodeAgingHelper::CodeAgingHelper(Isolate* isolate) {
USE(isolate);
DCHECK(young_sequence_.length() == kNoCodeAgeSequenceLength); DCHECK(young_sequence_.length() == kNoCodeAgeSequenceLength);
// Since patcher is a large object, allocate it dynamically when needed, // Since patcher is a large object, allocate it dynamically when needed,
// to avoid overloading the stack in stress conditions. // to avoid overloading the stack in stress conditions.
......
...@@ -367,7 +367,8 @@ void ElementsTransitionGenerator::GenerateDoubleToObject( ...@@ -367,7 +367,8 @@ void ElementsTransitionGenerator::GenerateDoubleToObject(
} }
CodeAgingHelper::CodeAgingHelper() { CodeAgingHelper::CodeAgingHelper(Isolate* isolate) {
USE(isolate);
DCHECK(young_sequence_.length() == kNoCodeAgeSequenceLength); DCHECK(young_sequence_.length() == kNoCodeAgeSequenceLength);
// The sequence of instructions that is patched out for aging code is the // The sequence of instructions that is patched out for aging code is the
// following boilerplate stack-building prologue that is found both in // following boilerplate stack-building prologue that is found both in
......
...@@ -146,7 +146,7 @@ static const int kNumberDictionaryProbes = 4; ...@@ -146,7 +146,7 @@ static const int kNumberDictionaryProbes = 4;
class CodeAgingHelper { class CodeAgingHelper {
public: public:
CodeAgingHelper(); explicit CodeAgingHelper(Isolate* isolate);
uint32_t young_sequence_length() const { return young_sequence_.length(); } uint32_t young_sequence_length() const { return young_sequence_.length(); }
bool IsYoung(byte* candidate) const { bool IsYoung(byte* candidate) const {
......
...@@ -988,7 +988,8 @@ void MathExpGenerator::EmitMathExp(MacroAssembler* masm, ...@@ -988,7 +988,8 @@ void MathExpGenerator::EmitMathExp(MacroAssembler* masm,
#undef __ #undef __
CodeAgingHelper::CodeAgingHelper() { CodeAgingHelper::CodeAgingHelper(Isolate* isolate) {
USE(isolate);
DCHECK(young_sequence_.length() == kNoCodeAgeSequenceLength); DCHECK(young_sequence_.length() == kNoCodeAgeSequenceLength);
CodePatcher patcher(young_sequence_.start(), young_sequence_.length()); CodePatcher patcher(young_sequence_.start(), young_sequence_.length());
patcher.masm()->push(ebp); patcher.masm()->push(ebp);
......
...@@ -2151,7 +2151,7 @@ bool Isolate::Init(Deserializer* des) { ...@@ -2151,7 +2151,7 @@ bool Isolate::Init(Deserializer* des) {
#endif #endif
#endif #endif
code_aging_helper_ = new CodeAgingHelper(); code_aging_helper_ = new CodeAgingHelper(this);
{ // NOLINT { // NOLINT
// Ensure that the thread has a valid stack guard. The v8::Locker object // Ensure that the thread has a valid stack guard. The v8::Locker object
......
...@@ -1188,7 +1188,8 @@ static const uint32_t kCodeAgePatchFirstInstruction = 0x00010180; ...@@ -1188,7 +1188,8 @@ static const uint32_t kCodeAgePatchFirstInstruction = 0x00010180;
#endif #endif
CodeAgingHelper::CodeAgingHelper() { CodeAgingHelper::CodeAgingHelper(Isolate* isolate) {
USE(isolate);
DCHECK(young_sequence_.length() == kNoCodeAgeSequenceLength); DCHECK(young_sequence_.length() == kNoCodeAgeSequenceLength);
// Since patcher is a large object, allocate it dynamically when needed, // Since patcher is a large object, allocate it dynamically when needed,
// to avoid overloading the stack in stress conditions. // to avoid overloading the stack in stress conditions.
......
...@@ -1183,7 +1183,8 @@ static const uint32_t kCodeAgePatchFirstInstruction = 0x00010180; ...@@ -1183,7 +1183,8 @@ static const uint32_t kCodeAgePatchFirstInstruction = 0x00010180;
#endif #endif
CodeAgingHelper::CodeAgingHelper() { CodeAgingHelper::CodeAgingHelper(Isolate* isolate) {
USE(isolate);
DCHECK(young_sequence_.length() == kNoCodeAgeSequenceLength); DCHECK(young_sequence_.length() == kNoCodeAgeSequenceLength);
// Since patcher is a large object, allocate it dynamically when needed, // Since patcher is a large object, allocate it dynamically when needed,
// to avoid overloading the stack in stress conditions. // to avoid overloading the stack in stress conditions.
......
...@@ -608,7 +608,8 @@ void MathExpGenerator::EmitMathExp(MacroAssembler* masm, DoubleRegister input, ...@@ -608,7 +608,8 @@ void MathExpGenerator::EmitMathExp(MacroAssembler* masm, DoubleRegister input,
#undef __ #undef __
CodeAgingHelper::CodeAgingHelper() { CodeAgingHelper::CodeAgingHelper(Isolate* isolate) {
USE(isolate);
DCHECK(young_sequence_.length() == kNoCodeAgeSequenceLength); DCHECK(young_sequence_.length() == kNoCodeAgeSequenceLength);
// Since patcher is a large object, allocate it dynamically when needed, // Since patcher is a large object, allocate it dynamically when needed,
// to avoid overloading the stack in stress conditions. // to avoid overloading the stack in stress conditions.
......
...@@ -644,7 +644,8 @@ void MathExpGenerator::EmitMathExp(MacroAssembler* masm, ...@@ -644,7 +644,8 @@ void MathExpGenerator::EmitMathExp(MacroAssembler* masm,
#undef __ #undef __
CodeAgingHelper::CodeAgingHelper() { CodeAgingHelper::CodeAgingHelper(Isolate* isolate) {
USE(isolate);
DCHECK(young_sequence_.length() == kNoCodeAgeSequenceLength); DCHECK(young_sequence_.length() == kNoCodeAgeSequenceLength);
// The sequence of instructions that is patched out for aging code is the // The sequence of instructions that is patched out for aging code is the
// following boilerplate stack-building prologue that is found both in // following boilerplate stack-building prologue that is found both in
......
...@@ -591,7 +591,8 @@ void StringCharLoadGenerator::Generate(MacroAssembler* masm, ...@@ -591,7 +591,8 @@ void StringCharLoadGenerator::Generate(MacroAssembler* masm,
#undef __ #undef __
CodeAgingHelper::CodeAgingHelper() { CodeAgingHelper::CodeAgingHelper(Isolate* isolate) {
USE(isolate);
DCHECK(young_sequence_.length() == kNoCodeAgeSequenceLength); DCHECK(young_sequence_.length() == kNoCodeAgeSequenceLength);
CodePatcher patcher(young_sequence_.start(), young_sequence_.length()); CodePatcher patcher(young_sequence_.start(), young_sequence_.length());
patcher.masm()->push(ebp); patcher.masm()->push(ebp);
......
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