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

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

Issue 53005: Add pointers to a VirtualFrame that keep track of the indexes of register... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 9 months 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/virtual-frame-arm.h ('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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 int stack_pointer_; 330 int stack_pointer_;
331 331
332 // The index of the element that is at the processor's frame pointer 332 // The index of the element that is at the processor's frame pointer
333 // (the ebp register). 333 // (the ebp register).
334 int frame_pointer_; 334 int frame_pointer_;
335 335
336 // The frame has an embedded register file that it uses to track registers 336 // The frame has an embedded register file that it uses to track registers
337 // used in the frame. 337 // used in the frame.
338 RegisterFile frame_registers_; 338 RegisterFile frame_registers_;
339 339
340 // The index of the register frame element using each register, or
341 // kIllegalIndex if a register is not on the frame.
342 int register_locations_[kNumRegisters];
343
340 // The index of the first parameter. The receiver lies below the first 344 // The index of the first parameter. The receiver lies below the first
341 // parameter. 345 // parameter.
342 int param0_index() const { return 1; } 346 int param0_index() const { return 1; }
343 347
344 // The index of the context slot in the frame. 348 // The index of the context slot in the frame.
345 int context_index() const { 349 int context_index() const {
346 ASSERT(frame_pointer_ != kIllegalIndex); 350 ASSERT(frame_pointer_ != kIllegalIndex);
347 return frame_pointer_ + 1; 351 return frame_pointer_ + 1;
348 } 352 }
349 353
(...skipping 15 matching lines...) Expand all
365 // The index of the base of the expression stack. 369 // The index of the base of the expression stack.
366 int expression_base_index() const { return local0_index() + local_count_; } 370 int expression_base_index() const { return local0_index() + local_count_; }
367 371
368 // Convert a frame index into a frame pointer relative offset into the 372 // Convert a frame index into a frame pointer relative offset into the
369 // actual stack. 373 // actual stack.
370 int fp_relative(int index) const { 374 int fp_relative(int index) const {
371 return (frame_pointer_ - index) * kPointerSize; 375 return (frame_pointer_ - index) * kPointerSize;
372 } 376 }
373 377
374 // Record an occurrence of a register in the virtual frame. This has the 378 // Record an occurrence of a register in the virtual frame. This has the
375 // effect of incrementing both the register's frame-internal reference 379 // effect of incrementing the register's external reference count and
376 // count and its external reference count. 380 // of updating the index of the register's location in the frame.
377 void Use(Register reg); 381 void Use(Register reg, int index);
378 382
379 // Record that a register reference has been dropped from the frame. This 383 // Record that a register reference has been dropped from the frame. This
380 // decrements both the register's internal and external reference counts. 384 // decrements the register's external reference count and invalidates the
385 // index of the register's location in the frame.
381 void Unuse(Register reg); 386 void Unuse(Register reg);
382 387
383 // Spill the element at a particular index---write it to memory if 388 // Spill the element at a particular index---write it to memory if
384 // necessary, free any associated register, and forget its value if 389 // necessary, free any associated register, and forget its value if
385 // constant. 390 // constant.
386 void SpillElementAt(int index); 391 void SpillElementAt(int index);
387 392
388 // Sync the element at a particular index. If it is a register or 393 // Sync the element at a particular index. If it is a register or
389 // constant that disagrees with the value on the stack, write it to memory. 394 // constant that disagrees with the value on the stack, write it to memory.
390 // Keep the element type as register or constant, and clear the dirty bit. 395 // Keep the element type as register or constant, and clear the dirty bit.
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 Result RawCallCodeObject(Handle<Code> code, RelocInfo::Mode rmode); 456 Result RawCallCodeObject(Handle<Code> code, RelocInfo::Mode rmode);
452 457
453 bool Equals(VirtualFrame* other); 458 bool Equals(VirtualFrame* other);
454 459
455 friend class JumpTarget; 460 friend class JumpTarget;
456 }; 461 };
457 462
458 } } // namespace v8::internal 463 } } // namespace v8::internal
459 464
460 #endif // V8_VIRTUAL_FRAME_IA32_H_ 465 #endif // V8_VIRTUAL_FRAME_IA32_H_
OLDNEW
« no previous file with comments | « src/virtual-frame-arm.h ('k') | src/virtual-frame-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698