OLD | NEW |
---|---|
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 21 matching lines...) Expand all Loading... | |
32 #include "arguments.h" | 32 #include "arguments.h" |
33 #include "codegen.h" | 33 #include "codegen.h" |
34 #include "execution.h" | 34 #include "execution.h" |
35 #include "ic-inl.h" | 35 #include "ic-inl.h" |
36 #include "runtime.h" | 36 #include "runtime.h" |
37 #include "stub-cache.h" | 37 #include "stub-cache.h" |
38 | 38 |
39 namespace v8 { | 39 namespace v8 { |
40 namespace internal { | 40 namespace internal { |
41 | 41 |
42 | |
43 // Resolves pc_address through the resolution address function if one is set. | |
44 static inline Address* ResolveReturnAddressLocation(Address* pc_address) { | |
45 extern ReturnAddressLocationResolver return_address_location_resolver; | |
46 | |
47 if (return_address_location_resolver == NULL) { | |
48 return pc_address; | |
49 } else { | |
50 return reinterpret_cast<Address*>( | |
51 return_address_location_resolver( | |
52 reinterpret_cast<uintptr_t>(pc_address))); | |
53 } | |
54 } | |
55 | |
56 | |
42 #ifdef DEBUG | 57 #ifdef DEBUG |
43 char IC::TransitionMarkFromState(IC::State state) { | 58 char IC::TransitionMarkFromState(IC::State state) { |
44 switch (state) { | 59 switch (state) { |
45 case UNINITIALIZED: return '0'; | 60 case UNINITIALIZED: return '0'; |
46 case PREMONOMORPHIC: return '.'; | 61 case PREMONOMORPHIC: return '.'; |
47 case MONOMORPHIC: return '1'; | 62 case MONOMORPHIC: return '1'; |
48 case MONOMORPHIC_PROTOTYPE_FAILURE: return '^'; | 63 case MONOMORPHIC_PROTOTYPE_FAILURE: return '^'; |
49 case POLYMORPHIC: return 'P'; | 64 case POLYMORPHIC: return 'P'; |
50 case MEGAMORPHIC: return 'N'; | 65 case MEGAMORPHIC: return 'N'; |
51 case GENERIC: return 'G'; | 66 case GENERIC: return 'G'; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
137 pc_address = reinterpret_cast<Address*>(fp + kCallerPCOffset); | 152 pc_address = reinterpret_cast<Address*>(fp + kCallerPCOffset); |
138 fp = Memory::Address_at(fp + StandardFrameConstants::kCallerFPOffset); | 153 fp = Memory::Address_at(fp + StandardFrameConstants::kCallerFPOffset); |
139 } | 154 } |
140 #ifdef DEBUG | 155 #ifdef DEBUG |
141 StackFrameIterator it(isolate); | 156 StackFrameIterator it(isolate); |
142 for (int i = 0; i < depth + 1; i++) it.Advance(); | 157 for (int i = 0; i < depth + 1; i++) it.Advance(); |
143 StackFrame* frame = it.frame(); | 158 StackFrame* frame = it.frame(); |
144 ASSERT(fp == frame->fp() && pc_address == frame->pc_address()); | 159 ASSERT(fp == frame->fp() && pc_address == frame->pc_address()); |
145 #endif | 160 #endif |
146 fp_ = fp; | 161 fp_ = fp; |
147 pc_address_ = pc_address; | 162 pc_address_ = ResolveReturnAddressLocation(pc_address); |
danno
2013/06/11 11:33:14
The comment above about the performance sensitivit
| |
148 } | 163 } |
149 | 164 |
150 | 165 |
151 #ifdef ENABLE_DEBUGGER_SUPPORT | 166 #ifdef ENABLE_DEBUGGER_SUPPORT |
152 Address IC::OriginalCodeAddress() const { | 167 Address IC::OriginalCodeAddress() const { |
153 HandleScope scope(isolate()); | 168 HandleScope scope(isolate()); |
154 // Compute the JavaScript frame for the frame pointer of this IC | 169 // Compute the JavaScript frame for the frame pointer of this IC |
155 // structure. We need this to be able to find the function | 170 // structure. We need this to be able to find the function |
156 // corresponding to the frame. | 171 // corresponding to the frame. |
157 StackFrameIterator it(isolate()); | 172 StackFrameIterator it(isolate()); |
(...skipping 2844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3002 #undef ADDR | 3017 #undef ADDR |
3003 }; | 3018 }; |
3004 | 3019 |
3005 | 3020 |
3006 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 3021 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
3007 return IC_utilities[id]; | 3022 return IC_utilities[id]; |
3008 } | 3023 } |
3009 | 3024 |
3010 | 3025 |
3011 } } // namespace v8::internal | 3026 } } // namespace v8::internal |
OLD | NEW |