Merge lp:~zorba-coders/zorba/hof-next into lp:zorba

Proposed by Markos Zaharioudakis
Status: Merged
Approved by: Markos Zaharioudakis
Approved revision: 11346
Merged at revision: 11377
Proposed branch: lp:~zorba-coders/zorba/hof-next
Merge into: lp:zorba
Diff against target: 692 lines (+98/-117)
15 files modified
src/compiler/codegen/plan_visitor.cpp (+4/-12)
src/compiler/expression/expr_clone.cpp (+1/-9)
src/compiler/expression/expr_iter.cpp (+3/-4)
src/compiler/expression/expr_manager.cpp (+5/-8)
src/compiler/expression/expr_manager.h (+4/-6)
src/compiler/expression/expr_put.cpp (+1/-7)
src/compiler/expression/function_item_expr.cpp (+2/-8)
src/compiler/expression/function_item_expr.h (+2/-14)
src/compiler/translator/translator.cpp (+62/-15)
src/runtime/hof/dynamic_fncall_iterator.cpp (+4/-9)
src/runtime/hof/dynamic_fncall_iterator.h (+1/-6)
src/runtime/hof/fn_hof_functions_impl.cpp (+1/-1)
src/runtime/hof/function_item.cpp (+3/-7)
src/runtime/hof/function_item.h (+5/-9)
test/fots/CMakeLists.txt (+0/-2)
To merge this branch: bzr merge lp:~zorba-coders/zorba/hof-next
Reviewer Review Type Date Requested Status
Markos Zaharioudakis Approve
Review via email: mp+159229@code.launchpad.net

Commit message

fixes for fn:function-lookup + HOF cleanup

Description of the change

fixes for fn:function-lookup + HOF cleanup

To post a comment you must log in.
Revision history for this message
Markos Zaharioudakis (markos-za) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:~zorba-coders/zorba/hof-next into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:275 (message):
  Validation queue job hof-next-2013-04-16T20-32-12.463Z is finished. The
  final status was:

  No tests were run - build or configure step must have failed.

  Not commiting changes.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job hof-next-2013-04-16T21-13-57.145Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/compiler/codegen/plan_visitor.cpp'
2--- src/compiler/codegen/plan_visitor.cpp 2013-04-10 21:01:35 +0000
3+++ src/compiler/codegen/plan_visitor.cpp 2013-04-16 20:52:26 +0000
4@@ -477,6 +477,8 @@
5 {
6 if (!v.get_is_global_var()[i])
7 fnInfo->theScopedVarsIterators.push_back(pop_itstack());
8+ else if (fnInfo->theScopedVarsValues[i] != NULL)
9+ pop_itstack();
10 }
11
12 std::reverse(fnInfo->theScopedVarsIterators.begin(),
13@@ -558,14 +560,7 @@
14
15 bool isPartialApply = false;
16
17- // the arguments are reversed on the stack
18- if (v.get_dot_var())
19- {
20- PlanIter_t iter = pop_itstack();
21- argIters.push_back(iter);
22- }
23-
24- for (size_t i = 0; i < numArgs-1; ++i)
25+ for (csize i = 0; i < numArgs-1; ++i)
26 {
27 if (v.get_args()[i]->get_expr_kind() == argument_placeholder_expr_kind)
28 isPartialApply = true;
29@@ -577,10 +572,7 @@
30
31 std::reverse(argIters.begin(), argIters.end());
32
33- push_itstack(new DynamicFnCallIterator(sctx, qloc,
34- argIters,
35- v.get_dot_var() ? 1 : 0,
36- isPartialApply));
37+ push_itstack(new DynamicFnCallIterator(sctx, qloc, argIters, isPartialApply));
38 }
39
40
41
42=== modified file 'src/compiler/expression/expr_clone.cpp'
43--- src/compiler/expression/expr_clone.cpp 2013-03-27 09:00:05 +0000
44+++ src/compiler/expression/expr_clone.cpp 2013-04-16 20:52:26 +0000
45@@ -358,19 +358,12 @@
46 newArgs.push_back((*ite)->clone(udf, subst));
47 }
48
49- expr* newDotVar = NULL;
50- if (e->theDotVar)
51- {
52- newDotVar = e->theDotVar->clone(udf, subst);
53- }
54-
55 newExpr = theCCB->theEM->
56 create_dynamic_function_invocation_expr(theSctx,
57 udf,
58 theLoc,
59 e->theExpr->clone(udf, subst),
60- newArgs,
61- newDotVar);
62+ newArgs);
63 break;
64 }
65 case argument_placeholder_expr_kind:
66@@ -389,7 +382,6 @@
67 e->theFunctionItemInfo->theFunction,
68 e->theFunctionItemInfo->theArity,
69 e->is_inline(),
70- e->needs_context_item(),
71 e->is_coercion());
72
73 std::vector<expr*>::const_iterator varIter =
74
75=== modified file 'src/compiler/expression/expr_iter.cpp'
76--- src/compiler/expression/expr_iter.cpp 2013-03-26 21:26:20 +0000
77+++ src/compiler/expression/expr_iter.cpp 2013-04-16 20:52:26 +0000
78@@ -706,10 +706,12 @@
79
80 theArgsIter = fiExpr->theFunctionItemInfo->theScopedVarsValues.begin();
81 theArgsEnd = fiExpr->theFunctionItemInfo->theScopedVarsValues.end();
82+
83 for (; theArgsIter != theArgsEnd; ++theArgsIter)
84 {
85- if ( ! *theArgsIter) // TODO: the vars values for prolog variables is null, so they have to be skipped, or the optimizer will trip and fall off. Maybe null vars values need not be remembered
86+ if ( ! *theArgsIter)
87 continue;
88+
89 EXPR_ITER_NEXT(*theArgsIter);
90 }
91
92@@ -733,9 +735,6 @@
93 EXPR_ITER_NEXT(*theArgsIter);
94 }
95
96- if (dfiExpr->theDotVar)
97- EXPR_ITER_NEXT(dfiExpr->theDotVar);
98-
99 EXPR_ITER_END();
100 return;
101 }
102
103=== modified file 'src/compiler/expression/expr_manager.cpp'
104--- src/compiler/expression/expr_manager.cpp 2013-03-27 09:00:05 +0000
105+++ src/compiler/expression/expr_manager.cpp 2013-04-16 20:52:26 +0000
106@@ -790,11 +790,10 @@
107 user_function* udf,
108 const QueryLoc& loc,
109 expr* anExpr,
110- const std::vector<expr*>& args,
111- expr* dotVar)
112+ const std::vector<expr*>& args)
113 {
114 CREATE_AND_RETURN_EXPR(dynamic_function_invocation_expr, sctx, udf, loc,
115- anExpr, args, dotVar);
116+ anExpr, args);
117 }
118
119
120@@ -813,13 +812,12 @@
121 user_function* udf,
122 const QueryLoc& loc,
123 function* f,
124- uint32_t arity,
125+ csize arity,
126 bool isInline,
127- bool needsContextItem,
128 bool isCoercion)
129 {
130 CREATE_AND_RETURN_EXPR(function_item_expr, sctx, udf, loc,
131- f, arity, isInline, needsContextItem, isCoercion);
132+ f, arity, isInline, isCoercion);
133 }
134
135
136@@ -828,11 +826,10 @@
137 user_function* udf,
138 const QueryLoc& loc,
139 bool isInline,
140- bool needsContextItem,
141 bool isCoercion)
142 {
143 CREATE_AND_RETURN_EXPR(function_item_expr, sctx, udf, loc,
144- isInline, needsContextItem, isCoercion);
145+ isInline, isCoercion);
146 }
147
148
149
150=== modified file 'src/compiler/expression/expr_manager.h'
151--- src/compiler/expression/expr_manager.h 2013-03-27 09:00:05 +0000
152+++ src/compiler/expression/expr_manager.h 2013-04-16 20:52:26 +0000
153@@ -481,21 +481,20 @@
154 user_function* udf,
155 const QueryLoc& loc,
156 expr* anExpr,
157- const std::vector<expr*>& args,
158- expr* dotVar);
159+ const std::vector<expr*>& args);
160
161 argument_placeholder_expr* create_argument_placeholder_expr(
162 static_context* sctx,
163 user_function* udf,
164 const QueryLoc& loc);
165
166- function_item_expr* create_function_item_expr(static_context* sctx,
167+ function_item_expr* create_function_item_expr(
168+ static_context* sctx,
169 user_function* udf,
170 const QueryLoc& loc,
171 function* f,
172- uint32_t arity,
173+ csize arity,
174 bool isInline,
175- bool needsContextItem,
176 bool isCoercion);
177
178 function_item_expr* create_function_item_expr(
179@@ -503,7 +502,6 @@
180 user_function* udf,
181 const QueryLoc& loc,
182 bool isInline,
183- bool needsContextItem,
184 bool isCoercion);
185
186 ftcontains_expr* create_ftcontains_expr(
187
188=== modified file 'src/compiler/expression/expr_put.cpp'
189--- src/compiler/expression/expr_put.cpp 2013-04-15 11:53:46 +0000
190+++ src/compiler/expression/expr_put.cpp 2013-04-16 20:52:26 +0000
191@@ -539,7 +539,7 @@
192 os << " " << theFunctionItemInfo->theQName->getStringValue()
193 << "#" << theFunctionItemInfo->theArity << " [\n";
194
195- for (ulong i = 0; i < theFunctionItemInfo->theScopedVarsValues.size(); i++)
196+ for (csize i = 0; i < theFunctionItemInfo->theScopedVarsValues.size(); ++i)
197 {
198 os << indent << "using $"
199 << theFunctionItemInfo->theScopedVarsNames[i]->getStringValue()
200@@ -570,12 +570,6 @@
201 for (csize i = 0; i < theArgs.size(); ++i)
202 theArgs[i]->put(os);
203
204- if (theDotVar)
205- {
206- os << indent << "using $";
207- theDotVar->put(os);
208- }
209-
210 END_PUT();
211 }
212
213
214=== modified file 'src/compiler/expression/function_item_expr.cpp'
215--- src/compiler/expression/function_item_expr.cpp 2013-04-15 20:40:36 +0000
216+++ src/compiler/expression/function_item_expr.cpp 2013-04-16 20:52:26 +0000
217@@ -40,13 +40,11 @@
218 user_function* udf,
219 const QueryLoc& loc,
220 expr* anExpr,
221- const std::vector<expr*>& args,
222- expr* dotVar)
223+ const std::vector<expr*>& args)
224 :
225 expr(ccb, sctx, udf, loc, dynamic_function_invocation_expr_kind),
226 theExpr(anExpr),
227- theArgs(args),
228- theDotVar(dotVar)
229+ theArgs(args)
230 {
231 assert(anExpr != 0);
232 compute_scripting_kind();
233@@ -92,7 +90,6 @@
234 function* f,
235 csize arity,
236 bool isInline,
237- bool needsContextItem,
238 bool isCoercion)
239 :
240 expr(ccb, sctx, udf, loc, function_item_expr_kind),
241@@ -102,7 +99,6 @@
242 f->getName(),
243 arity,
244 isInline,
245- needsContextItem,
246 isCoercion))
247 {
248 assert(f != NULL);
249@@ -116,7 +112,6 @@
250 user_function* udf,
251 const QueryLoc& loc,
252 bool isInline,
253- bool needsContextItem,
254 bool isCoercion)
255 :
256 expr(ccb, sctx, udf, loc, function_item_expr_kind),
257@@ -126,7 +121,6 @@
258 NULL,
259 0,
260 isInline,
261- needsContextItem,
262 isCoercion))
263 {
264 compute_scripting_kind();
265
266=== modified file 'src/compiler/expression/function_item_expr.h'
267--- src/compiler/expression/function_item_expr.h 2013-04-10 21:01:35 +0000
268+++ src/compiler/expression/function_item_expr.h 2013-04-16 20:52:26 +0000
269@@ -74,8 +74,6 @@
270 --------
271 The arg exprs to pass to the function.
272
273- theDotVars:
274- -----------
275 ********************************************************************************/
276 class dynamic_function_invocation_expr : public expr
277 {
278@@ -86,7 +84,6 @@
279 protected:
280 expr * theExpr;
281 std::vector<expr*> theArgs;
282- expr * theDotVar;
283
284 protected:
285 dynamic_function_invocation_expr(
286@@ -95,16 +92,13 @@
287 user_function* udf,
288 const QueryLoc& loc,
289 expr* anExpr,
290- const std::vector<expr*>& args,
291- expr* dotVar);
292+ const std::vector<expr*>& args);
293
294 public:
295 const expr* get_function() const { return theExpr; }
296
297 const std::vector<expr*>& get_args() const { return theArgs; }
298
299- expr* get_dot_var() const { return theDotVar; }
300-
301 void compute_scripting_kind();
302
303 void accept(expr_visitor&);
304@@ -140,7 +134,6 @@
305 function* f,
306 csize arity,
307 bool isInline,
308- bool needsContextItem,
309 bool isCoercion);
310
311 function_item_expr(
312@@ -149,7 +142,6 @@
313 user_function* udf,
314 const QueryLoc& loc,
315 bool isInline,
316- bool needsContextItem,
317 bool isCoercion);
318
319 virtual ~function_item_expr();
320@@ -184,14 +176,10 @@
321
322 const store::Item_t& get_qname() const { return theFunctionItemInfo->theQName; }
323
324- uint32_t get_arity() const { return theFunctionItemInfo->theArity; }
325+ csize get_arity() const { return theFunctionItemInfo->theArity; }
326
327 bool is_inline() const { return theFunctionItemInfo->theIsInline; }
328
329- bool needs_context_item() const { return theFunctionItemInfo->theNeedsContextItem; }
330-
331- void set_needs_ctx_item(bool v) { theFunctionItemInfo->theNeedsContextItem = v; }
332-
333 bool is_coercion() const { return theFunctionItemInfo->theIsCoercion; }
334
335 void compute_scripting_kind();
336
337=== modified file 'src/compiler/translator/translator.cpp'
338--- src/compiler/translator/translator.cpp 2013-04-16 06:45:24 +0000
339+++ src/compiler/translator/translator.cpp 2013-04-16 20:52:26 +0000
340@@ -1556,7 +1556,7 @@
341 coersionFlwor->add_clause(fiClause);
342
343 function_item_expr* inlineFuncExpr =
344- CREATE(function_item)(theRootSctx, theUDF, loc, true, false, true);
345+ CREATE(function_item)(theRootSctx, theUDF, loc, true, true);
346
347 coersionFlwor->set_return_expr(inlineFuncExpr);
348
349@@ -1598,8 +1598,7 @@
350 loc,
351 CREATE(wrapper)(theRootSctx, theUDF, loc,
352 fiSubstVar),
353- arguments,
354- NULL);
355+ arguments);
356
357 if (returnType->isBuiltinAtomicAny())
358 {
359@@ -11554,8 +11553,7 @@
360 expr* dynamic_fncall =
361 CREATE(dynamic_function_invocation)(theRootSctx, theUDF, loc,
362 arguments[0],
363- fncall_args,
364- NULL);
365+ fncall_args);
366
367 flwor->set_return_expr(dynamic_fncall);
368
369@@ -11584,8 +11582,7 @@
370 expr* dynamic_fncall =
371 CREATE(dynamic_function_invocation)(theRootSctx, theUDF, loc,
372 arguments[0],
373- fncall_args,
374- NULL);
375+ fncall_args);
376
377 expr* if_expr =
378 CREATE(if)(theRootSctx, theUDF, loc,
379@@ -11705,10 +11702,6 @@
380 }
381 }
382
383- expr* dotVar = NULL;
384- if (lookup_var(getDotVarName(), loc, false))
385- dotVar = DOT_REF;
386-
387 // Implementing implicit iteration over the sequence returned by the source expr
388 flwor_expr* flworExpr = wrap_expr_in_flwor(sourceExpr, false);
389
390@@ -11767,8 +11760,7 @@
391 expr* dynFuncInvocation =
392 CREATE(dynamic_function_invocation)(theRootSctx, theUDF, loc,
393 flworVarExpr,
394- arguments,
395- dotVar);
396+ arguments);
397
398 flworExpr->set_return_expr(dynFuncInvocation);
399 }
400@@ -11828,7 +11820,7 @@
401 expr* body;
402
403 function_item_expr* fiExpr =
404- CREATE(function_item)(theRootSctx, theUDF, loc, false, false, false);
405+ CREATE(function_item)(theRootSctx, theUDF, loc, false, false);
406
407 function* f = theSctx->lookup_fn(qnameItem, arity, loc);
408
409@@ -11987,6 +11979,61 @@
410
411 break;
412 }
413+ case FunctionConsts::FN_FUNCTION_LOOKUP_2:
414+ {
415+ expr* ctxItemVRef = NULL;
416+ expr* ctxPosVRef = NULL;
417+ expr* ctxSizeVRef = NULL;
418+
419+ var_expr* ctxItemVar = lookup_var(getDotVarName(), loc, false);
420+ var_expr* ctxPosVar = lookup_var(getDotPosVarName(), loc, false);
421+ var_expr* ctxSizeVar = lookup_var(getLastIdxVarName(), loc, false);
422+
423+ if (ctxItemVar)
424+ ctxItemVRef = DOT_REF;
425+
426+ if (ctxPosVar)
427+ ctxPosVRef = DOT_POS_REF;
428+
429+ if (ctxSizeVar)
430+ ctxSizeVRef = DOT_SIZE_REF;
431+
432+ push_scope();
433+
434+ var_expr* substItemVar = bind_var(loc, getDotVarName(), var_expr::hof_var);
435+ var_expr* substPosVar = bind_var(loc, getDotPosVarName(), var_expr::hof_var);
436+ var_expr* substSizeVar = bind_var(loc, getLastIdxVarName(), var_expr::hof_var);
437+
438+ if (ctxItemVar)
439+ substItemVar->set_unique_id(ctxItemVar->get_unique_id());
440+
441+ if (ctxPosVar)
442+ substPosVar->set_unique_id(ctxPosVar->get_unique_id());
443+
444+ if (ctxSizeVar)
445+ substSizeVar->set_unique_id(ctxSizeVar->get_unique_id());
446+
447+ fiExpr->add_variable(ctxItemVRef,
448+ substItemVar,
449+ substItemVar->get_name(),
450+ ctxItemVar->get_kind() == var_expr::prolog_var ? 1 : 0);
451+
452+ fiExpr->add_variable(ctxPosVRef,
453+ substPosVar,
454+ substPosVar->get_name(),
455+ ctxPosVar->get_kind() == var_expr::prolog_var ? 1 : 0);
456+
457+ fiExpr->add_variable(ctxSizeVRef,
458+ substSizeVar,
459+ substSizeVar->get_name(),
460+ ctxSizeVar->get_kind() == var_expr::prolog_var ? 1 : 0);
461+
462+ body = generate_fn_body(f, foArgs, loc);
463+
464+ pop_scope();
465+
466+ break;
467+ }
468 default:
469 {
470 body = generate_fn_body(f, foArgs, loc);
471@@ -12031,7 +12078,7 @@
472 push_scope();
473
474 function_item_expr* fiExpr =
475- CREATE(function_item)(theRootSctx, theUDF, loc, true, false, false);
476+ CREATE(function_item)(theRootSctx, theUDF, loc, true, false);
477
478 push_nodestack(fiExpr);
479
480
481=== modified file 'src/runtime/hof/dynamic_fncall_iterator.cpp'
482--- src/runtime/hof/dynamic_fncall_iterator.cpp 2013-03-27 05:06:29 +0000
483+++ src/runtime/hof/dynamic_fncall_iterator.cpp 2013-04-16 20:52:26 +0000
484@@ -102,7 +102,6 @@
485 serialize_baseclass(ar,
486 (NaryBaseIterator<DynamicFnCallIterator, DynamicFnCallIteratorState>*)this);
487
488- ar & theDotVarsCount;
489 ar & theIsPartialApply;
490 }
491
492@@ -212,11 +211,7 @@
493
494 fnItem = static_cast<FunctionItem*>(targetItem.getp());
495
496- if ((!fnItem->needsContextItem() &&
497- theChildren.size() - 1 - theDotVarsCount != fnItem->getArity())
498- ||
499- (fnItem->needsContextItem()
500- && theChildren.size() - 1 != fnItem->getArity()))
501+ if (theChildren.size() - 1 != fnItem->getArity())
502 {
503 RAISE_ERROR(err::XPTY0004, loc,
504 ERROR_PARAMS("dynamic function invoked with incorrect number of arguments"));
505@@ -224,7 +219,7 @@
506
507 if (theIsPartialApply)
508 {
509- for (csize i = 1, pos = 0; i < theChildren.size() - theDotVarsCount; ++i)
510+ for (csize i = 1, pos = 0; i < theChildren.size(); ++i)
511 {
512 if (dynamic_cast<ArgumentPlaceholderIterator*>(theChildren[i].getp()) == NULL)
513 {
514@@ -276,11 +271,11 @@
515 #ifdef ZORBA_WITH_JSON
516 else if (targetItem->isJSONObject() || targetItem->isJSONArray())
517 {
518- if (theChildren.size() - theDotVarsCount > 2)
519+ if (theChildren.size() > 2)
520 {
521 RAISE_ERROR_NO_PARAMS(jerr::JNTY0018, loc);
522 }
523- else if (theChildren.size() - theDotVarsCount == 2)
524+ else if (theChildren.size() == 2)
525 {
526 isObjectNav = targetItem->isJSONObject();
527 selectorError = false;
528
529=== modified file 'src/runtime/hof/dynamic_fncall_iterator.h'
530--- src/runtime/hof/dynamic_fncall_iterator.h 2013-03-26 23:32:03 +0000
531+++ src/runtime/hof/dynamic_fncall_iterator.h 2013-04-16 20:52:26 +0000
532@@ -90,10 +90,7 @@
533 DynamicFnCallIteratorState>
534 {
535 protected:
536- // This variable counts the number of children that hold DOT variables. They
537- // are placed at the end of the children array.
538- unsigned int theDotVarsCount;
539- bool theIsPartialApply;
540+ bool theIsPartialApply;
541
542 public:
543 SERIALIZABLE_CLASS(DynamicFnCallIterator);
544@@ -108,12 +105,10 @@
545 static_context* sctx,
546 const QueryLoc& loc,
547 std::vector<PlanIter_t>& args,
548- unsigned int dotVarsCount,
549 bool isPartialApply,
550 xqtref_t coercionTargetType = NULL)
551 :
552 NaryBaseIterator<DynamicFnCallIterator, DynamicFnCallIteratorState>(sctx, loc, args),
553- theDotVarsCount(dotVarsCount),
554 theIsPartialApply(isPartialApply)
555 {
556 }
557
558=== modified file 'src/runtime/hof/fn_hof_functions_impl.cpp'
559--- src/runtime/hof/fn_hof_functions_impl.cpp 2013-04-16 09:21:11 +0000
560+++ src/runtime/hof/fn_hof_functions_impl.cpp 2013-04-16 20:52:26 +0000
561@@ -108,7 +108,7 @@
562 try
563 {
564 static_context_t impSctx = theSctx->create_child_context();
565- ccb->theSctxMap[ccb->theSctxMap.size()] = impSctx;
566+ ccb->theSctxMap[ccb->theSctxMap.size() + 1] = impSctx;
567
568 std::auto_ptr<dynamic_context> fiDctx;
569 fiDctx.reset(new dynamic_context(planState.theGlobalDynCtx));
570
571=== modified file 'src/runtime/hof/function_item.cpp'
572--- src/runtime/hof/function_item.cpp 2013-04-15 11:53:46 +0000
573+++ src/runtime/hof/function_item.cpp 2013-04-16 20:52:26 +0000
574@@ -56,9 +56,8 @@
575 const QueryLoc& loc,
576 function* func,
577 store::Item_t qname,
578- uint32_t arity,
579+ csize arity,
580 bool isInline,
581- bool needsContextItem,
582 bool isCoercion)
583 :
584 theLoc(loc),
585@@ -67,7 +66,6 @@
586 theQName(qname),
587 theArity(arity),
588 theIsInline(isInline),
589- theNeedsContextItem(needsContextItem),
590 theIsCoercion(isCoercion)
591 {
592 #if 0
593@@ -122,7 +120,6 @@
594 ar & theQName;
595 ar & theArity;
596 ar & theIsInline;
597- ar & theNeedsContextItem;
598 ar & theIsCoercion;
599
600 // These are not serialized
601@@ -219,13 +216,13 @@
602 }
603
604
605-uint32_t FunctionItem::getArity() const
606+csize FunctionItem::getArity() const
607 {
608 return theArity;
609 }
610
611
612-uint32_t FunctionItem::getStartArity() const
613+csize FunctionItem::getStartArity() const
614 {
615 return theFunctionItemInfo->theArity;
616 }
617@@ -302,7 +299,6 @@
618 NULL,
619 theFunctionItemInfo->theLoc,
620 false,
621- false,
622 false);
623
624 PlanIter_t udfCallIterator = theFunctionItemInfo->theFunction->
625
626=== modified file 'src/runtime/hof/function_item.h'
627--- src/runtime/hof/function_item.h 2013-04-15 20:40:36 +0000
628+++ src/runtime/hof/function_item.h 2013-04-16 20:52:26 +0000
629@@ -112,9 +112,8 @@
630 static_context* theClosureSctx;
631 function_t theFunction;
632 store::Item_t theQName;
633- unsigned int theArity;
634+ csize theArity;
635 bool theIsInline;
636- bool theNeedsContextItem;
637 bool theIsCoercion;
638
639 std::vector<expr*> theScopedVarsValues;
640@@ -138,9 +137,8 @@
641 const QueryLoc& loc,
642 function* func,
643 store::Item_t qname,
644- uint32_t arity,
645+ csize arity,
646 bool isInline,
647- bool needsContextItem,
648 bool isCoercion);
649
650 virtual ~FunctionItemInfo();
651@@ -166,7 +164,7 @@
652 protected:
653 FunctionItemInfo_t theFunctionItemInfo;
654
655- unsigned int theArity; // The arity of the function
656+ csize theArity; // The arity of the function
657 // item will decrease when a
658 // partial application is used.
659
660@@ -213,17 +211,15 @@
661
662 const store::Item_t getFunctionName() const;
663
664- unsigned int getArity() const;
665+ csize getArity() const;
666
667 // returns the arity of the function before any partial application
668- unsigned int getStartArity() const;
669+ csize getStartArity() const;
670
671 const signature& getSignature() const;
672
673 bool isInline() const { return theFunctionItemInfo->theIsInline; }
674
675- bool needsContextItem() const { return theFunctionItemInfo->theNeedsContextItem; }
676-
677 bool isCoercion() const { return theFunctionItemInfo->theIsCoercion; }
678
679 zstring show() const;
680
681=== modified file 'test/fots/CMakeLists.txt'
682--- test/fots/CMakeLists.txt 2013-04-16 08:36:32 +0000
683+++ test/fots/CMakeLists.txt 2013-04-16 20:52:26 +0000
684@@ -484,8 +484,6 @@
685 EXPECTED_FOTS_FAILURE (fn-map-pairs fn-map-pairs-026 0)
686 EXPECTED_FOTS_FAILURE (misc-HigherOrderFunctions hof-036 0)
687 EXPECTED_FOTS_FAILURE (misc-HigherOrderFunctions xqhof12 0)
688-EXPECTED_FOTS_FAILURE (misc-HigherOrderFunctions xqhof18 0)
689-EXPECTED_FOTS_FAILURE (misc-HigherOrderFunctions xqhof19 0)
690 EXPECTED_FOTS_FAILURE (prod-NamedFunctionRef function-literal-062 0)
691 EXPECTED_FOTS_FAILURE (prod-NamedFunctionRef function-literal-494 0)
692 EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature require-higher-order-function-5-s 0)

Subscribers

People subscribed via source and target branches