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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 // in order to analyze, whether the function changed its outer scope | 44 // in order to analyze, whether the function changed its outer scope |
45 // expectations (or number of parameters). If it didn't, function's code is | 45 // expectations (or number of parameters). If it didn't, function's code is |
46 // patched with a newly compiled code. If it did change, enclosing function | 46 // patched with a newly compiled code. If it did change, enclosing function |
47 // gets patched. All inner functions are left untouched, whatever happened | 47 // gets patched. All inner functions are left untouched, whatever happened |
48 // to them in a new script version. However, new version of code will | 48 // to them in a new script version. However, new version of code will |
49 // instantiate newly compiled functions. | 49 // instantiate newly compiled functions. |
50 | 50 |
51 | 51 |
52 #include "compiler.h" | 52 #include "compiler.h" |
53 | 53 |
| 54 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 55 |
54 namespace v8 { | 56 namespace v8 { |
55 namespace internal { | 57 namespace internal { |
56 | 58 |
| 59 void ChangeScriptLive(Handle<Script> original_script, |
| 60 Handle<String> original_source, |
| 61 Handle<String> new_source, |
| 62 Handle<FixedArray> function_shared_info, |
| 63 int function_shared_info_len, |
| 64 int pos, int len_old, int len_new); |
| 65 |
| 66 |
| 67 class FunctionInfoListener; |
| 68 |
57 // This class collects some specific information on structure of functions | 69 // This class collects some specific information on structure of functions |
58 // in a particular script. It gets called from compiler all the time, but | 70 // in a particular script. It gets called from compiler all the time, but |
59 // actually records any data only when liveedit operation is in process; | 71 // actually records any data only when liveedit operation is in process; |
60 // in any other time this class is very cheap. | 72 // in any other time this class is very cheap. |
61 // | 73 // |
62 // The primary interest of the Tracker is to record function scope structures | 74 // The primary interest of the Tracker is to record function scope structures |
63 // in order to analyze whether function code maybe safely patched (with new | 75 // in order to analyze whether function code maybe safely patched (with new |
64 // code successfully reading existing data from function scopes). The Tracker | 76 // code successfully reading existing data from function scopes). The Tracker |
65 // also collects compiled function codes. | 77 // also collects compiled function codes. |
66 class LiveEditFunctionTracker { | 78 class LiveEditFunctionTracker { |
67 public: | 79 public: |
68 LiveEditFunctionTracker(FunctionLiteral* fun); | 80 LiveEditFunctionTracker(FunctionLiteral* fun); |
69 ~LiveEditFunctionTracker(); | 81 ~LiveEditFunctionTracker(); |
70 void RecordFunctionCode(Handle<Code> code); | 82 void RecordFunctionCode(Handle<Code> code); |
71 void RecordFunctionScope(Scope* scope); | 83 void RecordFunctionScope(Scope* scope); |
72 | 84 |
73 static bool IsActive(); | 85 static bool IsActive(); |
74 }; | 86 }; |
75 | 87 |
76 } } // namespace v8::internal | 88 } } // namespace v8::internal |
77 | 89 |
| 90 #endif // ENABLE_DEBUGGER_SUPPORT |
| 91 |
78 #endif /* V*_LIVEEDIT_H_ */ | 92 #endif /* V*_LIVEEDIT_H_ */ |
OLD | NEW |