| OLD | NEW |
| 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 Loading... |
| 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 2345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3055 | 3055 |
| 3056 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { | 3056 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { |
| 3057 v->VisitPointer(BitCast<Object**>(&function_)); | 3057 v->VisitPointer(BitCast<Object**>(&function_)); |
| 3058 v->VisitPointers(parameters_, parameters_ + parameters_count_); | 3058 v->VisitPointers(parameters_, parameters_ + parameters_count_); |
| 3059 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); | 3059 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); |
| 3060 } | 3060 } |
| 3061 | 3061 |
| 3062 #endif // ENABLE_DEBUGGER_SUPPORT | 3062 #endif // ENABLE_DEBUGGER_SUPPORT |
| 3063 | 3063 |
| 3064 } } // namespace v8::internal | 3064 } } // namespace v8::internal |
| OLD | NEW |