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

Side by Side Diff: src/deoptimizer.cc

Issue 18404009: Refactor JavaScriptFrame::function() to return a JSFunction* and remove associated casts. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remove implicit ASSERT. 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/debug.cc ('k') | src/frames.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 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 179
180 #ifdef ENABLE_DEBUGGER_SUPPORT 180 #ifdef ENABLE_DEBUGGER_SUPPORT
181 DeoptimizedFrameInfo* Deoptimizer::DebuggerInspectableFrame( 181 DeoptimizedFrameInfo* Deoptimizer::DebuggerInspectableFrame(
182 JavaScriptFrame* frame, 182 JavaScriptFrame* frame,
183 int jsframe_index, 183 int jsframe_index,
184 Isolate* isolate) { 184 Isolate* isolate) {
185 ASSERT(frame->is_optimized()); 185 ASSERT(frame->is_optimized());
186 ASSERT(isolate->deoptimizer_data()->deoptimized_frame_info_ == NULL); 186 ASSERT(isolate->deoptimizer_data()->deoptimized_frame_info_ == NULL);
187 187
188 // Get the function and code from the frame. 188 // Get the function and code from the frame.
189 JSFunction* function = JSFunction::cast(frame->function()); 189 JSFunction* function = frame->function();
190 Code* code = frame->LookupCode(); 190 Code* code = frame->LookupCode();
191 191
192 // Locate the deoptimization point in the code. As we are at a call the 192 // Locate the deoptimization point in the code. As we are at a call the
193 // return address must be at a place in the code with deoptimization support. 193 // return address must be at a place in the code with deoptimization support.
194 SafepointEntry safepoint_entry = code->GetSafepointEntry(frame->pc()); 194 SafepointEntry safepoint_entry = code->GetSafepointEntry(frame->pc());
195 int deoptimization_index = safepoint_entry.deoptimization_index(); 195 int deoptimization_index = safepoint_entry.deoptimization_index();
196 ASSERT(deoptimization_index != Safepoint::kNoDeoptimizationIndex); 196 ASSERT(deoptimization_index != Safepoint::kNoDeoptimizationIndex);
197 197
198 // Always use the actual stack slots when calculating the fp to sp 198 // Always use the actual stack slots when calculating the fp to sp
199 // delta adding two for the function and context. 199 // delta adding two for the function and context.
(...skipping 1402 matching lines...) Expand 10 before | Expand all | Expand 10 after
1602 PrintF("Materializing a new heap number %p [%e] for arguments object\n", 1602 PrintF("Materializing a new heap number %p [%e] for arguments object\n",
1603 reinterpret_cast<void*>(*num), double_value); 1603 reinterpret_cast<void*>(*num), double_value);
1604 } 1604 }
1605 values.Set(i, num); 1605 values.Set(i, num);
1606 } 1606 }
1607 1607
1608 // Materialize arguments objects one frame at a time. 1608 // Materialize arguments objects one frame at a time.
1609 for (int frame_index = 0; frame_index < jsframe_count(); ++frame_index) { 1609 for (int frame_index = 0; frame_index < jsframe_count(); ++frame_index) {
1610 if (frame_index != 0) it->Advance(); 1610 if (frame_index != 0) it->Advance();
1611 JavaScriptFrame* frame = it->frame(); 1611 JavaScriptFrame* frame = it->frame();
1612 Handle<JSFunction> function(JSFunction::cast(frame->function()), isolate_); 1612 Handle<JSFunction> function(frame->function(), isolate_);
1613 Handle<JSObject> arguments; 1613 Handle<JSObject> arguments;
1614 for (int i = frame->ComputeExpressionsCount() - 1; i >= 0; --i) { 1614 for (int i = frame->ComputeExpressionsCount() - 1; i >= 0; --i) {
1615 if (frame->GetExpression(i) == isolate_->heap()->arguments_marker()) { 1615 if (frame->GetExpression(i) == isolate_->heap()->arguments_marker()) {
1616 ObjectMaterializationDescriptor descriptor = 1616 ObjectMaterializationDescriptor descriptor =
1617 deferred_objects_.RemoveLast(); 1617 deferred_objects_.RemoveLast();
1618 const int length = descriptor.object_length(); 1618 const int length = descriptor.object_length();
1619 if (arguments.is_null()) { 1619 if (arguments.is_null()) {
1620 if (frame->has_adapted_arguments()) { 1620 if (frame->has_adapted_arguments()) {
1621 // Use the arguments adapter frame we just built to materialize the 1621 // Use the arguments adapter frame we just built to materialize the
1622 // arguments object. FunctionGetArguments can't throw an exception, 1622 // arguments object. FunctionGetArguments can't throw an exception,
(...skipping 1470 matching lines...) Expand 10 before | Expand all | Expand 10 after
3093 3093
3094 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { 3094 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) {
3095 v->VisitPointer(BitCast<Object**>(&function_)); 3095 v->VisitPointer(BitCast<Object**>(&function_));
3096 v->VisitPointers(parameters_, parameters_ + parameters_count_); 3096 v->VisitPointers(parameters_, parameters_ + parameters_count_);
3097 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); 3097 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_);
3098 } 3098 }
3099 3099
3100 #endif // ENABLE_DEBUGGER_SUPPORT 3100 #endif // ENABLE_DEBUGGER_SUPPORT
3101 3101
3102 } } // namespace v8::internal 3102 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/debug.cc ('k') | src/frames.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698