| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 FUNCTION_AVAILABLE_FOR_PATCH = 1, | 128 FUNCTION_AVAILABLE_FOR_PATCH = 1, |
| 129 FUNCTION_BLOCKED_ON_ACTIVE_STACK = 2, | 129 FUNCTION_BLOCKED_ON_ACTIVE_STACK = 2, |
| 130 FUNCTION_BLOCKED_ON_OTHER_STACK = 3, | 130 FUNCTION_BLOCKED_ON_OTHER_STACK = 3, |
| 131 FUNCTION_BLOCKED_UNDER_NATIVE_CODE = 4, | 131 FUNCTION_BLOCKED_UNDER_NATIVE_CODE = 4, |
| 132 FUNCTION_REPLACED_ON_ACTIVE_STACK = 5 | 132 FUNCTION_REPLACED_ON_ACTIVE_STACK = 5 |
| 133 }; | 133 }; |
| 134 | 134 |
| 135 // Compares 2 strings line-by-line, then token-wise and returns diff in form | 135 // Compares 2 strings line-by-line, then token-wise and returns diff in form |
| 136 // of array of triplets (pos1, pos1_end, pos2_end) describing list | 136 // of array of triplets (pos1, pos1_end, pos2_end) describing list |
| 137 // of diff chunks. | 137 // of diff chunks. |
| 138 static Handle<JSArray> CompareStrings(Handle<String> s1, | 138 static MUST_USE_RESULT MaybeObject/*<JSArray>*/* CompareStrings( |
| 139 Handle<String> s2); | 139 Handle<String> s1, Handle<String> s2); |
| 140 }; | 140 }; |
| 141 | 141 |
| 142 | 142 |
| 143 // A general-purpose comparator between 2 arrays. | 143 // A general-purpose comparator between 2 arrays. |
| 144 class Comparator { | 144 class Comparator { |
| 145 public: | 145 public: |
| 146 | 146 |
| 147 // Holds 2 arrays of some elements allowing to compare any pair of | 147 // Holds 2 arrays of some elements allowing to compare any pair of |
| 148 // element from the first array and element from the second array. | 148 // element from the first array and element from the second array. |
| 149 class Input { | 149 class Input { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 161 public: | 161 public: |
| 162 // Puts another chunk in result list. Note that technically speaking | 162 // Puts another chunk in result list. Note that technically speaking |
| 163 // only 3 arguments actually needed with 4th being derivable. | 163 // only 3 arguments actually needed with 4th being derivable. |
| 164 virtual void AddChunk(int pos1, int pos2, int len1, int len2) = 0; | 164 virtual void AddChunk(int pos1, int pos2, int len1, int len2) = 0; |
| 165 | 165 |
| 166 protected: | 166 protected: |
| 167 virtual ~Output() {} | 167 virtual ~Output() {} |
| 168 }; | 168 }; |
| 169 | 169 |
| 170 // Finds the difference between 2 arrays of elements. | 170 // Finds the difference between 2 arrays of elements. |
| 171 static void CalculateDifference(Input* input, | 171 static MUST_USE_RESULT MaybeObject/*<void>*/* CalculateDifference( |
| 172 Output* result_writer); | 172 Input* input, Output* result_writer, Isolate* isolate); |
| 173 }; | 173 }; |
| 174 | 174 |
| 175 #endif // ENABLE_DEBUGGER_SUPPORT | 175 #endif // ENABLE_DEBUGGER_SUPPORT |
| 176 | 176 |
| 177 | 177 |
| 178 } } // namespace v8::internal | 178 } } // namespace v8::internal |
| 179 | 179 |
| 180 #endif /* V*_LIVEEDIT_H_ */ | 180 #endif /* V*_LIVEEDIT_H_ */ |
| OLD | NEW |