Commit 8bc3dc03 authored by ishell's avatar ishell Committed by Commit bot

ARM64: Propagate notification about aborted compilation from RegExpEngine to MacroAssembler.

BUG=chromium:489290
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#28455}
parent e160e6de
......@@ -20,6 +20,7 @@ class RegExpMacroAssemblerARM64: public NativeRegExpMacroAssembler {
RegExpMacroAssemblerARM64(Isolate* isolate, Zone* zone, Mode mode,
int registers_to_save);
virtual ~RegExpMacroAssemblerARM64();
virtual void AbortedCodeGeneration() { masm_->AbortedCodeGeneration(); }
virtual int stack_limit_slack();
virtual void AdvanceCurrentPosition(int by);
virtual void AdvanceRegister(int reg, int by);
......
......@@ -1091,7 +1091,10 @@ RegExpEngine::CompilationResult RegExpCompiler::Assemble(
node->set_on_work_list(false);
if (!node->label()->is_bound()) node->Emit(this, &new_trace);
}
if (reg_exp_too_big_) return IrregexpRegExpTooBig(isolate_);
if (reg_exp_too_big_) {
macro_assembler_->AbortedCodeGeneration();
return IrregexpRegExpTooBig(isolate_);
}
Handle<HeapObject> code = macro_assembler_->GetCode(pattern);
heap->IncreaseTotalRegexpCodeGenerated(code->Size());
......
......@@ -26,6 +26,12 @@ RegExpMacroAssemblerTracer::~RegExpMacroAssemblerTracer() {
}
void RegExpMacroAssemblerTracer::AbortedCodeGeneration() {
PrintF(" AbortedCodeGeneration\n");
assembler_->AbortedCodeGeneration();
}
// This is used for printing out debugging information. It makes an integer
// that is closely related to the address of an object.
static int LabelToInt(Label* label) {
......
......@@ -13,6 +13,7 @@ class RegExpMacroAssemblerTracer: public RegExpMacroAssembler {
public:
RegExpMacroAssemblerTracer(Isolate* isolate, RegExpMacroAssembler* assembler);
virtual ~RegExpMacroAssemblerTracer();
virtual void AbortedCodeGeneration();
virtual int stack_limit_slack() { return assembler_->stack_limit_slack(); }
virtual bool CanReadUnaligned() { return assembler_->CanReadUnaligned(); }
virtual void AdvanceCurrentPosition(int by); // Signed cp change.
......
......@@ -45,6 +45,9 @@ class RegExpMacroAssembler {
RegExpMacroAssembler(Isolate* isolate, Zone* zone);
virtual ~RegExpMacroAssembler();
// This function is called when code generation is aborted, so that
// the assembler could clean up internal data structures.
virtual void AbortedCodeGeneration() {}
// The maximal number of pushes between stack checks. Users must supply
// kCheckStackLimit flag to push operations (instead of kNoStackLimitCheck)
// at least once for every stack_limit() pushes that are executed.
......
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