Revision f230a1cf deps/v8/src/mips/builtins-mips.cc

View differences:

deps/v8/src/mips/builtins-mips.cc
201 201

  
202 202
  Register argument = a2;
203 203
  Label not_cached, argument_is_string;
204
  NumberToStringStub::GenerateLookupNumberStringCache(
205
      masm,
206
      a0,        // Input.
207
      argument,  // Result.
208
      a3,        // Scratch.
209
      t0,        // Scratch.
210
      t1,        // Scratch.
211
      &not_cached);
204
  __ LookupNumberStringCache(a0,        // Input.
205
                             argument,  // Result.
206
                             a3,        // Scratch.
207
                             t0,        // Scratch.
208
                             t1,        // Scratch.
209
                             &not_cached);
212 210
  __ IncrementCounter(counters->string_ctor_cached_number(), 1, a3, t0);
213 211
  __ bind(&argument_is_string);
214 212

  
......
833 831
  // The following registers must be saved and restored when calling through to
834 832
  // the runtime:
835 833
  //   a0 - contains return address (beginning of patch sequence)
836
  //   a1 - function object
834
  //   a1 - isolate
837 835
  RegList saved_regs =
838 836
      (a0.bit() | a1.bit() | ra.bit() | fp.bit()) & ~sp.bit();
839 837
  FrameScope scope(masm, StackFrame::MANUAL);
840 838
  __ MultiPush(saved_regs);
841
  __ PrepareCallCFunction(1, 0, a1);
839
  __ PrepareCallCFunction(1, 0, a2);
840
  __ li(a1, Operand(ExternalReference::isolate_address(masm->isolate())));
842 841
  __ CallCFunction(
843
      ExternalReference::get_make_code_young_function(masm->isolate()), 1);
842
      ExternalReference::get_make_code_young_function(masm->isolate()), 2);
844 843
  __ MultiPop(saved_regs);
845 844
  __ Jump(a0);
846 845
}
......
858 857
#undef DEFINE_CODE_AGE_BUILTIN_GENERATOR
859 858

  
860 859

  
860
void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
861
  // For now, as in GenerateMakeCodeYoungAgainCommon, we are relying on the fact
862
  // that make_code_young doesn't do any garbage collection which allows us to
863
  // save/restore the registers without worrying about which of them contain
864
  // pointers.
865

  
866
  __ mov(a0, ra);
867
  // Adjust a0 to point to the head of the PlatformCodeAge sequence
868
  __ Subu(a0, a0,
869
      Operand((kNoCodeAgeSequenceLength - 1) * Assembler::kInstrSize));
870
  // Restore the original return address of the function
871
  __ mov(ra, at);
872

  
873
  // The following registers must be saved and restored when calling through to
874
  // the runtime:
875
  //   a0 - contains return address (beginning of patch sequence)
876
  //   a1 - isolate
877
  RegList saved_regs =
878
      (a0.bit() | a1.bit() | ra.bit() | fp.bit()) & ~sp.bit();
879
  FrameScope scope(masm, StackFrame::MANUAL);
880
  __ MultiPush(saved_regs);
881
  __ PrepareCallCFunction(1, 0, a2);
882
  __ li(a1, Operand(ExternalReference::isolate_address(masm->isolate())));
883
  __ CallCFunction(
884
      ExternalReference::get_mark_code_as_executed_function(masm->isolate()),
885
      2);
886
  __ MultiPop(saved_regs);
887

  
888
  // Perform prologue operations usually performed by the young code stub.
889
  __ Push(ra, fp, cp, a1);
890
  __ Addu(fp, sp, Operand(2 * kPointerSize));
891

  
892
  // Jump to point after the code-age stub.
893
  __ Addu(a0, a0, Operand((kNoCodeAgeSequenceLength) * Assembler::kInstrSize));
894
  __ Jump(a0);
895
}
896

  
897

  
898
void Builtins::Generate_MarkCodeAsExecutedTwice(MacroAssembler* masm) {
899
  GenerateMakeCodeYoungAgainCommon(masm);
900
}
901

  
902

  
861 903
void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) {
862 904
  {
863 905
    FrameScope scope(masm, StackFrame::INTERNAL);
......
925 967
}
926 968

  
927 969

  
928
void Builtins::Generate_NotifyOSR(MacroAssembler* masm) {
929
  // For now, we are relying on the fact that Runtime::NotifyOSR
930
  // doesn't do any garbage collection which allows us to save/restore
931
  // the registers without worrying about which of them contain
932
  // pointers. This seems a bit fragile.
933
  RegList saved_regs =
934
      (kJSCallerSaved | kCalleeSaved | ra.bit() | fp.bit()) & ~sp.bit();
935
  __ MultiPush(saved_regs);
936
  {
937
    FrameScope scope(masm, StackFrame::INTERNAL);
938
    __ CallRuntime(Runtime::kNotifyOSR, 0);
939
  }
940
  __ MultiPop(saved_regs);
941
  __ Ret();
942
}
943

  
944

  
945 970
void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
946 971
  // Lookup the function in the JavaScript frame.
947 972
  __ lw(a0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
......
984 1009
}
985 1010

  
986 1011

  
1012
void Builtins::Generate_OsrAfterStackCheck(MacroAssembler* masm) {
1013
  // We check the stack limit as indicator that recompilation might be done.
1014
  Label ok;
1015
  __ LoadRoot(at, Heap::kStackLimitRootIndex);
1016
  __ Branch(&ok, hs, sp, Operand(at));
1017
  {
1018
    FrameScope scope(masm, StackFrame::INTERNAL);
1019
    __ CallRuntime(Runtime::kStackGuard, 0);
1020
  }
1021
  __ Jump(masm->isolate()->builtins()->OnStackReplacement(),
1022
          RelocInfo::CODE_TARGET);
1023

  
1024
  __ bind(&ok);
1025
  __ Ret();
1026
}
1027

  
1028

  
987 1029
void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
988 1030
  // 1. Make sure we have at least one argument.
989 1031
  // a0: actual number of arguments

Also available in: Unified diff