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

Unified Diff: src/assembler.h

Issue 8961: Merge change list off bleeding_edge into toiger branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
Patch Set: Created 12 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/ast.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/assembler.h
===================================================================
--- src/assembler.h (revision 668)
+++ src/assembler.h (working copy)
@@ -48,7 +48,7 @@
// unknown pc location. Assembler::bind() is used to bind a label to the
// current pc. A label can be bound only once.
-class Label : public ZoneObject { // LabelShadows are dynamically allocated.
+class Label BASE_EMBEDDED {
public:
INLINE(Label()) { Unuse(); }
INLINE(~Label()) { ASSERT(!is_linked()); }
@@ -83,57 +83,10 @@
friend class Assembler;
friend class Displacement;
- friend class LabelShadow;
+ friend class ShadowTarget;
};
-// A LabelShadow represents a label that is temporarily shadowed by another
-// label (represented by the original label during shadowing). They are used
-// to catch jumps to labels in certain contexts, e.g. try blocks. After
-// shadowing ends, the formerly shadowed label is again represented by the
-// original label and the LabelShadow can be used as a label in its own
-// right, representing the formerly shadowing label.
-class LabelShadow : public Label {
- public:
- explicit LabelShadow(Label* original) {
- ASSERT(original != NULL);
- original_label_ = original;
- original_pos_ = original->pos_;
- original->Unuse();
-#ifdef DEBUG
- is_shadowing_ = true;
-#endif
- }
-
- ~LabelShadow() {
- ASSERT(!is_shadowing_);
- }
-
- void StopShadowing() {
- ASSERT(is_shadowing_ && is_unused());
- pos_ = original_label_->pos_;
- original_label_->pos_ = original_pos_;
-#ifdef DEBUG
- is_shadowing_ = false;
-#endif
- }
-
- Label* original_label() const { return original_label_; }
-
- private:
- // During shadowing, the currently shadowing label. After shadowing, the
- // label that was shadowed.
- Label* original_label_;
-
- // During shadowing, the saved state of the original label.
- int original_pos_;
-
-#ifdef DEBUG
- bool is_shadowing_;
-#endif
-};
-
-
// -----------------------------------------------------------------------------
// Relocation information
« no previous file with comments | « no previous file | src/ast.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698