| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1141 LiveEdit::FunctionPatchabilityStatus status) { | 1141 LiveEdit::FunctionPatchabilityStatus status) { |
| 1142 if (!frame->is_java_script()) { | 1142 if (!frame->is_java_script()) { |
| 1143 return false; | 1143 return false; |
| 1144 } | 1144 } |
| 1145 int len = Smi::cast(shared_info_array->length())->value(); | 1145 int len = Smi::cast(shared_info_array->length())->value(); |
| 1146 for (int i = 0; i < len; i++) { | 1146 for (int i = 0; i < len; i++) { |
| 1147 JSValue* wrapper = JSValue::cast(shared_info_array->GetElement(i)); | 1147 JSValue* wrapper = JSValue::cast(shared_info_array->GetElement(i)); |
| 1148 Handle<SharedFunctionInfo> shared( | 1148 Handle<SharedFunctionInfo> shared( |
| 1149 SharedFunctionInfo::cast(wrapper->value())); | 1149 SharedFunctionInfo::cast(wrapper->value())); |
| 1150 | 1150 |
| 1151 if (frame->code() == shared->code()) { | 1151 if (frame->LookupCode(Isolate::Current()) == shared->code()) { |
| 1152 SetElement(result, i, Handle<Smi>(Smi::FromInt(status))); | 1152 SetElement(result, i, Handle<Smi>(Smi::FromInt(status))); |
| 1153 return true; | 1153 return true; |
| 1154 } | 1154 } |
| 1155 } | 1155 } |
| 1156 return false; | 1156 return false; |
| 1157 } | 1157 } |
| 1158 | 1158 |
| 1159 | 1159 |
| 1160 // Iterates over handler chain and removes all elements that are inside | 1160 // Iterates over handler chain and removes all elements that are inside |
| 1161 // frames being dropped. | 1161 // frames being dropped. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 1191 return "Stack manipulations are not supported in this architecture."; | 1191 return "Stack manipulations are not supported in this architecture."; |
| 1192 } | 1192 } |
| 1193 | 1193 |
| 1194 StackFrame* pre_top_frame = frames[top_frame_index - 1]; | 1194 StackFrame* pre_top_frame = frames[top_frame_index - 1]; |
| 1195 StackFrame* top_frame = frames[top_frame_index]; | 1195 StackFrame* top_frame = frames[top_frame_index]; |
| 1196 StackFrame* bottom_js_frame = frames[bottom_js_frame_index]; | 1196 StackFrame* bottom_js_frame = frames[bottom_js_frame_index]; |
| 1197 | 1197 |
| 1198 ASSERT(bottom_js_frame->is_java_script()); | 1198 ASSERT(bottom_js_frame->is_java_script()); |
| 1199 | 1199 |
| 1200 // Check the nature of the top frame. | 1200 // Check the nature of the top frame. |
| 1201 if (pre_top_frame->code()->is_inline_cache_stub() && | 1201 Code* pre_top_frame_code = pre_top_frame->LookupCode(Isolate::Current()); |
| 1202 pre_top_frame->code()->ic_state() == DEBUG_BREAK) { | 1202 if (pre_top_frame_code->is_inline_cache_stub() && |
| 1203 pre_top_frame_code->ic_state() == DEBUG_BREAK) { |
| 1203 // OK, we can drop inline cache calls. | 1204 // OK, we can drop inline cache calls. |
| 1204 *mode = Debug::FRAME_DROPPED_IN_IC_CALL; | 1205 *mode = Debug::FRAME_DROPPED_IN_IC_CALL; |
| 1205 } else if (pre_top_frame->code() == | 1206 } else if (pre_top_frame_code == |
| 1206 Isolate::Current()->debug()->debug_break_slot()) { | 1207 Isolate::Current()->debug()->debug_break_slot()) { |
| 1207 // OK, we can drop debug break slot. | 1208 // OK, we can drop debug break slot. |
| 1208 *mode = Debug::FRAME_DROPPED_IN_DEBUG_SLOT_CALL; | 1209 *mode = Debug::FRAME_DROPPED_IN_DEBUG_SLOT_CALL; |
| 1209 } else if (pre_top_frame->code() == | 1210 } else if (pre_top_frame_code == |
| 1210 Isolate::Current()->builtins()->builtin( | 1211 Isolate::Current()->builtins()->builtin( |
| 1211 Builtins::FrameDropper_LiveEdit)) { | 1212 Builtins::FrameDropper_LiveEdit)) { |
| 1212 // OK, we can drop our own code. | 1213 // OK, we can drop our own code. |
| 1213 *mode = Debug::FRAME_DROPPED_IN_DIRECT_CALL; | 1214 *mode = Debug::FRAME_DROPPED_IN_DIRECT_CALL; |
| 1214 } else if (pre_top_frame->code()->kind() == Code::STUB && | 1215 } else if (pre_top_frame_code->kind() == Code::STUB && |
| 1215 pre_top_frame->code()->major_key()) { | 1216 pre_top_frame_code->major_key()) { |
| 1216 // Entry from our unit tests, it's fine, we support this case. | 1217 // Entry from our unit tests, it's fine, we support this case. |
| 1217 *mode = Debug::FRAME_DROPPED_IN_DIRECT_CALL; | 1218 *mode = Debug::FRAME_DROPPED_IN_DIRECT_CALL; |
| 1218 } else { | 1219 } else { |
| 1219 return "Unknown structure of stack above changing function"; | 1220 return "Unknown structure of stack above changing function"; |
| 1220 } | 1221 } |
| 1221 | 1222 |
| 1222 Address unused_stack_top = top_frame->sp(); | 1223 Address unused_stack_top = top_frame->sp(); |
| 1223 Address unused_stack_bottom = bottom_js_frame->fp() | 1224 Address unused_stack_bottom = bottom_js_frame->fp() |
| 1224 - Debug::kFrameDropperFrameSize * kPointerSize // Size of the new frame. | 1225 - Debug::kFrameDropperFrameSize * kPointerSize // Size of the new frame. |
| 1225 + kPointerSize; // Bigger address end is exclusive. | 1226 + kPointerSize; // Bigger address end is exclusive. |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1483 | 1484 |
| 1484 bool LiveEditFunctionTracker::IsActive() { | 1485 bool LiveEditFunctionTracker::IsActive() { |
| 1485 return false; | 1486 return false; |
| 1486 } | 1487 } |
| 1487 | 1488 |
| 1488 #endif // ENABLE_DEBUGGER_SUPPORT | 1489 #endif // ENABLE_DEBUGGER_SUPPORT |
| 1489 | 1490 |
| 1490 | 1491 |
| 1491 | 1492 |
| 1492 } } // namespace v8::internal | 1493 } } // namespace v8::internal |
| OLD | NEW |