Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Unified Diff: src/arm/lithium-codegen-arm.cc

Issue 1189123003: ARM: make predictable code size scope more precise in DoDeferredInstanceOfKnownGlobal. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comment Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-500831.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/lithium-codegen-arm.cc
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc
index 8f6cdd3cf6975e63b925e50c4a1453568a113894..03b5eb3da3de6c2d32b598e1acf328c094f4fc06 100644
--- a/src/arm/lithium-codegen-arm.cc
+++ b/src/arm/lithium-codegen-arm.cc
@@ -2826,37 +2826,41 @@ void LCodeGen::DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr,
int call_size = CallCodeSize(stub.GetCode(), RelocInfo::CODE_TARGET);
int additional_delta = (call_size / Assembler::kInstrSize) + 4;
- // Make sure that code size is predicable, since we use specific constants
- // offsets in the code to find embedded values..
- PredictableCodeSizeScope predictable(
- masm_, (additional_delta + 1) * Assembler::kInstrSize);
- // Make sure we don't emit any additional entries in the constant pool before
- // the call to ensure that the CallCodeSize() calculated the correct number of
- // instructions for the constant pool load.
{
- ConstantPoolUnavailableScope constant_pool_unavailable(masm_);
- int map_check_delta =
- masm_->InstructionsGeneratedSince(map_check) + additional_delta;
- int bool_load_delta =
- masm_->InstructionsGeneratedSince(bool_load) + additional_delta;
- Label before_push_delta;
- __ bind(&before_push_delta);
- __ BlockConstPoolFor(additional_delta);
- // r5 is used to communicate the offset to the location of the map check.
- __ mov(r5, Operand(map_check_delta * kPointerSize));
- // r6 is used to communicate the offset to the location of the bool load.
- __ mov(r6, Operand(bool_load_delta * kPointerSize));
- // The mov above can generate one or two instructions. The delta was
- // computed for two instructions, so we need to pad here in case of one
- // instruction.
- while (masm_->InstructionsGeneratedSince(&before_push_delta) != 4) {
- __ nop();
+ // Make sure that code size is predicable, since we use specific constants
+ // offsets in the code to find embedded values..
+ PredictableCodeSizeScope predictable(
+ masm_, additional_delta * Assembler::kInstrSize);
+ // The labels must be already bound since the code has predictabel size up
+ // to the call instruction.
+ DCHECK(map_check->is_bound());
+ DCHECK(bool_load->is_bound());
+ // Make sure we don't emit any additional entries in the constant pool
+ // before the call to ensure that the CallCodeSize() calculated the
+ // correct number of instructions for the constant pool load.
+ {
+ ConstantPoolUnavailableScope constant_pool_unavailable(masm_);
+ int map_check_delta =
+ masm_->InstructionsGeneratedSince(map_check) + additional_delta;
+ int bool_load_delta =
+ masm_->InstructionsGeneratedSince(bool_load) + additional_delta;
+ Label before_push_delta;
+ __ bind(&before_push_delta);
+ __ BlockConstPoolFor(additional_delta);
+ // r5 is used to communicate the offset to the location of the map check.
+ __ mov(r5, Operand(map_check_delta * kPointerSize));
+ // r6 is used to communicate the offset to the location of the bool load.
+ __ mov(r6, Operand(bool_load_delta * kPointerSize));
+ // The mov above can generate one or two instructions. The delta was
+ // computed for two instructions, so we need to pad here in case of one
+ // instruction.
+ while (masm_->InstructionsGeneratedSince(&before_push_delta) != 4) {
+ __ nop();
+ }
}
+ CallCodeGeneric(stub.GetCode(), RelocInfo::CODE_TARGET, instr,
+ RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS);
}
- CallCodeGeneric(stub.GetCode(),
- RelocInfo::CODE_TARGET,
- instr,
- RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS);
LEnvironment* env = instr->GetDeferredLazyDeoptimizationEnvironment();
safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index());
// Put the result value (r0) into the result register slot and
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-500831.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698