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

Unified Diff: src/jump-target.cc

Issue 42008: Introduce a BreakTarget subclass of JumpTarget used to represent the... (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/jump-target.h ('k') | src/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/jump-target.cc
===================================================================
--- src/jump-target.cc (revision 1472)
+++ src/jump-target.cc (working copy)
@@ -37,38 +37,16 @@
JumpTarget::JumpTarget(CodeGenerator* cgen, Directionality direction)
: cgen_(cgen),
+ masm_(cgen == NULL ? NULL : cgen->masm()),
direction_(direction),
reaching_frames_(0),
merge_labels_(0),
entry_frame_(NULL),
is_bound_(false),
is_linked_(false) {
- ASSERT(cgen_ != NULL);
- masm_ = cgen_->masm();
}
-JumpTarget::JumpTarget()
- : cgen_(NULL),
- masm_(NULL),
- direction_(FORWARD_ONLY),
- reaching_frames_(0),
- merge_labels_(0),
- entry_frame_(NULL),
- is_bound_(false),
- is_linked_(false) {
-}
-
-
-void JumpTarget::Initialize(CodeGenerator* cgen, Directionality direction) {
- ASSERT(cgen != NULL);
- ASSERT(cgen_ == NULL);
- cgen_ = cgen;
- masm_ = cgen->masm();
- direction_ = direction;
-}
-
-
void JumpTarget::Unuse() {
ASSERT(!is_linked());
entry_label_.Unuse();
@@ -512,7 +490,31 @@
}
-void JumpTarget::CopyTo(JumpTarget* destination) {
+void JumpTarget::AddReachingFrame(VirtualFrame* frame) {
+ ASSERT(reaching_frames_.length() == merge_labels_.length());
+ Label fresh;
+ merge_labels_.Add(fresh);
+ reaching_frames_.Add(frame);
+}
+
+
+// -------------------------------------------------------------------------
+// BreakTarget implementation.
+
+BreakTarget::BreakTarget() : JumpTarget(NULL, FORWARD_ONLY) {
+}
+
+
+void BreakTarget::Initialize(CodeGenerator* cgen, Directionality direction) {
+ ASSERT(cgen != NULL);
+ ASSERT(cgen_ == NULL);
+ cgen_ = cgen;
+ masm_ = cgen->masm();
+ direction_ = direction;
+}
+
+
+void BreakTarget::CopyTo(BreakTarget* destination) {
ASSERT(destination != NULL);
destination->cgen_ = cgen_;
destination->masm_ = masm_;
@@ -531,18 +533,10 @@
}
-void JumpTarget::AddReachingFrame(VirtualFrame* frame) {
- ASSERT(reaching_frames_.length() == merge_labels_.length());
- Label fresh;
- merge_labels_.Add(fresh);
- reaching_frames_.Add(frame);
-}
-
-
// -------------------------------------------------------------------------
// ShadowTarget implementation.
-ShadowTarget::ShadowTarget(JumpTarget* shadowed) {
+ShadowTarget::ShadowTarget(BreakTarget* shadowed) {
ASSERT(shadowed != NULL);
other_target_ = shadowed;
@@ -574,7 +568,7 @@
// The states of this target, which was shadowed, and the original
// target, which was shadowing, are swapped.
- JumpTarget temp;
+ BreakTarget temp;
other_target_->CopyTo(&temp);
CopyTo(other_target_);
temp.CopyTo(this);
« no previous file with comments | « src/jump-target.h ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698