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

Side by Side Diff: src/deoptimizer.cc

Issue 7282033: Change return type of FrameDescription::GetFrameSize to avoid unneeded type casts. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 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.h ('k') | src/ia32/deoptimizer-ia32.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 // Create the GC safe output frame information and register it for GC 154 // Create the GC safe output frame information and register it for GC
155 // handling. 155 // handling.
156 ASSERT_LT(frame_index, deoptimizer->output_count()); 156 ASSERT_LT(frame_index, deoptimizer->output_count());
157 DeoptimizedFrameInfo* info = 157 DeoptimizedFrameInfo* info =
158 new DeoptimizedFrameInfo(deoptimizer, frame_index); 158 new DeoptimizedFrameInfo(deoptimizer, frame_index);
159 isolate->deoptimizer_data()->deoptimized_frame_info_ = info; 159 isolate->deoptimizer_data()->deoptimized_frame_info_ = info;
160 160
161 // Get the "simulated" top and size for the requested frame. 161 // Get the "simulated" top and size for the requested frame.
162 Address top = 162 Address top =
163 reinterpret_cast<Address>(deoptimizer->output_[frame_index]->GetTop()); 163 reinterpret_cast<Address>(deoptimizer->output_[frame_index]->GetTop());
164 intptr_t size = 164 unsigned size =
165 deoptimizer->output_[frame_index]->GetFrameSize() / kPointerSize; 165 deoptimizer->output_[frame_index]->GetFrameSize() / kPointerSize;
166 166
167 // Done with the GC-unsafe frame descriptions. This re-enables allocation. 167 // Done with the GC-unsafe frame descriptions. This re-enables allocation.
168 deoptimizer->DeleteFrameDescriptions(); 168 deoptimizer->DeleteFrameDescriptions();
169 169
170 // Allocate a heap number for the doubles belonging to this frame. 170 // Allocate a heap number for the doubles belonging to this frame.
171 deoptimizer->MaterializeHeapNumbersForDebuggerInspectableFrame( 171 deoptimizer->MaterializeHeapNumbersForDebuggerInspectableFrame(
172 top, size, info); 172 top, size, info);
173 173
174 // Finished using the deoptimizer instance. 174 // Finished using the deoptimizer instance.
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after
1107 SetFrameSlot(o, kZapUint32); 1107 SetFrameSlot(o, kZapUint32);
1108 } 1108 }
1109 } 1109 }
1110 1110
1111 1111
1112 unsigned FrameDescription::GetOffsetFromSlotIndex(Deoptimizer* deoptimizer, 1112 unsigned FrameDescription::GetOffsetFromSlotIndex(Deoptimizer* deoptimizer,
1113 int slot_index) { 1113 int slot_index) {
1114 if (slot_index >= 0) { 1114 if (slot_index >= 0) {
1115 // Local or spill slots. Skip the fixed part of the frame 1115 // Local or spill slots. Skip the fixed part of the frame
1116 // including all arguments. 1116 // including all arguments.
1117 unsigned base = static_cast<unsigned>( 1117 unsigned base =
1118 GetFrameSize() - deoptimizer->ComputeFixedSize(GetFunction())); 1118 GetFrameSize() - deoptimizer->ComputeFixedSize(GetFunction());
1119 return base - ((slot_index + 1) * kPointerSize); 1119 return base - ((slot_index + 1) * kPointerSize);
1120 } else { 1120 } else {
1121 // Incoming parameter. 1121 // Incoming parameter.
1122 unsigned base = static_cast<unsigned>(GetFrameSize() - 1122 unsigned base = GetFrameSize() -
1123 deoptimizer->ComputeIncomingArgumentSize(GetFunction())); 1123 deoptimizer->ComputeIncomingArgumentSize(GetFunction()));
1124 return base - ((slot_index + 1) * kPointerSize); 1124 return base - ((slot_index + 1) * kPointerSize);
1125 } 1125 }
1126 } 1126 }
1127 1127
1128 1128
1129 unsigned FrameDescription::GetExpressionCount(Deoptimizer* deoptimizer) { 1129 unsigned FrameDescription::GetExpressionCount(Deoptimizer* deoptimizer) {
1130 ASSERT_EQ(Code::FUNCTION, kind_); 1130 ASSERT_EQ(Code::FUNCTION, kind_);
1131 intptr_t size = GetFrameSize() - deoptimizer->ComputeFixedSize(GetFunction()); 1131 unsigned size = GetFrameSize() - deoptimizer->ComputeFixedSize(GetFunction());
1132 return static_cast<unsigned>(size / kPointerSize); 1132 return size / kPointerSize;
1133 } 1133 }
1134 1134
1135 1135
1136 Object* FrameDescription::GetExpression(Deoptimizer* deoptimizer, int index) { 1136 Object* FrameDescription::GetExpression(Deoptimizer* deoptimizer, int index) {
1137 ASSERT_EQ(Code::FUNCTION, kind_); 1137 ASSERT_EQ(Code::FUNCTION, kind_);
1138 unsigned offset = GetOffsetFromSlotIndex(deoptimizer, index); 1138 unsigned offset = GetOffsetFromSlotIndex(deoptimizer, index);
1139 return reinterpret_cast<Object*>(*GetFrameSlotPointer(offset)); 1139 return reinterpret_cast<Object*>(*GetFrameSlotPointer(offset));
1140 } 1140 }
1141 1141
1142 1142
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
1426 DeoptimizedFrameInfo::~DeoptimizedFrameInfo() { 1426 DeoptimizedFrameInfo::~DeoptimizedFrameInfo() {
1427 delete expression_stack_; 1427 delete expression_stack_;
1428 } 1428 }
1429 1429
1430 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { 1430 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) {
1431 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); 1431 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_);
1432 } 1432 }
1433 1433
1434 1434
1435 } } // namespace v8::internal 1435 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/deoptimizer.h ('k') | src/ia32/deoptimizer-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698