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

Unified Diff: src/hydrogen.h

Issue 23726041: Turn the NumberToStringStub into a hydrogen stub. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Using IfBuilder with JoinContinuation Created 7 years, 3 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
Index: src/hydrogen.h
diff --git a/src/hydrogen.h b/src/hydrogen.h
index b27701c4af5513d619156c44926ef2b170ec33eb..060e28276150d4afedad4d4d7a0bd680c2f0ab14 100644
--- a/src/hydrogen.h
+++ b/src/hydrogen.h
@@ -941,7 +941,12 @@ class FunctionState V8_FINAL {
class HIfContinuation V8_FINAL {
public:
- HIfContinuation() { continuation_captured_ = false; }
+ HIfContinuation() : continuation_captured_(false) {}
+ HIfContinuation(HBasicBlock* true_branch,
+ HBasicBlock* false_branch,
+ int position = RelocInfo::kNoPosition)
+ : continuation_captured_(true), true_branch_(true_branch),
+ false_branch_(false_branch), position_(position) {}
~HIfContinuation() { ASSERT(!continuation_captured_); }
void Capture(HBasicBlock* true_branch,
@@ -970,6 +975,10 @@ class HIfContinuation V8_FINAL {
return IsTrueReachable() || IsFalseReachable();
}
+ HBasicBlock* true_branch() const { return true_branch_; }
+ HBasicBlock* false_branch() const { return false_branch_; }
+
+ private:
bool continuation_captured_;
HBasicBlock* true_branch_;
HBasicBlock* false_branch_;
@@ -1228,6 +1237,15 @@ class HGraphBuilder {
ElementsKind to_kind,
bool is_jsarray);
+ // Do lookup in the number string cache. If the object is not found
+ // in the cache, the false branch of the continuation is taken;
+ // otherwise the true branch is taken and the returned value contains
+ // the cache value for the object. The returned value must NOT be used
+ // on the false branch.
+ HValue* BuildLookupNumberStringCache(HValue* object,
+ HIfContinuation* continuation);
+ HValue* BuildNumberToString(HValue* number);
+
HInstruction* BuildUncheckedMonomorphicElementAccess(
HValue* checked_object,
HValue* key,
@@ -1374,8 +1392,17 @@ class HGraphBuilder {
void Or();
void And();
+ // Captures the current state of this IfBuilder in the specified
+ // continuation and ends this IfBuilder.
void CaptureContinuation(HIfContinuation* continuation);
+ // Joins the specified continuation from this IfBuilder and ends this
+ // IfBuilder. This appends a Goto instruction from the true branch of
+ // this IfBuilder to the true branch of the continuation unless the
+ // true branch of this IfBuilder is already finished. And vice versa
+ // for the false branch.
+ void JoinContinuation(HIfContinuation* continuation);
+
void Then();
void Else();
void End();

Powered by Google App Engine
This is Rietveld 408576698