| Index: src/arm/lithium-codegen-arm.cc
|
| diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc
|
| index 71c1f86d97a2d3a428450c68840522020ee33909..fc7d0fdb6a2ae8fcb166d56e4097f87df7429445 100644
|
| --- a/src/arm/lithium-codegen-arm.cc
|
| +++ b/src/arm/lithium-codegen-arm.cc
|
| @@ -133,21 +133,7 @@ bool LCodeGen::GeneratePrologue() {
|
|
|
| info()->set_prologue_offset(masm_->pc_offset());
|
| if (NeedsEagerFrame()) {
|
| - if (info()->IsStub()) {
|
| - __ stm(db_w, sp, cp.bit() | fp.bit() | lr.bit());
|
| - __ Push(Smi::FromInt(StackFrame::STUB));
|
| - // Adjust FP to point to saved FP.
|
| - __ add(fp, sp, Operand(2 * kPointerSize));
|
| - } else {
|
| - PredictableCodeSizeScope predictible_code_size_scope(
|
| - masm_, kNoCodeAgeSequenceLength * Assembler::kInstrSize);
|
| - // The following three instructions must remain together and unmodified
|
| - // for code aging to work properly.
|
| - __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit());
|
| - __ nop(ip.code());
|
| - // Adjust FP to point to saved FP.
|
| - __ add(fp, sp, Operand(2 * kPointerSize));
|
| - }
|
| + __ Prologue(info()->IsStub() ? BUILD_STUB_FRAME : BUILD_FUNCTION_FRAME);
|
| frame_is_built_ = true;
|
| info_->AddNoFrameRange(0, masm_->pc_offset());
|
| }
|
| @@ -259,8 +245,9 @@ bool LCodeGen::GenerateDeferredCode() {
|
| for (int i = 0; !is_aborted() && i < deferred_.length(); i++) {
|
| LDeferredCode* code = deferred_[i];
|
|
|
| - int pos = instructions_->at(code->instruction_index())->position();
|
| - RecordAndUpdatePosition(pos);
|
| + HValue* value =
|
| + instructions_->at(code->instruction_index())->hydrogen_value();
|
| + RecordAndWritePosition(value->position());
|
|
|
| Comment(";;; <@%d,#%d> "
|
| "-------------------- Deferred %s --------------------",
|
| @@ -685,8 +672,6 @@ void LCodeGen::CallCodeGeneric(Handle<Code> code,
|
| // Block literal pool emission to ensure nop indicating no inlined smi code
|
| // is in the correct position.
|
| Assembler::BlockConstPoolScope block_const_pool(masm());
|
| - LPointerMap* pointers = instr->pointer_map();
|
| - RecordPosition(pointers->position());
|
| __ Call(code, mode, TypeFeedbackId::None(), al, storage_mode);
|
| RecordSafepointWithLazyDeopt(instr, safepoint_mode);
|
|
|
| @@ -704,9 +689,6 @@ void LCodeGen::CallRuntime(const Runtime::Function* function,
|
| LInstruction* instr,
|
| SaveFPRegsMode save_doubles) {
|
| ASSERT(instr != NULL);
|
| - LPointerMap* pointers = instr->pointer_map();
|
| - ASSERT(pointers != NULL);
|
| - RecordPosition(pointers->position());
|
|
|
| __ CallRuntime(function, num_arguments, save_doubles);
|
|
|
| @@ -964,7 +946,7 @@ void LCodeGen::RecordSafepoint(LPointerMap* pointers,
|
|
|
|
|
| void LCodeGen::RecordSafepoint(Safepoint::DeoptMode deopt_mode) {
|
| - LPointerMap empty_pointers(RelocInfo::kNoPosition, zone());
|
| + LPointerMap empty_pointers(zone());
|
| RecordSafepoint(&empty_pointers, deopt_mode);
|
| }
|
|
|
| @@ -986,17 +968,10 @@ void LCodeGen::RecordSafepointWithRegistersAndDoubles(
|
| }
|
|
|
|
|
| -void LCodeGen::RecordPosition(int position) {
|
| +void LCodeGen::RecordAndWritePosition(int position) {
|
| if (position == RelocInfo::kNoPosition) return;
|
| masm()->positions_recorder()->RecordPosition(position);
|
| -}
|
| -
|
| -
|
| -void LCodeGen::RecordAndUpdatePosition(int position) {
|
| - if (position >= 0 && position != old_position_) {
|
| - masm()->positions_recorder()->RecordPosition(position);
|
| - old_position_ = position;
|
| - }
|
| + masm()->positions_recorder()->WriteRecordedPositions();
|
| }
|
|
|
|
|
| @@ -2336,6 +2311,10 @@ Condition LCodeGen::TokenToCondition(Token::Value op, bool is_unsigned) {
|
| case Token::EQ_STRICT:
|
| cond = eq;
|
| break;
|
| + case Token::NE:
|
| + case Token::NE_STRICT:
|
| + cond = ne;
|
| + break;
|
| case Token::LT:
|
| cond = is_unsigned ? lo : lt;
|
| break;
|
| @@ -3503,7 +3482,6 @@ void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
|
| __ bind(&invoke);
|
| ASSERT(instr->HasPointerMap());
|
| LPointerMap* pointers = instr->pointer_map();
|
| - RecordPosition(pointers->position());
|
| SafepointGenerator safepoint_generator(
|
| this, pointers, Safepoint::kLazyDeopt);
|
| // The number of arguments is stored in receiver which is r0, as expected
|
| @@ -3593,7 +3571,6 @@ void LCodeGen::CallKnownFunction(Handle<JSFunction> function,
|
| dont_adapt_arguments || formal_parameter_count == arity;
|
|
|
| LPointerMap* pointers = instr->pointer_map();
|
| - RecordPosition(pointers->position());
|
|
|
| if (can_invoke_directly) {
|
| if (r1_state == R1_UNINITIALIZED) {
|
| @@ -4005,7 +3982,6 @@ void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) {
|
| Handle<JSFunction> known_function = instr->hydrogen()->known_function();
|
| if (known_function.is_null()) {
|
| LPointerMap* pointers = instr->pointer_map();
|
| - RecordPosition(pointers->position());
|
| SafepointGenerator generator(this, pointers, Safepoint::kLazyDeopt);
|
| ParameterCount count(instr->arity());
|
| __ InvokeFunction(r1, count, CALL_FUNCTION, generator, CALL_AS_METHOD);
|
| @@ -4536,8 +4512,10 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) {
|
| void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) {
|
| Register object = ToRegister(instr->object());
|
| Register temp = ToRegister(instr->temp());
|
| - __ TestJSArrayForAllocationMemento(object, temp);
|
| + Label no_memento_found;
|
| + __ TestJSArrayForAllocationMemento(object, temp, &no_memento_found);
|
| DeoptimizeIf(eq, instr->environment());
|
| + __ bind(&no_memento_found);
|
| }
|
|
|
|
|
| @@ -4970,18 +4948,33 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) {
|
| if (instr->truncating()) {
|
| // Performs a truncating conversion of a floating point number as used by
|
| // the JS bitwise operations.
|
| - Label heap_number;
|
| - __ b(eq, &heap_number);
|
| - // Check for undefined. Undefined is converted to zero for truncating
|
| - // conversions.
|
| + Label no_heap_number, check_bools, check_false;
|
| + __ b(ne, &no_heap_number);
|
| + __ TruncateHeapNumberToI(input_reg, scratch2);
|
| + __ b(&done);
|
| +
|
| + // Check for Oddballs. Undefined/False is converted to zero and True to one
|
| + // for truncating conversions.
|
| + __ bind(&no_heap_number);
|
| __ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
|
| __ cmp(scratch2, Operand(ip));
|
| - DeoptimizeIf(ne, instr->environment());
|
| + __ b(ne, &check_bools);
|
| __ mov(input_reg, Operand::Zero());
|
| __ b(&done);
|
|
|
| - __ bind(&heap_number);
|
| - __ TruncateHeapNumberToI(input_reg, scratch2);
|
| + __ bind(&check_bools);
|
| + __ LoadRoot(ip, Heap::kTrueValueRootIndex);
|
| + __ cmp(scratch2, Operand(ip));
|
| + __ b(ne, &check_false);
|
| + __ mov(input_reg, Operand(1));
|
| + __ b(&done);
|
| +
|
| + __ bind(&check_false);
|
| + __ LoadRoot(ip, Heap::kFalseValueRootIndex);
|
| + __ cmp(scratch2, Operand(ip));
|
| + DeoptimizeIf(ne, instr->environment());
|
| + __ mov(input_reg, Operand::Zero());
|
| + __ b(&done);
|
| } else {
|
| // Deoptimize if we don't have a heap number.
|
| DeoptimizeIf(ne, instr->environment());
|
|
|