Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: src/frames.cc

Issue 19785004: Move FindCodeObject from Heap to Isolate. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/deoptimizer.cc ('k') | src/heap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 v->VisitPointers(fixed_base, fixed_limit); 666 v->VisitPointers(fixed_base, fixed_limit);
667 } 667 }
668 668
669 669
670 void StubFrame::Iterate(ObjectVisitor* v) const { 670 void StubFrame::Iterate(ObjectVisitor* v) const {
671 IterateCompiledFrame(v); 671 IterateCompiledFrame(v);
672 } 672 }
673 673
674 674
675 Code* StubFrame::unchecked_code() const { 675 Code* StubFrame::unchecked_code() const {
676 return static_cast<Code*>(isolate()->heap()->FindCodeObject(pc())); 676 return static_cast<Code*>(isolate()->FindCodeObject(pc()));
677 } 677 }
678 678
679 679
680 Address StubFrame::GetCallerStackPointer() const { 680 Address StubFrame::GetCallerStackPointer() const {
681 return fp() + ExitFrameConstants::kCallerSPDisplacement; 681 return fp() + ExitFrameConstants::kCallerSPDisplacement;
682 } 682 }
683 683
684 684
685 int StubFrame::GetNumberOfIncomingArguments() const { 685 int StubFrame::GetNumberOfIncomingArguments() const {
686 return 0; 686 return 0;
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 JSFunction* fun = frame->function(); 776 JSFunction* fun = frame->function();
777 fun->PrintName(); 777 fun->PrintName();
778 Code* js_code = frame->unchecked_code(); 778 Code* js_code = frame->unchecked_code();
779 Address pc = frame->pc(); 779 Address pc = frame->pc();
780 int code_offset = 780 int code_offset =
781 static_cast<int>(pc - js_code->instruction_start()); 781 static_cast<int>(pc - js_code->instruction_start());
782 PrintF("+%d", code_offset); 782 PrintF("+%d", code_offset);
783 SharedFunctionInfo* shared = fun->shared(); 783 SharedFunctionInfo* shared = fun->shared();
784 if (print_line_number) { 784 if (print_line_number) {
785 Code* code = Code::cast( 785 Code* code = Code::cast(
786 v8::internal::Isolate::Current()->heap()->FindCodeObject(pc)); 786 v8::internal::Isolate::Current()->FindCodeObject(pc));
787 int source_pos = code->SourcePosition(pc); 787 int source_pos = code->SourcePosition(pc);
788 Object* maybe_script = shared->script(); 788 Object* maybe_script = shared->script();
789 if (maybe_script->IsScript()) { 789 if (maybe_script->IsScript()) {
790 Handle<Script> script(Script::cast(maybe_script)); 790 Handle<Script> script(Script::cast(maybe_script));
791 int line = GetScriptLineNumberSafe(script, source_pos) + 1; 791 int line = GetScriptLineNumberSafe(script, source_pos) + 1;
792 Object* script_name_raw = script->name(); 792 Object* script_name_raw = script->name();
793 if (script_name_raw->IsString()) { 793 if (script_name_raw->IsString()) {
794 String* script_name = String::cast(script->name()); 794 String* script_name = String::cast(script->name());
795 SmartArrayPointer<char> c_script_name = 795 SmartArrayPointer<char> c_script_name =
796 script_name->ToCString(DISALLOW_NULLS, 796 script_name->ToCString(DISALLOW_NULLS,
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after
1596 ZoneList<StackFrame*> list(10, zone); 1596 ZoneList<StackFrame*> list(10, zone);
1597 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { 1597 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) {
1598 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); 1598 StackFrame* frame = AllocateFrameCopy(it.frame(), zone);
1599 list.Add(frame, zone); 1599 list.Add(frame, zone);
1600 } 1600 }
1601 return list.ToVector(); 1601 return list.ToVector();
1602 } 1602 }
1603 1603
1604 1604
1605 } } // namespace v8::internal 1605 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/deoptimizer.cc ('k') | src/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698