OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_DEBUG_LIVEEDIT_H_ | 5 #ifndef V8_DEBUG_LIVEEDIT_H_ |
6 #define V8_DEBUG_LIVEEDIT_H_ | 6 #define V8_DEBUG_LIVEEDIT_H_ |
7 | 7 |
8 | 8 |
9 // Live Edit feature implementation. | 9 // Live Edit feature implementation. |
10 // User should be able to change script on already running VM. This feature | 10 // User should be able to change script on already running VM. This feature |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 // Represents some function compilation details. This structure will be used | 237 // Represents some function compilation details. This structure will be used |
238 // from JavaScript. It contains Code object, which is kept wrapped | 238 // from JavaScript. It contains Code object, which is kept wrapped |
239 // into a BlindReference for sanitizing reasons. | 239 // into a BlindReference for sanitizing reasons. |
240 class FunctionInfoWrapper : public JSArrayBasedStruct<FunctionInfoWrapper> { | 240 class FunctionInfoWrapper : public JSArrayBasedStruct<FunctionInfoWrapper> { |
241 public: | 241 public: |
242 explicit FunctionInfoWrapper(Handle<JSArray> array) | 242 explicit FunctionInfoWrapper(Handle<JSArray> array) |
243 : JSArrayBasedStruct<FunctionInfoWrapper>(array) { | 243 : JSArrayBasedStruct<FunctionInfoWrapper>(array) { |
244 } | 244 } |
245 | 245 |
246 void SetInitialProperties(Handle<String> name, int start_position, | 246 void SetInitialProperties(Handle<String> name, int start_position, |
247 int end_position, int param_num, int literal_count, | 247 int end_position, int param_num, int parent_index, |
248 int parent_index, int function_literal_id); | 248 int function_literal_id); |
249 | 249 |
250 void SetFunctionScopeInfo(Handle<Object> scope_info_array) { | 250 void SetFunctionScopeInfo(Handle<Object> scope_info_array) { |
251 this->SetField(kFunctionScopeInfoOffset_, scope_info_array); | 251 this->SetField(kFunctionScopeInfoOffset_, scope_info_array); |
252 } | 252 } |
253 | 253 |
254 void SetSharedFunctionInfo(Handle<SharedFunctionInfo> info); | 254 void SetSharedFunctionInfo(Handle<SharedFunctionInfo> info); |
255 | 255 |
256 Handle<SharedFunctionInfo> GetSharedFunctionInfo(); | 256 Handle<SharedFunctionInfo> GetSharedFunctionInfo(); |
257 | 257 |
258 int GetLiteralCount() { | |
259 return this->GetSmiValueField(kLiteralNumOffset_); | |
260 } | |
261 | |
262 int GetParentIndex() { | 258 int GetParentIndex() { |
263 return this->GetSmiValueField(kParentIndexOffset_); | 259 return this->GetSmiValueField(kParentIndexOffset_); |
264 } | 260 } |
265 | 261 |
266 int GetStartPosition() { | 262 int GetStartPosition() { |
267 return this->GetSmiValueField(kStartPositionOffset_); | 263 return this->GetSmiValueField(kStartPositionOffset_); |
268 } | 264 } |
269 | 265 |
270 int GetEndPosition() { return this->GetSmiValueField(kEndPositionOffset_); } | 266 int GetEndPosition() { return this->GetSmiValueField(kEndPositionOffset_); } |
271 | 267 |
272 private: | 268 private: |
273 static const int kFunctionNameOffset_ = 0; | 269 static const int kFunctionNameOffset_ = 0; |
274 static const int kStartPositionOffset_ = 1; | 270 static const int kStartPositionOffset_ = 1; |
275 static const int kEndPositionOffset_ = 2; | 271 static const int kEndPositionOffset_ = 2; |
276 static const int kParamNumOffset_ = 3; | 272 static const int kParamNumOffset_ = 3; |
277 static const int kFunctionScopeInfoOffset_ = 4; | 273 static const int kFunctionScopeInfoOffset_ = 4; |
278 static const int kParentIndexOffset_ = 5; | 274 static const int kParentIndexOffset_ = 5; |
279 static const int kSharedFunctionInfoOffset_ = 6; | 275 static const int kSharedFunctionInfoOffset_ = 6; |
280 static const int kLiteralNumOffset_ = 7; | 276 static const int kLiteralNumOffset = 7; |
281 static const int kFunctionLiteralIdOffset_ = 8; | 277 static const int kFunctionLiteralIdOffset_ = 8; |
282 static const int kSize_ = 9; | 278 static const int kSize_ = 9; |
283 | 279 |
284 friend class JSArrayBasedStruct<FunctionInfoWrapper>; | 280 friend class JSArrayBasedStruct<FunctionInfoWrapper>; |
285 }; | 281 }; |
286 | 282 |
287 | 283 |
288 // Wraps SharedFunctionInfo along with some of its fields for passing it | 284 // Wraps SharedFunctionInfo along with some of its fields for passing it |
289 // back to JavaScript. SharedFunctionInfo object itself is additionally | 285 // back to JavaScript. SharedFunctionInfo object itself is additionally |
290 // wrapped into BlindReference for sanitizing reasons. | 286 // wrapped into BlindReference for sanitizing reasons. |
(...skipping 26 matching lines...) Expand all Loading... |
317 static const int kSharedInfoOffset_ = 3; | 313 static const int kSharedInfoOffset_ = 3; |
318 static const int kSize_ = 4; | 314 static const int kSize_ = 4; |
319 | 315 |
320 friend class JSArrayBasedStruct<SharedInfoWrapper>; | 316 friend class JSArrayBasedStruct<SharedInfoWrapper>; |
321 }; | 317 }; |
322 | 318 |
323 } // namespace internal | 319 } // namespace internal |
324 } // namespace v8 | 320 } // namespace v8 |
325 | 321 |
326 #endif /* V8_DEBUG_LIVEEDIT_H_ */ | 322 #endif /* V8_DEBUG_LIVEEDIT_H_ */ |
OLD | NEW |