MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / sv_makeLocalRefMove

Method sv_makeLocalRefMove

src/ast/ast_simulate.cpp:415–443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

413 }
414
415 SimNode * SimulateVisitor::sv_makeLocalRefMove (const LineInfo & at, uint32_t stackTop, uint32_t offset, ExpressionPtr rE ) {
416 const auto & rightType = *rE->type;
417 // now, call with CMRES
418 if ( rE->rtti_isCall() ) {
419 auto cll = static_cast<ExprCall*>(rE);
420 if ( cll->allowCmresSkip() ) {
421 auto right = getE(rE);
422 getCallBase(right)->cmresEval = context.code->makeNode<SimNode_GetLocalRefOff>(rE->at, stackTop, offset);
423 return right;
424 }
425 }
426 // now, invoke with CMRES
427 if ( rE->rtti_isInvoke() ) {
428 auto cll = static_cast<ExprInvoke*>(rE);
429 if ( cll->allowCmresSkip() ) {
430 auto right = getE(rE);
431 getCallBase(right)->cmresEval = context.code->makeNode<SimNode_GetLocalRefOff>(rE->at, stackTop, offset);
432 return right;
433 }
434 }
435 // now, to the regular move
436 auto left = context.code->makeNode<SimNode_GetLocalRefOff>(at, stackTop, offset);
437 auto right = getE(rE);
438 if ( rightType.isRef() ) {
439 return context.code->makeNode<SimNode_MoveRefValue>(at, left, right, rightType.getSizeOf());
440 } else {
441 return context.code->makeValueNode<SimNode_Set>(rightType.getR2VType(), at, left, right);
442 }
443 }
444
445 SimNode * SimulateVisitor::sv_makeLocalRefCopy(const LineInfo & at, uint32_t stackTop, uint32_t offset, ExpressionPtr rE ) {
446 const auto & rightType = *rE->type;

Callers

nothing calls this directly

Calls 4

getCallBaseFunction · 0.85
isRefMethod · 0.80
getR2VTypeMethod · 0.80
getSizeOfMethod · 0.45

Tested by

no test coverage detected