From: Peizhao Ou Date: Sun, 23 Mar 2014 19:55:29 +0000 (-0700) Subject: save X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=004befc8de014334c63162d2a58a75bfba50e274;p=cdsspec-compiler.git save --- diff --git a/benchmark/cliffc-hashtable/cliffc_hashtable.h b/benchmark/cliffc-hashtable/cliffc_hashtable.h index 23ba7ae..ff5d9c3 100644 --- a/benchmark/cliffc-hashtable/cliffc_hashtable.h +++ b/benchmark/cliffc-hashtable/cliffc_hashtable.h @@ -796,7 +796,7 @@ friend class CHM; if (++reprobe_cnt >= reprobe_limit(len) || K == TOMBSTONE) { // Found a Tombstone key, no more keys newkvs = chm->resize(topmap, kvs); - model_print("resize1\n"); + //model_print("resize1\n"); // Help along an existing copy if (expVal != NULL) topmap->help_copy(newkvs); return putIfMatch(topmap, newkvs, key_slot, val_slot, expVal); @@ -812,7 +812,7 @@ friend class CHM; newkvs = chm->_newkvs.load(memory_order_acquire); if (newkvs == NULL && ((V == NULL && chm->table_full(reprobe_cnt, len)) || is_prime(V))) { - model_print("resize2\n"); + //model_print("resize2\n"); newkvs = chm->resize(topmap, kvs); // Force the copy to start } diff --git a/benchmark/cliffc-hashtable/main.cc b/benchmark/cliffc-hashtable/main.cc index 8f2221e..9e6365b 100644 --- a/benchmark/cliffc-hashtable/main.cc +++ b/benchmark/cliffc-hashtable/main.cc @@ -58,12 +58,13 @@ void threadA(void *arg) { table->put(k1, v1); //table->put(k2, v2); //table->put(k3, v3); - + /* val1 = table->get(k3); if (val1 != NULL) model_print("val1: %d\n", val1->_val); else model_print("val1: NULL\n"); + */ //table->put(k3, v3); } @@ -72,7 +73,7 @@ void threadB(void *arg) { } void threadMain(void *arg) { - table->put(k3, v3); + //table->put(k3, v3); val2 = table->get(k1); if (val2 != NULL) model_print("val2: %d\n", val1->_val); diff --git a/src/edu/uci/eecs/specCompiler/codeGenerator/CodeGenerator.java b/src/edu/uci/eecs/specCompiler/codeGenerator/CodeGenerator.java index 640ddd1..ba28579 100644 --- a/src/edu/uci/eecs/specCompiler/codeGenerator/CodeGenerator.java +++ b/src/edu/uci/eecs/specCompiler/codeGenerator/CodeGenerator.java @@ -306,10 +306,10 @@ public class CodeGenerator { new File(homeDir + "/benchmark/mpmc-queue/mpmc-queue.h"), new File(homeDir + "/benchmark/mpmc-queue/mpmc-queue.cc") }; -// File[][] sources = { srcLinuxRWLocks, srcMSQueue, srcRCU, -// srcDeque, srcMCSLock, srcSPSCQueue, srcMPMCQueue, srcHashtable }; + File[][] sources = { srcLinuxRWLocks, srcMSQueue, srcRCU, + srcDeque, srcMCSLock, srcSPSCQueue, srcMPMCQueue, srcHashtable }; - File[][] sources = { srcHashtable, srcMPMCQueue }; +// File[][] sources = { srcHashtable, srcMPMCQueue }; // Compile all the benchmarks for (int i = 0; i < sources.length; i++) { CodeGenerator gen = new CodeGenerator(sources[i]); diff --git a/src/edu/uci/eecs/specCompiler/codeGenerator/ProgramUnit.java b/src/edu/uci/eecs/specCompiler/codeGenerator/ProgramUnit.java new file mode 100644 index 0000000..f9307e8 --- /dev/null +++ b/src/edu/uci/eecs/specCompiler/codeGenerator/ProgramUnit.java @@ -0,0 +1,30 @@ +package edu.uci.eecs.specCompiler.codeGenerator; + +import java.io.File; +import java.util.HashMap; +import java.util.ArrayList; + +/** + *

+ * This class represents the structured code before and after compilation. + *

+ * @author peizhaoo + * + */ +public class ProgramUnit { + private File[] files; + + private HashMap> newCode; + + public ProgramUnit(File[] files) { + this.files = files; + } + + public void compileSpec() { + + } + + public void writeToFile() { + + } +}