~ubuntu-branches/ubuntu/saucy/libv8/saucy

« back to all changes in this revision

Viewing changes to src/frames.cc

  • Committer: Package Import Robot
  • Author(s): Jérémy Lal
  • Date: 2012-04-07 16:26:13 UTC
  • mfrom: (15.1.27 sid)
  • Revision ID: package-import@ubuntu.com-20120407162613-dqo1m6w9r3fh8tst
Tags: 3.8.9.16-3
* mipsel build fixes :
  + v8_use_mips_abi_hardfloat=false, this lowers EABI requirements.
  + v8_can_use_fpu_instructions=false, detect if FPU is present.
  + set -Wno-unused-but-set-variable only on mipsel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright 2011 the V8 project authors. All rights reserved.
 
1
// Copyright 2012 the V8 project authors. All rights reserved.
2
2
// Redistribution and use in source and binary forms, with or without
3
3
// modification, are permitted provided that the following conditions are
4
4
// met:
485
485
 
486
486
 
487
487
void ExitFrame::ComputeCallerState(State* state) const {
488
 
  // Setup the caller state.
 
488
  // Set up the caller state.
489
489
  state->sp = caller_sp();
490
490
  state->fp = Memory::Address_at(fp() + ExitFrameConstants::kCallerFPOffset);
491
491
  state->pc_address
723
723
      JavaScriptFrame* frame = it.frame();
724
724
      if (frame->IsConstructor()) PrintF(file, "new ");
725
725
      // function name
726
 
      Object* fun = frame->function();
727
 
      if (fun->IsJSFunction()) {
728
 
        SharedFunctionInfo* shared = JSFunction::cast(fun)->shared();
729
 
        shared->DebugName()->ShortPrint(file);
 
726
      Object* maybe_fun = frame->function();
 
727
      if (maybe_fun->IsJSFunction()) {
 
728
        JSFunction* fun = JSFunction::cast(maybe_fun);
 
729
        fun->PrintName();
 
730
        Code* js_code = frame->unchecked_code();
 
731
        Address pc = frame->pc();
 
732
        int code_offset =
 
733
            static_cast<int>(pc - js_code->instruction_start());
 
734
        PrintF("+%d", code_offset);
 
735
        SharedFunctionInfo* shared = fun->shared();
730
736
        if (print_line_number) {
731
 
          Address pc = frame->pc();
732
737
          Code* code = Code::cast(
733
738
              v8::internal::Isolate::Current()->heap()->FindCodeObject(pc));
734
739
          int source_pos = code->SourcePosition(pc);
751
756
          }
752
757
        }
753
758
      } else {
754
 
        fun->ShortPrint(file);
 
759
        PrintF("<unknown>");
755
760
      }
756
761
 
757
762
      if (print_args) {
808
813
                         data->TranslationIndex(deopt_index)->value());
809
814
  Translation::Opcode opcode = static_cast<Translation::Opcode>(it.Next());
810
815
  ASSERT(opcode == Translation::BEGIN);
811
 
  int frame_count = it.Next();
 
816
  it.Next();  // Drop frame count.
 
817
  int jsframe_count = it.Next();
812
818
 
813
819
  // We create the summary in reverse order because the frames
814
820
  // in the deoptimization translation are ordered bottom-to-top.
815
 
  int i = frame_count;
 
821
  int i = jsframe_count;
816
822
  while (i > 0) {
817
823
    opcode = static_cast<Translation::Opcode>(it.Next());
818
 
    if (opcode == Translation::FRAME) {
 
824
    if (opcode == Translation::JS_FRAME) {
819
825
      // We don't inline constructor calls, so only the first, outermost
820
826
      // frame can be a constructor frame in case of inlining.
821
 
      bool is_constructor = (i == frame_count) && IsConstructor();
 
827
      bool is_constructor = (i == jsframe_count) && IsConstructor();
822
828
 
823
829
      i--;
824
830
      int ast_id = it.Next();
913
919
  Translation::Opcode opcode = static_cast<Translation::Opcode>(it.Next());
914
920
  ASSERT(opcode == Translation::BEGIN);
915
921
  USE(opcode);
916
 
  int frame_count = it.Next();
917
 
  return frame_count;
 
922
  it.Next();  // Drop frame count.
 
923
  int jsframe_count = it.Next();
 
924
  return jsframe_count;
918
925
}
919
926
 
920
927
 
929
936
                         data->TranslationIndex(deopt_index)->value());
930
937
  Translation::Opcode opcode = static_cast<Translation::Opcode>(it.Next());
931
938
  ASSERT(opcode == Translation::BEGIN);
932
 
  int frame_count = it.Next();
 
939
  it.Next();  // Drop frame count.
 
940
  int jsframe_count = it.Next();
933
941
 
934
942
  // We insert the frames in reverse order because the frames
935
943
  // in the deoptimization translation are ordered bottom-to-top.
936
 
  while (frame_count > 0) {
 
944
  while (jsframe_count > 0) {
937
945
    opcode = static_cast<Translation::Opcode>(it.Next());
938
 
    if (opcode == Translation::FRAME) {
939
 
      frame_count--;
 
946
    if (opcode == Translation::JS_FRAME) {
 
947
      jsframe_count--;
940
948
      it.Next();  // Skip ast id.
941
949
      int function_id = it.Next();
942
950
      it.Next();  // Skip height.
1298
1306
  isolate_->counters()->pc_to_code()->Increment();
1299
1307
  ASSERT(IsPowerOf2(kInnerPointerToCodeCacheSize));
1300
1308
  uint32_t hash = ComputeIntegerHash(
1301
 
      static_cast<uint32_t>(reinterpret_cast<uintptr_t>(inner_pointer)));
 
1309
      static_cast<uint32_t>(reinterpret_cast<uintptr_t>(inner_pointer)),
 
1310
      v8::internal::kZeroHashSeed);
1302
1311
  uint32_t index = hash & (kInnerPointerToCodeCacheSize - 1);
1303
1312
  InnerPointerToCodeCacheEntry* entry = cache(index);
1304
1313
  if (entry->inner_pointer == inner_pointer) {