Commit 5a556dfe authored by ulan's avatar ulan Committed by Commit bot

ARM: make sure that the expected code size is computed in predictable scope.

BUG=v8:4277
LOG=NO

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

Cr-Commit-Position: refs/heads/master@{#29772}
parent 143f5ad8
...@@ -4677,8 +4677,9 @@ void VectorKeyedStoreICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) { ...@@ -4677,8 +4677,9 @@ void VectorKeyedStoreICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) {
void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
if (masm->isolate()->function_entry_hook() != NULL) { if (masm->isolate()->function_entry_hook() != NULL) {
ProfileEntryHookStub stub(masm->isolate()); ProfileEntryHookStub stub(masm->isolate());
int code_size = masm->CallStubSize(&stub) + 2 * Assembler::kInstrSize; PredictableCodeSizeScope predictable(masm);
PredictableCodeSizeScope predictable(masm, code_size); predictable.ExpectSize(masm->CallStubSize(&stub) +
2 * Assembler::kInstrSize);
__ push(lr); __ push(lr);
__ CallStub(&stub); __ CallStub(&stub);
__ pop(lr); __ pop(lr);
......
...@@ -355,7 +355,8 @@ void FullCodeGenerator::Generate() { ...@@ -355,7 +355,8 @@ void FullCodeGenerator::Generate() {
__ cmp(sp, Operand(ip)); __ cmp(sp, Operand(ip));
__ b(hs, &ok); __ b(hs, &ok);
Handle<Code> stack_check = isolate()->builtins()->StackCheck(); Handle<Code> stack_check = isolate()->builtins()->StackCheck();
PredictableCodeSizeScope predictable(masm_, PredictableCodeSizeScope predictable(masm_);
predictable.ExpectSize(
masm_->CallSize(stack_check, RelocInfo::CODE_TARGET)); masm_->CallSize(stack_check, RelocInfo::CODE_TARGET));
__ Call(stack_check, RelocInfo::CODE_TARGET); __ Call(stack_check, RelocInfo::CODE_TARGET);
__ bind(&ok); __ bind(&ok);
......
...@@ -5848,8 +5848,8 @@ void LCodeGen::DoStackCheck(LStackCheck* instr) { ...@@ -5848,8 +5848,8 @@ void LCodeGen::DoStackCheck(LStackCheck* instr) {
__ cmp(sp, Operand(ip)); __ cmp(sp, Operand(ip));
__ b(hs, &done); __ b(hs, &done);
Handle<Code> stack_check = isolate()->builtins()->StackCheck(); Handle<Code> stack_check = isolate()->builtins()->StackCheck();
PredictableCodeSizeScope predictable(masm(), PredictableCodeSizeScope predictable(masm());
CallCodeSize(stack_check, RelocInfo::CODE_TARGET)); predictable.ExpectSize(CallCodeSize(stack_check, RelocInfo::CODE_TARGET));
DCHECK(instr->context()->IsRegister()); DCHECK(instr->context()->IsRegister());
DCHECK(ToRegister(instr->context()).is(cp)); DCHECK(ToRegister(instr->context()).is(cp));
CallCode(stack_check, RelocInfo::CODE_TARGET, instr); CallCode(stack_check, RelocInfo::CODE_TARGET, instr);
......
...@@ -158,6 +158,10 @@ AssemblerBase::~AssemblerBase() { ...@@ -158,6 +158,10 @@ AssemblerBase::~AssemblerBase() {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// Implementation of PredictableCodeSizeScope // Implementation of PredictableCodeSizeScope
PredictableCodeSizeScope::PredictableCodeSizeScope(AssemblerBase* assembler)
: PredictableCodeSizeScope(assembler, -1) {}
PredictableCodeSizeScope::PredictableCodeSizeScope(AssemblerBase* assembler, PredictableCodeSizeScope::PredictableCodeSizeScope(AssemblerBase* assembler,
int expected_size) int expected_size)
: assembler_(assembler), : assembler_(assembler),
......
...@@ -158,8 +158,10 @@ class DontEmitDebugCodeScope BASE_EMBEDDED { ...@@ -158,8 +158,10 @@ class DontEmitDebugCodeScope BASE_EMBEDDED {
// snapshot and the running VM. // snapshot and the running VM.
class PredictableCodeSizeScope { class PredictableCodeSizeScope {
public: public:
explicit PredictableCodeSizeScope(AssemblerBase* assembler);
PredictableCodeSizeScope(AssemblerBase* assembler, int expected_size); PredictableCodeSizeScope(AssemblerBase* assembler, int expected_size);
~PredictableCodeSizeScope(); ~PredictableCodeSizeScope();
void ExpectSize(int expected_size) { expected_size_ = expected_size; }
private: private:
AssemblerBase* assembler_; AssemblerBase* assembler_;
......
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