| Index: src/mips/macro-assembler-mips.cc
|
| diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc
|
| index cb336f3b0b9262b3c2d12628bec9ec9679a43799..bc981cbaacba625187b66620dd56de47d72ee520 100644
|
| --- a/src/mips/macro-assembler-mips.cc
|
| +++ b/src/mips/macro-assembler-mips.cc
|
| @@ -44,7 +44,6 @@ namespace internal {
|
| MacroAssembler::MacroAssembler(Isolate* arg_isolate, void* buffer, int size)
|
| : Assembler(arg_isolate, buffer, size),
|
| generating_stub_(false),
|
| - allow_stub_calls_(true),
|
| has_frame_(false) {
|
| if (isolate() != NULL) {
|
| code_object_ = Handle<Object>(isolate()->heap()->undefined_value(),
|
| @@ -275,6 +274,12 @@ void MacroAssembler::RecordWrite(Register object,
|
| eq, kWrongAddressOrValuePassedToRecordWrite, at, Operand(value));
|
| }
|
|
|
| + // Count number of write barriers in generated code.
|
| + isolate()->counters()->write_barriers_static()->Increment();
|
| + // TODO(mstarzinger): Dynamic counter missing.
|
| +
|
| + // First, check if a write barrier is even needed. The tests below
|
| + // catch stores of smis and stores into the young generation.
|
| Label done;
|
|
|
| if (smi_check == INLINE_SMI_CHECK) {
|
| @@ -784,8 +789,29 @@ void MacroAssembler::Ror(Register rd, Register rs, const Operand& rt) {
|
| }
|
|
|
|
|
| +void MacroAssembler::Pref(int32_t hint, const MemOperand& rs) {
|
| + if (kArchVariant == kLoongson) {
|
| + lw(zero_reg, rs);
|
| + } else {
|
| + pref(hint, rs);
|
| + }
|
| +}
|
| +
|
| +
|
| //------------Pseudo-instructions-------------
|
|
|
| +void MacroAssembler::Ulw(Register rd, const MemOperand& rs) {
|
| + lwr(rd, rs);
|
| + lwl(rd, MemOperand(rs.rm(), rs.offset() + 3));
|
| +}
|
| +
|
| +
|
| +void MacroAssembler::Usw(Register rd, const MemOperand& rs) {
|
| + swr(rd, rs);
|
| + swl(rd, MemOperand(rs.rm(), rs.offset() + 3));
|
| +}
|
| +
|
| +
|
| void MacroAssembler::li(Register dst, Handle<Object> value, LiFlags mode) {
|
| AllowDeferredHandleDereference smi_check;
|
| if (value->IsSmi()) {
|
| @@ -3722,7 +3748,7 @@ void MacroAssembler::InvokeFunction(Register function,
|
| }
|
|
|
|
|
| -void MacroAssembler::InvokeFunction(Handle<JSFunction> function,
|
| +void MacroAssembler::InvokeFunction(Register function,
|
| const ParameterCount& expected,
|
| const ParameterCount& actual,
|
| InvokeFlag flag,
|
| @@ -3731,8 +3757,10 @@ void MacroAssembler::InvokeFunction(Handle<JSFunction> function,
|
| // You can't call a function without a valid frame.
|
| ASSERT(flag == JUMP_FUNCTION || has_frame());
|
|
|
| + // Contract with called JS functions requires that function is passed in a1.
|
| + ASSERT(function.is(a1));
|
| +
|
| // Get the function and setup the context.
|
| - li(a1, function);
|
| lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset));
|
|
|
| // We call indirectly through the code field in the function to
|
| @@ -3743,6 +3771,17 @@ void MacroAssembler::InvokeFunction(Handle<JSFunction> function,
|
| }
|
|
|
|
|
| +void MacroAssembler::InvokeFunction(Handle<JSFunction> function,
|
| + const ParameterCount& expected,
|
| + const ParameterCount& actual,
|
| + InvokeFlag flag,
|
| + const CallWrapper& call_wrapper,
|
| + CallKind call_kind) {
|
| + li(a1, function);
|
| + InvokeFunction(a1, expected, actual, flag, call_wrapper, call_kind);
|
| +}
|
| +
|
| +
|
| void MacroAssembler::IsObjectJSObjectType(Register heap_object,
|
| Register map,
|
| Register scratch,
|
| @@ -3867,8 +3906,6 @@ void MacroAssembler::CallStub(CodeStub* stub,
|
|
|
|
|
| void MacroAssembler::TailCallStub(CodeStub* stub) {
|
| - ASSERT(allow_stub_calls_ ||
|
| - stub->CompilingCallsToThisStubIsGCSafe(isolate()));
|
| Jump(stub->GetCode(isolate()), RelocInfo::CODE_TARGET);
|
| }
|
|
|
| @@ -4008,8 +4045,7 @@ void MacroAssembler::CallApiFunctionAndReturn(
|
|
|
|
|
| bool MacroAssembler::AllowThisStubCall(CodeStub* stub) {
|
| - if (!has_frame_ && stub->SometimesSetsUpAFrame()) return false;
|
| - return allow_stub_calls_ || stub->CompilingCallsToThisStubIsGCSafe(isolate());
|
| + return has_frame_ || !stub->SometimesSetsUpAFrame();
|
| }
|
|
|
|
|
| @@ -4526,15 +4562,15 @@ void MacroAssembler::Prologue(PrologueFrameMode frame_mode) {
|
| // Pre-age the code.
|
| Code* stub = Code::GetPreAgedCodeAgeStub(isolate());
|
| nop(Assembler::CODE_AGE_MARKER_NOP);
|
| - // Save the function's original return address
|
| - // (it will be clobbered by Call(t9)).
|
| - mov(at, ra);
|
| - // Load the stub address to t9 and call it.
|
| + // Load the stub address to t9 and call it,
|
| + // GetCodeAgeAndParity() extracts the stub address from this instruction.
|
| li(t9,
|
| - Operand(reinterpret_cast<uint32_t>(stub->instruction_start())));
|
| - Call(t9);
|
| - // Record the stub address in the empty space for GetCodeAgeAndParity().
|
| - emit_code_stub_address(stub);
|
| + Operand(reinterpret_cast<uint32_t>(stub->instruction_start())),
|
| + CONSTANT_SIZE);
|
| + nop(); // Prevent jalr to jal optimization.
|
| + jalr(t9, a0);
|
| + nop(); // Branch delay slot nop.
|
| + nop(); // Pad the empty space.
|
| } else {
|
| Push(ra, fp, cp, a1);
|
| nop(Assembler::CODE_AGE_SEQUENCE_NOP);
|
|
|