Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(502)

Side by Side Diff: src/virtual-frame-ia32.h

Issue 11023: Begin using the virtual frame for variable proxies and slots. Loading... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
Patch Set: '' Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/codegen-ia32.cc ('k') | src/virtual-frame-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 return Operand(esp, index * kPointerSize); 258 return Operand(esp, index * kPointerSize);
259 } 259 }
260 260
261 // A frame-allocated local as an assembly operand. 261 // A frame-allocated local as an assembly operand.
262 Operand LocalAt(int index) const { 262 Operand LocalAt(int index) const {
263 ASSERT(0 <= index); 263 ASSERT(0 <= index);
264 ASSERT(index < local_count_); 264 ASSERT(index < local_count_);
265 return Operand(ebp, kLocal0Offset - index * kPointerSize); 265 return Operand(ebp, kLocal0Offset - index * kPointerSize);
266 } 266 }
267 267
268 // Push a copy of the value of a local frame slot on top of the frame.
269 void LoadLocalAt(int index) {
270 LoadFrameSlotAt(local0_index() + index);
271 }
272
268 // Store the top value on the virtual frame into a local frame slot. The 273 // Store the top value on the virtual frame into a local frame slot. The
269 // value is left in place on top of the frame. 274 // value is left in place on top of the frame.
270 void StoreToLocalAt(int index) { 275 void StoreToLocalAt(int index) {
271 StoreToFrameSlotAt(local0_index() + index); 276 StoreToFrameSlotAt(local0_index() + index);
272 } 277 }
273 278
274 // The function frame slot. 279 // The function frame slot.
275 Operand Function() const { return Operand(ebp, kFunctionOffset); } 280 Operand Function() const { return Operand(ebp, kFunctionOffset); }
276 281
277 // The context frame slot. 282 // The context frame slot.
278 Operand Context() const { return Operand(ebp, kContextOffset); } 283 Operand Context() const { return Operand(ebp, kContextOffset); }
279 284
280 // A parameter as an assembly operand. 285 // A parameter as an assembly operand.
281 Operand ParameterAt(int index) const { 286 Operand ParameterAt(int index) const {
282 ASSERT(-1 <= index); // -1 is the receiver. 287 ASSERT(-1 <= index); // -1 is the receiver.
283 ASSERT(index < parameter_count_); 288 ASSERT(index < parameter_count_);
284 return Operand(ebp, (1 + parameter_count_ - index) * kPointerSize); 289 return Operand(ebp, (1 + parameter_count_ - index) * kPointerSize);
285 } 290 }
286 291
292 // Push a copy of the value of a parameter frame slot on top of the frame.
293 void LoadParameterAt(int index) {
294 LoadFrameSlotAt(param0_index() + index);
295 }
296
287 // Store the top value on the virtual frame into a parameter frame slot. 297 // Store the top value on the virtual frame into a parameter frame slot.
288 // The value is left in place on top of the frame. 298 // The value is left in place on top of the frame.
289 void StoreToParameterAt(int index) { 299 void StoreToParameterAt(int index) {
290 StoreToFrameSlotAt(param0_index() + index); 300 StoreToFrameSlotAt(param0_index() + index);
291 } 301 }
292 302
293 // The receiver frame slot. 303 // The receiver frame slot.
294 Operand Receiver() const { return ParameterAt(-1); } 304 Operand Receiver() const { return ParameterAt(-1); }
295 305
296 // Push a try-catch or try-finally handler on top of the virtual frame. 306 // Push a try-catch or try-finally handler on top of the virtual frame.
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 void Unuse(Register reg); 432 void Unuse(Register reg);
423 433
424 // Sync the element at a particular index---write it to memory if 434 // Sync the element at a particular index---write it to memory if
425 // necessary, but do not free any associated register or forget its value 435 // necessary, but do not free any associated register or forget its value
426 // if constant. Space should have already been allocated in the actual 436 // if constant. Space should have already been allocated in the actual
427 // frame for all the elements below this one (at least). 437 // frame for all the elements below this one (at least).
428 void SyncElementAt(int index); 438 void SyncElementAt(int index);
429 439
430 // Spill the element at a particular index---write it to memory if 440 // Spill the element at a particular index---write it to memory if
431 // necessary, free any associated register, and forget its value if 441 // necessary, free any associated register, and forget its value if
432 // constant. Space should have already been allocated in the actual frame 442 // constant.
433 // for all the elements below this one (at least).
434 void SpillElementAt(int index); 443 void SpillElementAt(int index);
435 444
445 // Spill the element at an index without modifying its reference count (if
446 // it was in a register).
447 void RawSpillElementAt(int index);
448
436 // Sync the range of elements in [begin, end). 449 // Sync the range of elements in [begin, end).
437 void SyncRange(int begin, int end); 450 void SyncRange(int begin, int end);
438 451
452 // Push a copy of a frame slot (typically a local or parameter) on top of
453 // the frame.
454 void LoadFrameSlotAt(int index);
455
439 // Store the value on top of the frame to a frame slot (typically a local 456 // Store the value on top of the frame to a frame slot (typically a local
440 // or parameter). 457 // or parameter).
441 void StoreToFrameSlotAt(int index); 458 void StoreToFrameSlotAt(int index);
442 459
443 // Spill the topmost elements of the frame to memory (eg, they are the 460 // Spill the topmost elements of the frame to memory (eg, they are the
444 // arguments to a call) and all registers. 461 // arguments to a call) and all registers.
445 void PrepareForCall(int count); 462 void PrepareForCall(int count);
446 }; 463 };
447 464
448 465
449 } } // namespace v8::internal 466 } } // namespace v8::internal
450 467
451 #endif // V8_VIRTUAL_FRAME_IA32_H_ 468 #endif // V8_VIRTUAL_FRAME_IA32_H_
OLDNEW
« no previous file with comments | « src/codegen-ia32.cc ('k') | src/virtual-frame-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698