| 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_LIVEEDIT_H_ | 5 #ifndef V8_LIVEEDIT_H_ |
| 6 #define V8_LIVEEDIT_H_ | 6 #define V8_LIVEEDIT_H_ |
| 7 | 7 |
| 8 | 8 |
| 9 | 9 |
| 10 // Live Edit feature implementation. | 10 // Live Edit feature implementation. |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 public: | 211 public: |
| 212 explicit FunctionInfoWrapper(Handle<JSArray> array) | 212 explicit FunctionInfoWrapper(Handle<JSArray> array) |
| 213 : JSArrayBasedStruct<FunctionInfoWrapper>(array) { | 213 : JSArrayBasedStruct<FunctionInfoWrapper>(array) { |
| 214 } | 214 } |
| 215 | 215 |
| 216 void SetInitialProperties(Handle<String> name, | 216 void SetInitialProperties(Handle<String> name, |
| 217 int start_position, | 217 int start_position, |
| 218 int end_position, | 218 int end_position, |
| 219 int param_num, | 219 int param_num, |
| 220 int literal_count, | 220 int literal_count, |
| 221 int slot_count, |
| 221 int parent_index); | 222 int parent_index); |
| 222 | 223 |
| 223 void SetFunctionCode(Handle<Code> function_code, | 224 void SetFunctionCode(Handle<Code> function_code, |
| 224 Handle<HeapObject> code_scope_info); | 225 Handle<HeapObject> code_scope_info); |
| 225 | 226 |
| 226 void SetFunctionScopeInfo(Handle<Object> scope_info_array) { | 227 void SetFunctionScopeInfo(Handle<Object> scope_info_array) { |
| 227 this->SetField(kFunctionScopeInfoOffset_, scope_info_array); | 228 this->SetField(kFunctionScopeInfoOffset_, scope_info_array); |
| 228 } | 229 } |
| 229 | 230 |
| 230 void SetSharedFunctionInfo(Handle<SharedFunctionInfo> info); | 231 void SetSharedFunctionInfo(Handle<SharedFunctionInfo> info); |
| 231 | 232 |
| 232 int GetLiteralCount() { | 233 int GetLiteralCount() { |
| 233 return this->GetSmiValueField(kLiteralNumOffset_); | 234 return this->GetSmiValueField(kLiteralNumOffset_); |
| 234 } | 235 } |
| 235 | 236 |
| 236 int GetParentIndex() { | 237 int GetParentIndex() { |
| 237 return this->GetSmiValueField(kParentIndexOffset_); | 238 return this->GetSmiValueField(kParentIndexOffset_); |
| 238 } | 239 } |
| 239 | 240 |
| 240 Handle<Code> GetFunctionCode(); | 241 Handle<Code> GetFunctionCode(); |
| 241 | 242 |
| 243 Handle<FixedArray> GetFeedbackVector(); |
| 244 |
| 242 Handle<Object> GetCodeScopeInfo(); | 245 Handle<Object> GetCodeScopeInfo(); |
| 243 | 246 |
| 244 int GetStartPosition() { | 247 int GetStartPosition() { |
| 245 return this->GetSmiValueField(kStartPositionOffset_); | 248 return this->GetSmiValueField(kStartPositionOffset_); |
| 246 } | 249 } |
| 247 | 250 |
| 248 int GetEndPosition() { return this->GetSmiValueField(kEndPositionOffset_); } | 251 int GetEndPosition() { return this->GetSmiValueField(kEndPositionOffset_); } |
| 249 | 252 |
| 253 int GetSlotCount() { |
| 254 return this->GetSmiValueField(kSlotNumOffset_); |
| 255 } |
| 256 |
| 250 private: | 257 private: |
| 251 static const int kFunctionNameOffset_ = 0; | 258 static const int kFunctionNameOffset_ = 0; |
| 252 static const int kStartPositionOffset_ = 1; | 259 static const int kStartPositionOffset_ = 1; |
| 253 static const int kEndPositionOffset_ = 2; | 260 static const int kEndPositionOffset_ = 2; |
| 254 static const int kParamNumOffset_ = 3; | 261 static const int kParamNumOffset_ = 3; |
| 255 static const int kCodeOffset_ = 4; | 262 static const int kCodeOffset_ = 4; |
| 256 static const int kCodeScopeInfoOffset_ = 5; | 263 static const int kCodeScopeInfoOffset_ = 5; |
| 257 static const int kFunctionScopeInfoOffset_ = 6; | 264 static const int kFunctionScopeInfoOffset_ = 6; |
| 258 static const int kParentIndexOffset_ = 7; | 265 static const int kParentIndexOffset_ = 7; |
| 259 static const int kSharedFunctionInfoOffset_ = 8; | 266 static const int kSharedFunctionInfoOffset_ = 8; |
| 260 static const int kLiteralNumOffset_ = 9; | 267 static const int kLiteralNumOffset_ = 9; |
| 261 static const int kSize_ = 10; | 268 static const int kSlotNumOffset_ = 10; |
| 269 static const int kSize_ = 11; |
| 262 | 270 |
| 263 friend class JSArrayBasedStruct<FunctionInfoWrapper>; | 271 friend class JSArrayBasedStruct<FunctionInfoWrapper>; |
| 264 }; | 272 }; |
| 265 | 273 |
| 266 | 274 |
| 267 // Wraps SharedFunctionInfo along with some of its fields for passing it | 275 // Wraps SharedFunctionInfo along with some of its fields for passing it |
| 268 // back to JavaScript. SharedFunctionInfo object itself is additionally | 276 // back to JavaScript. SharedFunctionInfo object itself is additionally |
| 269 // wrapped into BlindReference for sanitizing reasons. | 277 // wrapped into BlindReference for sanitizing reasons. |
| 270 class SharedInfoWrapper : public JSArrayBasedStruct<SharedInfoWrapper> { | 278 class SharedInfoWrapper : public JSArrayBasedStruct<SharedInfoWrapper> { |
| 271 public: | 279 public: |
| (...skipping 20 matching lines...) Expand all Loading... |
| 292 static const int kEndPositionOffset_ = 2; | 300 static const int kEndPositionOffset_ = 2; |
| 293 static const int kSharedInfoOffset_ = 3; | 301 static const int kSharedInfoOffset_ = 3; |
| 294 static const int kSize_ = 4; | 302 static const int kSize_ = 4; |
| 295 | 303 |
| 296 friend class JSArrayBasedStruct<SharedInfoWrapper>; | 304 friend class JSArrayBasedStruct<SharedInfoWrapper>; |
| 297 }; | 305 }; |
| 298 | 306 |
| 299 } } // namespace v8::internal | 307 } } // namespace v8::internal |
| 300 | 308 |
| 301 #endif /* V*_LIVEEDIT_H_ */ | 309 #endif /* V*_LIVEEDIT_H_ */ |
| OLD | NEW |