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

Side by Side Diff: src/frames.cc

Issue 96773002: Handle captured objects in OptimizedFrame::Summarize. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
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 | « no previous file | src/isolate.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 966 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 i--; 977 i--;
978 BailoutId ast_id = BailoutId(it.Next()); 978 BailoutId ast_id = BailoutId(it.Next());
979 JSFunction* function = LiteralAt(literal_array, it.Next()); 979 JSFunction* function = LiteralAt(literal_array, it.Next());
980 it.Next(); // Skip height. 980 it.Next(); // Skip height.
981 981
982 // The translation commands are ordered and the receiver is always 982 // The translation commands are ordered and the receiver is always
983 // at the first position. Since we are always at a call when we need 983 // at the first position. Since we are always at a call when we need
984 // to construct a stack trace, the receiver is always in a stack slot. 984 // to construct a stack trace, the receiver is always in a stack slot.
985 opcode = static_cast<Translation::Opcode>(it.Next()); 985 opcode = static_cast<Translation::Opcode>(it.Next());
986 ASSERT(opcode == Translation::STACK_SLOT || 986 ASSERT(opcode == Translation::STACK_SLOT ||
987 opcode == Translation::LITERAL); 987 opcode == Translation::LITERAL ||
988 opcode == Translation::CAPTURED_OBJECT ||
989 opcode == Translation::DUPLICATED_OBJECT);
988 int index = it.Next(); 990 int index = it.Next();
989 991
990 // Get the correct receiver in the optimized frame. 992 // Get the correct receiver in the optimized frame.
991 Object* receiver = NULL; 993 Object* receiver = NULL;
992 if (opcode == Translation::LITERAL) { 994 if (opcode == Translation::LITERAL) {
993 receiver = data->LiteralArray()->get(index); 995 receiver = data->LiteralArray()->get(index);
994 } else { 996 } else if (opcode == Translation::STACK_SLOT) {
995 // Positive index means the value is spilled to the locals 997 // Positive index means the value is spilled to the locals
996 // area. Negative means it is stored in the incoming parameter 998 // area. Negative means it is stored in the incoming parameter
997 // area. 999 // area.
998 if (index >= 0) { 1000 if (index >= 0) {
999 receiver = GetExpression(index); 1001 receiver = GetExpression(index);
1000 } else { 1002 } else {
1001 // Index -1 overlaps with last parameter, -n with the first parameter, 1003 // Index -1 overlaps with last parameter, -n with the first parameter,
1002 // (-n - 1) with the receiver with n being the number of parameters 1004 // (-n - 1) with the receiver with n being the number of parameters
1003 // of the outermost, optimized frame. 1005 // of the outermost, optimized frame.
1004 int parameter_count = ComputeParametersCount(); 1006 int parameter_count = ComputeParametersCount();
1005 int parameter_index = index + parameter_count; 1007 int parameter_index = index + parameter_count;
1006 receiver = (parameter_index == -1) 1008 receiver = (parameter_index == -1)
1007 ? this->receiver() 1009 ? this->receiver()
1008 : this->GetParameter(parameter_index); 1010 : this->GetParameter(parameter_index);
1009 } 1011 }
1012 } else {
1013 // TODO(3029): Materializing a captured object (or duplicated
1014 // object) is hard, we return undefined for now. This breaks the
1015 // produced stack trace, as constructor frames aren't marked as
1016 // such anymore.
1017 receiver = isolate()->heap()->undefined_value();
1010 } 1018 }
1011 1019
1012 Code* code = function->shared()->code(); 1020 Code* code = function->shared()->code();
1013 DeoptimizationOutputData* output_data = 1021 DeoptimizationOutputData* output_data =
1014 DeoptimizationOutputData::cast(code->deoptimization_data()); 1022 DeoptimizationOutputData::cast(code->deoptimization_data());
1015 unsigned entry = Deoptimizer::GetOutputInfo(output_data, 1023 unsigned entry = Deoptimizer::GetOutputInfo(output_data,
1016 ast_id, 1024 ast_id,
1017 function->shared()); 1025 function->shared());
1018 unsigned pc_offset = 1026 unsigned pc_offset =
1019 FullCodeGenerator::PcField::decode(entry) + Code::kHeaderSize; 1027 FullCodeGenerator::PcField::decode(entry) + Code::kHeaderSize;
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
1630 ZoneList<StackFrame*> list(10, zone); 1638 ZoneList<StackFrame*> list(10, zone);
1631 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { 1639 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) {
1632 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); 1640 StackFrame* frame = AllocateFrameCopy(it.frame(), zone);
1633 list.Add(frame, zone); 1641 list.Add(frame, zone);
1634 } 1642 }
1635 return list.ToVector(); 1643 return list.ToVector();
1636 } 1644 }
1637 1645
1638 1646
1639 } } // namespace v8::internal 1647 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698