diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-04-24 23:36:25 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-04-24 23:36:25 -0700 |
commit | ed78d87f2d9d4d2a7c30c156fb7c6b3094f9be01 (patch) | |
tree | 5e07876b96361b4a7391cf5159092f7a6d29df04 /cpp | |
parent | 5b9a9f0207a0b823c3ab2eb4fa4756d980e70f1a (diff) | |
download | mu-ed78d87f2d9d4d2a7c30c156fb7c6b3094f9be01.tar.gz |
1192
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/.traces/new_concurrent | 10 | ||||
-rw-r--r-- | cpp/042new.cc | 27 |
2 files changed, 18 insertions, 19 deletions
diff --git a/cpp/.traces/new_concurrent b/cpp/.traces/new_concurrent index 2183538d..b3622668 100644 --- a/cpp/.traces/new_concurrent +++ b/cpp/.traces/new_concurrent @@ -2,14 +2,14 @@ parse/0: instruction: 29 parse/0: ingredient: {name: "f2", value: 0, type: 0, properties: ["f2": "recipe"]} parse/0: instruction: 36 parse/0: ingredient: {name: "integer", value: 0, type: 0, properties: ["integer": "type"]} -parse/0: product: {name: "1", value: 0, type: 2-1, properties: ["1": "address":"integer"]} +parse/0: product: {name: "1", value: 0, type: 2-1, properties: ["1": "address":"integer", "raw": ]} parse/0: instruction: 36 parse/0: ingredient: {name: "integer", value: 0, type: 0, properties: ["integer": "type"]} -parse/0: product: {name: "2", value: 0, type: 2-1, properties: ["2": "address":"integer"]} +parse/0: product: {name: "2", value: 0, type: 2-1, properties: ["2": "address":"integer", "raw": ]} parse/0: instruction: 13 -parse/0: ingredient: {name: "1", value: 0, type: 2-1, properties: ["1": "address":"integer"]} -parse/0: ingredient: {name: "2", value: 0, type: 2-1, properties: ["2": "address":"integer"]} -parse/0: product: {name: "3", value: 0, type: 3, properties: ["3": "boolean"]} +parse/0: ingredient: {name: "1", value: 0, type: 2-1, properties: ["1": "address":"integer", "raw": ]} +parse/0: ingredient: {name: "2", value: 0, type: 2-1, properties: ["2": "address":"integer", "raw": ]} +parse/0: product: {name: "3", value: 0, type: 3, properties: ["3": "boolean", "raw": ]} new/0: integer -> 1 new/0: integer -> 1 after-brace/0: recipe f1 diff --git a/cpp/042new.cc b/cpp/042new.cc index 01536689..d63fb1a4 100644 --- a/cpp/042new.cc +++ b/cpp/042new.cc @@ -82,6 +82,19 @@ recipe main [ +run: instruction main/2 +mem: storing 5 in location 3 +//: Make sure that each routine gets a different alloc to start. +:(scenario new_concurrent) +recipe f1 [ + run f2:recipe + 1:address:integer/raw <- new integer:type +] +recipe f2 [ + 2:address:integer/raw <- new integer:type + # hack: assumes scheduler implementation + 3:boolean/raw <- equal 1:address:integer/raw, 2:address:integer/raw +] ++mem: storing 0 in location 3 + //:: Next, extend 'new' to handle a string literal argument. :(scenario new_string) @@ -107,17 +120,3 @@ if (current_instruction().ingredients[0].properties[0].second[0] == "literal-str // mu strings are not null-terminated in memory break; } - -//:: Make sure that each routine gets a different alloc to start. - -:(scenario new_concurrent) -recipe f1 [ - run f2:recipe - 1:address:integer <- new integer:type -] -recipe f2 [ - 2:address:integer <- new integer:type - # hack: assumes scheduler implementation - 3:boolean <- equal 1:address:integer, 2:address:integer -] -+mem: storing 0 in location 3 |