| Index: src/a64/full-codegen-a64.cc
|
| diff --git a/src/a64/full-codegen-a64.cc b/src/a64/full-codegen-a64.cc
|
| index 7acbeacc7989074b4cb78d37bcaa3d66454855d9..d4e7b3ef6733b1fa1b9bad5a3497b9910e14375a 100644
|
| --- a/src/a64/full-codegen-a64.cc
|
| +++ b/src/a64/full-codegen-a64.cc
|
| @@ -328,10 +328,6 @@ void FullCodeGenerator::EmitProfilingCounterDecrement(int delta) {
|
|
|
| void FullCodeGenerator::EmitProfilingCounterReset() {
|
| int reset_value = FLAG_interrupt_budget;
|
| - if (info_->ShouldSelfOptimize() && !FLAG_retry_self_opt) {
|
| - // Self-optimization is a one-off thing. if it fails, don't try again.
|
| - reset_value = Smi::kMaxValue;
|
| - }
|
| if (isolate()->IsDebuggerActive()) {
|
| // Detect debug break requests as soon as possible.
|
| reset_value = FLAG_interrupt_budget >> 4;
|
| @@ -350,13 +346,10 @@ void FullCodeGenerator::EmitBackEdgeBookkeeping(IterationStatement* stmt,
|
| Assembler::BlockConstPoolScope block_const_pool(masm_);
|
| Label ok;
|
|
|
| - int weight = 1;
|
| - if (FLAG_weighted_back_edges) {
|
| - ASSERT(back_edge_target->is_bound());
|
| - int distance = masm_->SizeOfCodeGeneratedSince(back_edge_target);
|
| - weight = Min(kMaxBackEdgeWeight,
|
| - Max(1, distance / kCodeSizeMultiplier));
|
| - }
|
| + ASSERT(back_edge_target->is_bound());
|
| + int distance = masm_->SizeOfCodeGeneratedSince(back_edge_target);
|
| + int weight = Min(kMaxBackEdgeWeight,
|
| + Max(1, distance / kCodeSizeMultiplier));
|
| EmitProfilingCounterDecrement(weight);
|
| __ B(pl, &ok);
|
| __ Call(isolate()->builtins()->InterruptCheck(), RelocInfo::CODE_TARGET);
|
| @@ -392,32 +385,24 @@ void FullCodeGenerator::EmitReturnSequence() {
|
| __ CallRuntime(Runtime::kTraceExit, 1);
|
| ASSERT(x0.Is(result_register()));
|
| }
|
| - if (FLAG_interrupt_at_exit || FLAG_self_optimization) {
|
| - // Pretend that the exit is a backwards jump to the entry.
|
| - int weight = 1;
|
| - if (info_->ShouldSelfOptimize()) {
|
| - weight = FLAG_interrupt_budget / FLAG_self_opt_count;
|
| - } else if (FLAG_weighted_back_edges) {
|
| - int distance = masm_->pc_offset();
|
| - weight = Min(kMaxBackEdgeWeight,
|
| - Max(1, distance / kCodeSizeMultiplier));
|
| - }
|
| - EmitProfilingCounterDecrement(weight);
|
| - Label ok;
|
| - __ B(pl, &ok);
|
| - __ Push(x0);
|
| - if (info_->ShouldSelfOptimize() && FLAG_direct_self_opt) {
|
| - __ Ldr(x10, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
|
| - __ Push(x10);
|
| - __ CallRuntime(Runtime::kOptimizeFunctionOnNextCall, 1);
|
| - } else {
|
| - __ Call(isolate()->builtins()->InterruptCheck(),
|
| - RelocInfo::CODE_TARGET);
|
| - }
|
| - __ Pop(x0);
|
| - EmitProfilingCounterReset();
|
| - __ Bind(&ok);
|
| + // Pretend that the exit is a backwards jump to the entry.
|
| + int weight = 1;
|
| + if (info_->ShouldSelfOptimize()) {
|
| + weight = FLAG_interrupt_budget / FLAG_self_opt_count;
|
| + } else {
|
| + int distance = masm_->pc_offset();
|
| + weight = Min(kMaxBackEdgeWeight,
|
| + Max(1, distance / kCodeSizeMultiplier));
|
| }
|
| + EmitProfilingCounterDecrement(weight);
|
| + Label ok;
|
| + __ B(pl, &ok);
|
| + __ Push(x0);
|
| + __ Call(isolate()->builtins()->InterruptCheck(),
|
| + RelocInfo::CODE_TARGET);
|
| + __ Pop(x0);
|
| + EmitProfilingCounterReset();
|
| + __ Bind(&ok);
|
|
|
| // Make sure that the constant pool is not emitted inside of the return
|
| // sequence. This sequence can get patched when the debugger is used. See
|
| @@ -1046,6 +1031,14 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
|
| CallIC(ic, RelocInfo::CODE_TARGET, clause->CompareId());
|
| patch_site.EmitPatchInfo();
|
|
|
| + Label skip;
|
| + __ B(&skip);
|
| + PrepareForBailout(clause, TOS_REG);
|
| + __ JumpIfNotRoot(x0, Heap::kTrueValueRootIndex, &next_test);
|
| + __ Drop(1);
|
| + __ B(clause->body_target());
|
| + __ Bind(&skip);
|
| +
|
| __ Cbnz(x0, &next_test);
|
| __ Drop(1); // Switch value is no longer needed.
|
| __ B(clause->body_target());
|
| @@ -3481,13 +3474,11 @@ void FullCodeGenerator::EmitStringCompare(CallRuntime* expr) {
|
|
|
|
|
| void FullCodeGenerator::EmitMathLog(CallRuntime* expr) {
|
| - // Load the argument on the stack and call the stub.
|
| - TranscendentalCacheStub stub(TranscendentalCache::LOG,
|
| - TranscendentalCacheStub::TAGGED);
|
| + // Load the argument on the stack and call the runtime function.
|
| ZoneList<Expression*>* args = expr->arguments();
|
| ASSERT(args->length() == 1);
|
| VisitForStackValue(args->at(0));
|
| - __ CallStub(&stub);
|
| + __ CallRuntime(Runtime::kMath_log, 1);
|
| context()->Plug(x0);
|
| }
|
|
|
|
|