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

Unified Diff: src/hydrogen.cc

Issue 19562003: Add support for IncrementCounter in Hydrogen. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add ExternalMemory portion Created 7 years, 5 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.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 853c0c0aafd321cb8b7163403a09cd5daeedda04..f93acc8ce50593b3376d10761f092be368f27119 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -986,6 +986,18 @@ HInstruction* HGraphBuilder::AddInstruction(HInstruction* instr) {
}
+void HGraphBuilder::AddIncrementCounter(StatsCounter* counter,
+ HValue* context) {
+ if (FLAG_native_code_counters && counter->Enabled()) {
+ HValue* reference = Add<HConstant>(ExternalReference(counter));
+ HValue* old_value = AddLoad(reference, HObjectAccess::ForCounter(), NULL);
+ HValue* new_value = AddInstruction(
+ HAdd::New(zone(), context, old_value, graph()->GetConstant1()));
+ AddStore(reference, HObjectAccess::ForCounter(), new_value);
+ }
+}
+
+
HBasicBlock* HGraphBuilder::CreateBasicBlock(HEnvironment* env) {
HBasicBlock* b = graph()->CreateBasicBlock();
b->SetInitialEnvironment(env);
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-instructions.h » ('j') | src/hydrogen-instructions.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698