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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 Handle<Object> value) { | 54 Handle<Object> value) { |
55 // Ignore return value from SetElement. It can only be a failure if there | 55 // Ignore return value from SetElement. It can only be a failure if there |
56 // are element setters causing exceptions and the debugger context has none | 56 // are element setters causing exceptions and the debugger context has none |
57 // of these. | 57 // of these. |
58 Handle<Object> no_failure = | 58 Handle<Object> no_failure = |
59 JSObject::SetElement(object, index, value, NONE, kNonStrictMode); | 59 JSObject::SetElement(object, index, value, NONE, kNonStrictMode); |
60 ASSERT(!no_failure.is_null()); | 60 ASSERT(!no_failure.is_null()); |
61 USE(no_failure); | 61 USE(no_failure); |
62 } | 62 } |
63 | 63 |
| 64 |
64 // A simple implementation of dynamic programming algorithm. It solves | 65 // A simple implementation of dynamic programming algorithm. It solves |
65 // the problem of finding the difference of 2 arrays. It uses a table of results | 66 // the problem of finding the difference of 2 arrays. It uses a table of results |
66 // of subproblems. Each cell contains a number together with 2-bit flag | 67 // of subproblems. Each cell contains a number together with 2-bit flag |
67 // that helps building the chunk list. | 68 // that helps building the chunk list. |
68 class Differencer { | 69 class Differencer { |
69 public: | 70 public: |
70 explicit Differencer(Comparator::Input* input) | 71 explicit Differencer(Comparator::Input* input) |
71 : input_(input), len1_(input->GetLength1()), len2_(input->GetLength2()) { | 72 : input_(input), len1_(input->GetLength1()), len2_(input->GetLength2()) { |
72 buffer_ = NewArray<int>(len1_ * len2_); | 73 buffer_ = NewArray<int>(len1_ * len2_); |
73 } | 74 } |
(...skipping 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1449 } | 1450 } |
1450 | 1451 |
1451 RelocInfoWriter reloc_info_writer_; | 1452 RelocInfoWriter reloc_info_writer_; |
1452 byte* buffer_; | 1453 byte* buffer_; |
1453 int buffer_size_; | 1454 int buffer_size_; |
1454 | 1455 |
1455 static const int kBufferGap = RelocInfoWriter::kMaxSize; | 1456 static const int kBufferGap = RelocInfoWriter::kMaxSize; |
1456 static const int kMaximalBufferSize = 512*MB; | 1457 static const int kMaximalBufferSize = 512*MB; |
1457 }; | 1458 }; |
1458 | 1459 |
| 1460 |
1459 // Patch positions in code (changes relocation info section) and possibly | 1461 // Patch positions in code (changes relocation info section) and possibly |
1460 // returns new instance of code. | 1462 // returns new instance of code. |
1461 static Handle<Code> PatchPositionsInCode( | 1463 static Handle<Code> PatchPositionsInCode( |
1462 Handle<Code> code, | 1464 Handle<Code> code, |
1463 Handle<JSArray> position_change_array) { | 1465 Handle<JSArray> position_change_array) { |
1464 Isolate* isolate = code->GetIsolate(); | 1466 Isolate* isolate = code->GetIsolate(); |
1465 | 1467 |
1466 RelocInfoBuffer buffer_writer(code->relocation_size(), | 1468 RelocInfoBuffer buffer_writer(code->relocation_size(), |
1467 code->instruction_start()); | 1469 code->instruction_start()); |
1468 | 1470 |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1822 return CheckActivation(m_shared_info_array, m_result, frame, status); | 1824 return CheckActivation(m_shared_info_array, m_result, frame, status); |
1823 } | 1825 } |
1824 const char* GetNotFoundMessage() { | 1826 const char* GetNotFoundMessage() { |
1825 return NULL; | 1827 return NULL; |
1826 } | 1828 } |
1827 private: | 1829 private: |
1828 Handle<JSArray> m_shared_info_array; | 1830 Handle<JSArray> m_shared_info_array; |
1829 Handle<JSArray> m_result; | 1831 Handle<JSArray> m_result; |
1830 }; | 1832 }; |
1831 | 1833 |
| 1834 |
1832 // Drops all call frame matched by target and all frames above them. | 1835 // Drops all call frame matched by target and all frames above them. |
1833 template<typename TARGET> | 1836 template<typename TARGET> |
1834 static const char* DropActivationsInActiveThreadImpl( | 1837 static const char* DropActivationsInActiveThreadImpl( |
1835 TARGET& target, bool do_drop) { | 1838 TARGET& target, bool do_drop) { |
1836 Isolate* isolate = Isolate::Current(); | 1839 Isolate* isolate = Isolate::Current(); |
1837 Debug* debug = isolate->debug(); | 1840 Debug* debug = isolate->debug(); |
1838 Zone zone(isolate); | 1841 Zone zone(isolate); |
1839 Vector<StackFrame*> frames = CreateStackMap(isolate, &zone); | 1842 Vector<StackFrame*> frames = CreateStackMap(isolate, &zone); |
1840 | 1843 |
1841 | 1844 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1918 if (frames[i]->type() == StackFrame::JAVA_SCRIPT) { | 1921 if (frames[i]->type() == StackFrame::JAVA_SCRIPT) { |
1919 new_id = frames[i]->id(); | 1922 new_id = frames[i]->id(); |
1920 break; | 1923 break; |
1921 } | 1924 } |
1922 } | 1925 } |
1923 debug->FramesHaveBeenDropped(new_id, drop_mode, | 1926 debug->FramesHaveBeenDropped(new_id, drop_mode, |
1924 restarter_frame_function_pointer); | 1927 restarter_frame_function_pointer); |
1925 return NULL; | 1928 return NULL; |
1926 } | 1929 } |
1927 | 1930 |
| 1931 |
1928 // Fills result array with statuses of functions. Modifies the stack | 1932 // Fills result array with statuses of functions. Modifies the stack |
1929 // removing all listed function if possible and if do_drop is true. | 1933 // removing all listed function if possible and if do_drop is true. |
1930 static const char* DropActivationsInActiveThread( | 1934 static const char* DropActivationsInActiveThread( |
1931 Handle<JSArray> shared_info_array, Handle<JSArray> result, bool do_drop) { | 1935 Handle<JSArray> shared_info_array, Handle<JSArray> result, bool do_drop) { |
1932 MultipleFunctionTarget target(shared_info_array, result); | 1936 MultipleFunctionTarget target(shared_info_array, result); |
1933 | 1937 |
1934 const char* message = | 1938 const char* message = |
1935 DropActivationsInActiveThreadImpl(target, do_drop); | 1939 DropActivationsInActiveThreadImpl(target, do_drop); |
1936 if (message) { | 1940 if (message) { |
1937 return message; | 1941 return message; |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2121 | 2125 |
2122 bool LiveEditFunctionTracker::IsActive(Isolate* isolate) { | 2126 bool LiveEditFunctionTracker::IsActive(Isolate* isolate) { |
2123 return false; | 2127 return false; |
2124 } | 2128 } |
2125 | 2129 |
2126 #endif // ENABLE_DEBUGGER_SUPPORT | 2130 #endif // ENABLE_DEBUGGER_SUPPORT |
2127 | 2131 |
2128 | 2132 |
2129 | 2133 |
2130 } } // namespace v8::internal | 2134 } } // namespace v8::internal |
OLD | NEW |