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

Side by Side Diff: src/ic.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/frames-inl.h ('k') | src/isolate.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 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 Address IC::OriginalCodeAddress() const { 152 Address IC::OriginalCodeAddress() const {
153 HandleScope scope(isolate()); 153 HandleScope scope(isolate());
154 // Compute the JavaScript frame for the frame pointer of this IC 154 // Compute the JavaScript frame for the frame pointer of this IC
155 // structure. We need this to be able to find the function 155 // structure. We need this to be able to find the function
156 // corresponding to the frame. 156 // corresponding to the frame.
157 StackFrameIterator it(isolate()); 157 StackFrameIterator it(isolate());
158 while (it.frame()->fp() != this->fp()) it.Advance(); 158 while (it.frame()->fp() != this->fp()) it.Advance();
159 JavaScriptFrame* frame = JavaScriptFrame::cast(it.frame()); 159 JavaScriptFrame* frame = JavaScriptFrame::cast(it.frame());
160 // Find the function on the stack and both the active code for the 160 // Find the function on the stack and both the active code for the
161 // function and the original code. 161 // function and the original code.
162 JSFunction* function = JSFunction::cast(frame->function()); 162 JSFunction* function = frame->function();
163 Handle<SharedFunctionInfo> shared(function->shared(), isolate()); 163 Handle<SharedFunctionInfo> shared(function->shared(), isolate());
164 Code* code = shared->code(); 164 Code* code = shared->code();
165 ASSERT(Debug::HasDebugInfo(shared)); 165 ASSERT(Debug::HasDebugInfo(shared));
166 Code* original_code = Debug::GetDebugInfo(shared)->original_code(); 166 Code* original_code = Debug::GetDebugInfo(shared)->original_code();
167 ASSERT(original_code->IsCode()); 167 ASSERT(original_code->IsCode());
168 // Get the address of the call site in the active code. This is the 168 // Get the address of the call site in the active code. This is the
169 // place where the call to DebugBreakXXX is and where the IC 169 // place where the call to DebugBreakXXX is and where the IC
170 // normally would be. 170 // normally would be.
171 Address addr = Assembler::target_address_from_return_address(pc()); 171 Address addr = Assembler::target_address_from_return_address(pc());
172 // Return the address in the original code. This is the place where 172 // Return the address in the original code. This is the place where
(...skipping 2919 matching lines...) Expand 10 before | Expand all | Expand 10 after
3092 #undef ADDR 3092 #undef ADDR
3093 }; 3093 };
3094 3094
3095 3095
3096 Address IC::AddressFromUtilityId(IC::UtilityId id) { 3096 Address IC::AddressFromUtilityId(IC::UtilityId id) {
3097 return IC_utilities[id]; 3097 return IC_utilities[id];
3098 } 3098 }
3099 3099
3100 3100
3101 } } // namespace v8::internal 3101 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/frames-inl.h ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698