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

Side by Side Diff: src/deoptimizer.cc

Issue 112863002: Merge bleeding_edge 18021:18297 (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 7 years 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/debug-agent.cc ('k') | src/disassembler.cc » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 // TODO(kasperl): For now, we do a simple linear search for the PC 684 // TODO(kasperl): For now, we do a simple linear search for the PC
685 // offset associated with the given node id. This should probably be 685 // offset associated with the given node id. This should probably be
686 // changed to a binary search. 686 // changed to a binary search.
687 int length = data->DeoptPoints(); 687 int length = data->DeoptPoints();
688 for (int i = 0; i < length; i++) { 688 for (int i = 0; i < length; i++) {
689 if (data->AstId(i) == id) { 689 if (data->AstId(i) == id) {
690 return data->PcAndState(i)->value(); 690 return data->PcAndState(i)->value();
691 } 691 }
692 } 692 }
693 PrintF(stderr, "[couldn't find pc offset for node=%d]\n", id.ToInt()); 693 PrintF(stderr, "[couldn't find pc offset for node=%d]\n", id.ToInt());
694 PrintF(stderr, "[method: %s]\n", *shared->DebugName()->ToCString()); 694 PrintF(stderr, "[method: %s]\n", shared->DebugName()->ToCString().get());
695 // Print the source code if available. 695 // Print the source code if available.
696 HeapStringAllocator string_allocator; 696 HeapStringAllocator string_allocator;
697 StringStream stream(&string_allocator); 697 StringStream stream(&string_allocator);
698 shared->SourceCodePrint(&stream, -1); 698 shared->SourceCodePrint(&stream, -1);
699 PrintF(stderr, "[source:\n%s\n]", *stream.ToCString()); 699 PrintF(stderr, "[source:\n%s\n]", stream.ToCString().get());
700 700
701 FATAL("unable to find pc offset during deoptimization"); 701 FATAL("unable to find pc offset during deoptimization");
702 return -1; 702 return -1;
703 } 703 }
704 704
705 705
706 int Deoptimizer::GetDeoptimizedCodeCount(Isolate* isolate) { 706 int Deoptimizer::GetDeoptimizedCodeCount(Isolate* isolate) {
707 int length = 0; 707 int length = 0;
708 // Count all entries in the deoptimizing code list of every context. 708 // Count all entries in the deoptimizing code list of every context.
709 Object* context = isolate->heap()->native_contexts_list(); 709 Object* context = isolate->heap()->native_contexts_list();
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
1515 top_address + output_frame_offset, output_frame_offset, value); 1515 top_address + output_frame_offset, output_frame_offset, value);
1516 } 1516 }
1517 1517
1518 // The context can be gotten from the input frame. 1518 // The context can be gotten from the input frame.
1519 Register context_reg = StubFailureTrampolineFrame::context_register(); 1519 Register context_reg = StubFailureTrampolineFrame::context_register();
1520 input_frame_offset -= kPointerSize; 1520 input_frame_offset -= kPointerSize;
1521 value = input_->GetFrameSlot(input_frame_offset); 1521 value = input_->GetFrameSlot(input_frame_offset);
1522 output_frame->SetRegister(context_reg.code(), value); 1522 output_frame->SetRegister(context_reg.code(), value);
1523 output_frame_offset -= kPointerSize; 1523 output_frame_offset -= kPointerSize;
1524 output_frame->SetFrameSlot(output_frame_offset, value); 1524 output_frame->SetFrameSlot(output_frame_offset, value);
1525 ASSERT(reinterpret_cast<Object*>(value)->IsContext());
1525 if (trace_scope_ != NULL) { 1526 if (trace_scope_ != NULL) {
1526 PrintF(trace_scope_->file(), 1527 PrintF(trace_scope_->file(),
1527 " 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" 1528 " 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08"
1528 V8PRIxPTR " ; context\n", 1529 V8PRIxPTR " ; context\n",
1529 top_address + output_frame_offset, output_frame_offset, value); 1530 top_address + output_frame_offset, output_frame_offset, value);
1530 } 1531 }
1531 1532
1532 // A marker value is used in place of the function. 1533 // A marker value is used in place of the function.
1533 output_frame_offset -= kPointerSize; 1534 output_frame_offset -= kPointerSize;
1534 value = reinterpret_cast<intptr_t>( 1535 value = reinterpret_cast<intptr_t>(
(...skipping 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after
3054 3055
3055 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { 3056 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) {
3056 v->VisitPointer(BitCast<Object**>(&function_)); 3057 v->VisitPointer(BitCast<Object**>(&function_));
3057 v->VisitPointers(parameters_, parameters_ + parameters_count_); 3058 v->VisitPointers(parameters_, parameters_ + parameters_count_);
3058 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); 3059 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_);
3059 } 3060 }
3060 3061
3061 #endif // ENABLE_DEBUGGER_SUPPORT 3062 #endif // ENABLE_DEBUGGER_SUPPORT
3062 3063
3063 } } // namespace v8::internal 3064 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/debug-agent.cc ('k') | src/disassembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698