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

Unified Diff: src/hydrogen.h

Issue 14174002: Added non observable side effects scope and removed unnecessary calls to AddSimulate. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 8 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/code-stubs-hydrogen.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.h
diff --git a/src/hydrogen.h b/src/hydrogen.h
index eadb28084fa1065b906c47a4c068c996c6ddb744..f4f3752c83002d418e7534d65b349a991f3fb83a 100644
--- a/src/hydrogen.h
+++ b/src/hydrogen.h
@@ -865,7 +865,10 @@ class FunctionState {
class HGraphBuilder {
public:
explicit HGraphBuilder(CompilationInfo* info)
- : info_(info), graph_(NULL), current_block_(NULL) {}
+ : info_(info),
+ graph_(NULL),
+ current_block_(NULL),
+ no_side_effects_scope_count_(0) {}
virtual ~HGraphBuilder() {}
HBasicBlock* current_block() const { return current_block_; }
@@ -891,6 +894,14 @@ class HGraphBuilder {
HReturn* AddReturn(HValue* value);
+ void IncrementInNoSideEffectsScope() {
+ no_side_effects_scope_count_++;
+ }
+
+ void DecrementInNoSideEffectsScope() {
+ no_side_effects_scope_count_--;
+ }
+
protected:
virtual bool BuildGraph() = 0;
@@ -1032,6 +1043,20 @@ class HGraphBuilder {
bool finished_;
};
+ class NoObservableSideEffectsScope {
+ public:
+ explicit NoObservableSideEffectsScope(HGraphBuilder* builder) :
+ builder_(builder) {
+ builder_->IncrementInNoSideEffectsScope();
+ }
+ ~NoObservableSideEffectsScope() {
+ builder_->DecrementInNoSideEffectsScope();
+ }
+
+ private:
+ HGraphBuilder* builder_;
+ };
+
HValue* BuildNewElementsCapacity(HValue* context,
HValue* old_capacity);
@@ -1082,6 +1107,7 @@ class HGraphBuilder {
CompilationInfo* info_;
HGraph* graph_;
HBasicBlock* current_block_;
+ int no_side_effects_scope_count_;
};
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698