From 6e793202e3dd9a89b88ab291cebbcb788337c592 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 3 May 2016 17:38:33 -0700 Subject: 2898 - start filling in missing refcounts This commit covers instructions 'put', 'put-index' and 'maybe-convert'. Next up are the harder ones: 'copy' and 'merge'. In these cases there's a non-scalar being copied, and we need to figure out which locations within it need to update their refcount. --- 030container.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to '030container.cc') diff --git a/030container.cc b/030container.cc index 071cc461..8018cb91 100644 --- a/030container.cc +++ b/030container.cc @@ -425,12 +425,11 @@ case PUT: { type_ordinal base_type = base.type->value; int offset = ingredients.at(1).at(0); if (offset < 0 || offset >= SIZE(get(Type, base_type).elements)) break; // copied from Check above - int address = base_address; - for (int i = 0; i < offset; ++i) - address += size_of(element_type(base.type, i)); + int address = base_address + base.metadata.offset.at(offset); trace(9998, "run") << "address to copy to is " << address << end(); // optimization: directly write the element rather than updating 'product' // and writing the entire container + // Write Memory in PUT in Run for (int i = 0; i < SIZE(ingredients.at(2)); ++i) { trace(9999, "mem") << "storing " << no_scientific(ingredients.at(2).at(i)) << " in location " << address+i << end(); put(Memory, address+i, ingredients.at(2).at(i)); -- cgit 1.4.1-2-gfad0