# HG changeset patch # User Shinji KONO # Date 1478730790 -32400 # Node ID d529c024e5a506f7e2c0ba3577ee1adf59b89995 # Parent 34a7a21edc362f32d8a55118074f1c95011383ef name fixes diff -r 34a7a21edc36 -r d529c024e5a5 src/parallel_execution/context.c --- a/src/parallel_execution/context.c Wed Nov 09 22:33:16 2016 +0900 +++ b/src/parallel_execution/context.c Thu Nov 10 07:33:10 2016 +0900 @@ -23,12 +23,12 @@ extern __code colorFlip_stub(struct Context*); extern __code fixUp_stub(struct Context*); extern __code changeReference_stub(struct Context*); -extern __code insert1_stub(struct Context*); -extern __code insert2_stub(struct Context*); -extern __code insert3_stub(struct Context*); -extern __code insert4_stub(struct Context*); -extern __code insert5_stub(struct Context*); -extern __code insert51_stub(struct Context*); +extern __code insertCase1_stub(struct Context*); +extern __code insertCase2_stub(struct Context*); +extern __code insertCase3_stub(struct Context*); +extern __code insertCase4_stub(struct Context*); +extern __code insertCase5_stub(struct Context*); +extern __code insertCase51_stub(struct Context*); extern __code stackClear_stub(struct Context*); extern __code get_stub(struct Context*); extern __code search_stub(struct Context*); @@ -76,39 +76,32 @@ context->codeNum = Exit; - context->code[Code1] = code1_stub; - context->code[Code2] = code2_stub; - /* context->code[Code3] = code3_stub; */ - /* context->code[Code4] = code4; */ - /* context->code[Code5] = code5; */ - /* context->code[Find] = find; */ - /* context->code[Not_find] = not_find; */ - /* context->code[Code6] = code6; */ - context->code[PutTree] = put_stub; - context->code[Replace] = replaceNode_stub; - context->code[Replace1] = replaceNode1_stub; - context->code[Insert] = insertNode_stub; - context->code[RotateL] = rotateLeft_stub; - context->code[RotateL1] = rotateLeft1_stub; - context->code[RotateR] = rotateRight_stub; - context->code[RotateR1] = rotateRight1_stub; - context->code[InsertCase1] = insert1_stub; - context->code[InsertCase2] = insert2_stub; - context->code[InsertCase3] = insert3_stub; - context->code[InsertCase4] = insert4_stub; - context->code[InsertCase5] = insert5_stub; - context->code[InsertCase51] = insert51_stub; - context->code[StackClear] = stackClear_stub; - context->code[Get] = get_stub; - context->code[Search] = search_stub; + context->code[C_code1] = code1_stub; + context->code[C_code2] = code2_stub; + context->code[C_put] = put_stub; + context->code[C_replaceNode] = replaceNode_stub; + context->code[C_replaceNode1] = replaceNode1_stub; + context->code[C_insertNode] = insertNode_stub; + context->code[C_rotateLeft] = rotateLeft_stub; + context->code[C_rotateLeft1] = rotateLeft1_stub; + context->code[C_rotateRight] = rotateRight_stub; + context->code[C_rotateRight1] = rotateRight1_stub; + context->code[C_insertCase1] = insertCase1_stub; + context->code[C_insertCase2] = insertCase2_stub; + context->code[C_insertCase3] = insertCase3_stub; + context->code[C_insertCase4] = insertCase4_stub; + context->code[C_insertCase5] = insertCase5_stub; + context->code[C_insertCase51] = insertCase51_stub; + context->code[C_stackClear] = stackClear_stub; + context->code[C_get] = get_stub; + context->code[C_search] = search_stub; - context->code[Search] = search_stub; - context->code[ PushSingleLinkedStack] = pushSingleLinkedStack_stub; - context->code[ PopSingleLinkedStack] = popSingleLinkedStack_stub; - context->code[ Pop2SingleLinkedStack] = pop2SingleLinkedStack_stub; - context->code[ GetSingleLinkedStack] = getSingleLinkedStack_stub; - context->code[ Get2SingleLinkedStack] = get2SingleLinkedStack_stub; - context->code[ IsEmptySingleLinkedStack] = isEmptySingleLinkedStack_stub; + context->code[C_pushSingleLinkedStack] = pushSingleLinkedStack_stub; + context->code[C_popSingleLinkedStack] = popSingleLinkedStack_stub; + context->code[C_pop2SingleLinkedStack] = pop2SingleLinkedStack_stub; + context->code[C_getSingleLinkedStack] = getSingleLinkedStack_stub; + context->code[C_get2SingleLinkedStack] = get2SingleLinkedStack_stub; + context->code[C_isEmptySingleLinkedStack] = isEmptySingleLinkedStack_stub; /* context->code[Delete] = delete_stub; */ /* context->code[Delete1] = delete1_stub; */ @@ -137,8 +130,6 @@ context->code[PutQueue3] = putQueue3_stub; context->code[PutQueue4] = putQueue4_stub; context->code[GetQueue] = getQueue_stub; - context->code[PushSingleLinkedStack] = pushSingleLinkedStack_stub; - context->code[PopSingleLinkedStack] = popSingleLinkedStack_stub; context->code[SpawnTask] = spawnTask_stub; context->code[Twice] = twice_stub; context->code[StartTime] = start_time_stub; diff -r 34a7a21edc36 -r d529c024e5a5 src/parallel_execution/context.h --- a/src/parallel_execution/context.h Wed Nov 09 22:33:16 2016 +0900 +++ b/src/parallel_execution/context.h Thu Nov 10 07:33:10 2016 +0900 @@ -35,34 +35,34 @@ meta->type; }) enum Code { - Code1, - Code2, - Code3, - Code4, - Code5, - Find, + C_code1, + C_code2, + C_code3, + C_code4, + C_code5, + C_find, Not_find, Code6, Allocator, - PutTree, - Replace, - Replace1, - Insert, + C_put, + C_replaceNode, + C_replaceNode1, + C_insertNode, Compare, - RotateL, - RotateL1, - RotateR, - RotateR1, + C_rotateLeft, + C_rotateLeft1, + C_rotateRight, + C_rotateRight1, SetTree, - InsertCase1, - InsertCase2, - InsertCase3, - InsertCase4, - InsertCase5, - InsertCase51, - StackClear, - Get, - Search, + C_insertCase1, + C_insertCase2, + C_insertCase3, + C_insertCase4, + C_insertCase5, + C_insertCase51, + C_stackClear, + C_get, + C_search, Delete, Delete1, Delete2, @@ -90,12 +90,12 @@ PutQueue3, PutQueue4, GetQueue, - PushSingleLinkedStack, - PopSingleLinkedStack, - Pop2SingleLinkedStack, - GetSingleLinkedStack, - Get2SingleLinkedStack, - IsEmptySingleLinkedStack, + C_pushSingleLinkedStack, + C_popSingleLinkedStack, + C_pop2SingleLinkedStack, + C_getSingleLinkedStack, + C_get2SingleLinkedStack, + C_isEmptySingleLinkedStack, SpawnTask, Twice, StartTime, diff -r 34a7a21edc36 -r d529c024e5a5 src/parallel_execution/main.c --- a/src/parallel_execution/main.c Wed Nov 09 22:33:16 2016 +0900 +++ b/src/parallel_execution/main.c Thu Nov 10 07:33:10 2016 +0900 @@ -56,7 +56,7 @@ //printf("%d\n", array->array[i]); if (array->array[i] == (i*2)) { loopCounter->i++; - goto meta(context, Code2); + goto meta(context, C_code2); } else puts("wrong result"); @@ -80,7 +80,7 @@ } loopCounter->i = 0; - goto meta(context, Code1); + goto meta(context, C_code1); } __code createData1_stub(struct Context* context) { @@ -99,7 +99,7 @@ context->next = CreateTask1; - goto meta(context, PutTree); + goto meta(context, C_put); } __code createData2_stub(struct Context* context) { @@ -321,7 +321,7 @@ loopCounter->i = 0; struct Time *t = &context->data[Time]->time; - t->next = Code2; + t->next = C_code2; goto meta(context, EndTime); } diff -r 34a7a21edc36 -r d529c024e5a5 src/parallel_execution/rb_tree.c --- a/src/parallel_execution/rb_tree.c Wed Nov 09 22:33:16 2016 +0900 +++ b/src/parallel_execution/rb_tree.c Thu Nov 10 07:33:10 2016 +0900 @@ -31,10 +31,10 @@ if (root) { traverse->current = root; traverse->result = compare(traverse->current, node); - goto meta(context, Replace); + goto meta(context, C_replaceNode); } - goto meta(context, Insert); + goto meta(context, C_insertNode); } __code put_stub(struct Context* context) { @@ -54,7 +54,7 @@ *newNode = *oldNode; nodeStack->stack = (union Data*)traverse->nodeStack; nodeStack->data = (union Data*)(newNode); - nodeStack->next = Replace1; + nodeStack->next = C_replaceNode1; goto meta(context, traverse->nodeStack->push); } @@ -81,9 +81,9 @@ traverse->newNode = newnewNode; if (traverse->current) { traverse->result = compare(traverse->current, node); - goto meta(context, Replace); + goto meta(context, C_replaceNode); } - goto meta(context, Insert); + goto meta(context, C_insertNode); } @@ -103,7 +103,7 @@ newNode->color = Red; traverse->current = newNode; nodeStack->stack = (union Data*)traverse->nodeStack; - nodeStack->next = InsertCase1; + nodeStack->next = C_insertCase1; goto meta(context, traverse->nodeStack->get2); } @@ -119,13 +119,13 @@ if (parent != NULL) { traverse->parent = parent; traverse->grandparent = grandparent; - goto meta(context,InsertCase2); + goto meta(context,C_insertCase2); } tree->root->color = Black; - goto meta(context, StackClear); + goto meta(context, C_stackClear); } -__code insert1_stub(struct Context* context) { +__code insertCase1_stub(struct Context* context) { goto insertCase1(context, &context->data[Traverse]->traverse, &context->data[Tree]->tree, @@ -135,12 +135,12 @@ __code insertCase2(struct Context* context, struct Traverse* traverse) { if (traverse->parent->color == Black) { - goto meta(context, StackClear); + goto meta(context, C_stackClear); } - goto meta(context,InsertCase3); + goto meta(context,C_insertCase3); } -__code insert2_stub(struct Context* context) { +__code insertCase2_stub(struct Context* context) { goto insertCase2(context, &context->data[Traverse]->traverse); } @@ -159,13 +159,13 @@ traverse->grandparent->color = Red; traverse->current = traverse->grandparent; nodeStack->stack = (union Data*)traverse->nodeStack; - nodeStack->next = InsertCase1; + nodeStack->next = C_insertCase1; goto meta(context, traverse->nodeStack->pop2); } - goto meta(context, InsertCase4); + goto meta(context, C_insertCase4); } -__code insert3_stub(struct Context* context) { +__code insertCase3_stub(struct Context* context) { goto insertCase3(context, &context->data[Traverse]->traverse, &context->data[Stack]->stack ); @@ -176,34 +176,34 @@ if ((traverse->current == traverse->parent->right) && (traverse->parent == traverse->grandparent->left)) { traverse->current = traverse->current->left; - traverse->rotateNext = InsertCase5; + traverse->rotateNext = C_insertCase5; traverse->parent = traverse->grandparent; nodeStack->stack = (union Data*)traverse->nodeStack; - nodeStack->next = RotateL; + nodeStack->next = C_rotateLeft; goto meta(context, nodeStack->pop); } else if ((traverse->current == traverse->parent->left) && (traverse->parent == traverse->grandparent->right)) { traverse->current = traverse->current->right; - traverse->rotateNext = InsertCase5; + traverse->rotateNext = C_insertCase5; traverse->parent = traverse->grandparent; nodeStack->stack = (union Data*)traverse->nodeStack; - nodeStack->next = RotateR; + nodeStack->next = C_rotateRight; goto meta(context, nodeStack->pop); } - goto meta(context, InsertCase5); + goto meta(context, C_insertCase5); } -__code insert4_stub(struct Context* context) { +__code insertCase4_stub(struct Context* context) { goto insertCase4(context, &context->data[Traverse]->traverse); } __code insertCase5(struct Context* context, struct Traverse* traverse,struct Stack *nodeStack) { nodeStack->stack = (union Data*)traverse->nodeStack; - nodeStack->next = InsertCase51; + nodeStack->next = C_insertCase51; goto meta(context, traverse->nodeStack->pop2); } -__code insert5_stub(struct Context* context) { +__code insertCase5_stub(struct Context* context) { goto insertCase5(context, &context->data[Traverse]->traverse, &context->data[Stack]->stack); } @@ -215,23 +215,22 @@ grandparent->color = Red; traverse->current = grandparent; - traverse->rotateNext = StackClear; + traverse->rotateNext = C_stackClear; if ((current == parent->left) && (parent == grandparent->left)) - goto meta(context, RotateR); + goto meta(context, C_rotateRight); else - goto meta(context, RotateL); + goto meta(context, C_rotateLeft); } -__code insert51_stub(struct Context* context) { +__code insertCase51_stub(struct Context* context) { struct Node* parent = &context->data[Stack]->stack.data->node; struct Node* grandparent = &context->data[Stack]->stack.data1->node; goto insertCase51(context, &context->data[Traverse]->traverse, context->data[Traverse]->traverse.current, parent, grandparent); } -// put rotateLeft's continuation as argument __code rotateLeft(struct Context* context, struct Traverse* traverse,struct Stack* nodeStack) { nodeStack->stack = (union Data*)traverse->nodeStack; - nodeStack->next = RotateL1; + nodeStack->next = C_rotateLeft1; goto meta(context, traverse->nodeStack->get); } @@ -269,7 +268,7 @@ __code rotateRight(struct Context* context, struct Traverse* traverse,struct Stack *nodeStack) { nodeStack->stack = (union Data*)traverse->nodeStack; - nodeStack->next = RotateR1; + nodeStack->next = C_rotateRight1; goto meta(context, traverse->nodeStack->get); } @@ -322,7 +321,7 @@ if (tree->root) { traverse->current = tree->root; - goto meta(context, Search); + goto meta(context, C_search); } goto meta(context, traverse->next); @@ -346,7 +345,7 @@ } if (traverse->current) - goto meta(context, Search); + goto meta(context, C_search); goto meta(context, traverse->next); } diff -r 34a7a21edc36 -r d529c024e5a5 src/parallel_execution/stack.c --- a/src/parallel_execution/stack.c Wed Nov 09 22:33:16 2016 +0900 +++ b/src/parallel_execution/stack.c Thu Nov 10 07:33:10 2016 +0900 @@ -8,12 +8,12 @@ struct SingleLinkedStack* singleLinkedStack = &ALLOCATE(context, SingleLinkedStack)->singleLinkedStack; stack->stack = (union Data*)singleLinkedStack; singleLinkedStack->top = NULL; - stack->push = PushSingleLinkedStack; - stack->pop = PopSingleLinkedStack; - stack->pop2 = Pop2SingleLinkedStack; - stack->get = GetSingleLinkedStack; - stack->get2 = Get2SingleLinkedStack; - stack->isEmpty = IsEmptySingleLinkedStack; + stack->push = C_pushSingleLinkedStack; + stack->pop = C_popSingleLinkedStack; + stack->pop2 = C_pop2SingleLinkedStack; + stack->get = C_getSingleLinkedStack; + stack->get2 = C_get2SingleLinkedStack; + stack->isEmpty = C_isEmptySingleLinkedStack; return (union Data*)(stack); } diff -r 34a7a21edc36 -r d529c024e5a5 src/parallel_execution/worker.c --- a/src/parallel_execution/worker.c Wed Nov 09 22:33:16 2016 +0900 +++ b/src/parallel_execution/worker.c Thu Nov 10 07:33:10 2016 +0900 @@ -16,7 +16,7 @@ struct Traverse *t = &context->data[Traverse]->traverse; t->next = ((struct Task *)(first->data))->code; - goto meta(context, Get); + goto meta(context, C_get); } else { goto meta(context, GetQueue); }