308 } 309 // If there are default notes floating around, capture them: 310 Node_Notes* nn = C->default_node_notes(); 311 if (nn != NULL) init_node_notes(C, idx, nn); 312 313 // Note: At this point, C is dead, 314 // and we begin to initialize the new Node. 315 316 _cnt = _max = req; 317 _outcnt = _outmax = 0; 318 _class_id = Class_Node; 319 _flags = 0; 320 _out = NO_OUT_ARRAY; 321 return idx; 322 } 323 324 //------------------------------Node------------------------------------------- 325 // Create a Node, with a given number of required edges. 326 Node::Node(uint req) 327 : _idx(IDX_INIT(req)) 328 { 329 assert( req < Compile::current()->max_node_limit() - NodeLimitFudgeFactor, "Input limit exceeded" ); 330 debug_only( verify_construction() ); 331 NOT_PRODUCT(nodes_created++); 332 if (req == 0) { 333 assert( _in == (Node**)this, "Must not pass arg count to 'new'" ); 334 _in = NULL; 335 } else { 336 assert( _in[req-1] == this, "Must pass arg count to 'new'" ); 337 Node** to = _in; 338 for(uint i = 0; i < req; i++) { 339 to[i] = NULL; 340 } 341 } 342 } 343 344 //------------------------------Node------------------------------------------- 345 Node::Node(Node *n0) 346 : _idx(IDX_INIT(1)) 347 { 348 debug_only( verify_construction() ); 349 NOT_PRODUCT(nodes_created++); 350 // Assert we allocated space for input array already 351 assert( _in[0] == this, "Must pass arg count to 'new'" ); 352 assert( is_not_dead(n0), "can not use dead node"); 353 _in[0] = n0; if (n0 != NULL) n0->add_out((Node *)this); 354 } 355 356 //------------------------------Node------------------------------------------- 357 Node::Node(Node *n0, Node *n1) 358 : _idx(IDX_INIT(2)) 359 { 360 debug_only( verify_construction() ); 361 NOT_PRODUCT(nodes_created++); 362 // Assert we allocated space for input array already 363 assert( _in[1] == this, "Must pass arg count to 'new'" ); 364 assert( is_not_dead(n0), "can not use dead node"); 365 assert( is_not_dead(n1), "can not use dead node"); 366 _in[0] = n0; if (n0 != NULL) n0->add_out((Node *)this); 367 _in[1] = n1; if (n1 != NULL) n1->add_out((Node *)this); 368 } 369 370 //------------------------------Node------------------------------------------- 371 Node::Node(Node *n0, Node *n1, Node *n2) 372 : _idx(IDX_INIT(3)) 373 { 374 debug_only( verify_construction() ); 375 NOT_PRODUCT(nodes_created++); 376 // Assert we allocated space for input array already 377 assert( _in[2] == this, "Must pass arg count to 'new'" ); 378 assert( is_not_dead(n0), "can not use dead node"); 379 assert( is_not_dead(n1), "can not use dead node"); 380 assert( is_not_dead(n2), "can not use dead node"); 381 _in[0] = n0; if (n0 != NULL) n0->add_out((Node *)this); 382 _in[1] = n1; if (n1 != NULL) n1->add_out((Node *)this); 383 _in[2] = n2; if (n2 != NULL) n2->add_out((Node *)this); 384 } 385 386 //------------------------------Node------------------------------------------- 387 Node::Node(Node *n0, Node *n1, Node *n2, Node *n3) 388 : _idx(IDX_INIT(4)) 389 { 390 debug_only( verify_construction() ); 391 NOT_PRODUCT(nodes_created++); 392 // Assert we allocated space for input array already 393 assert( _in[3] == this, "Must pass arg count to 'new'" ); 394 assert( is_not_dead(n0), "can not use dead node"); 395 assert( is_not_dead(n1), "can not use dead node"); 396 assert( is_not_dead(n2), "can not use dead node"); 397 assert( is_not_dead(n3), "can not use dead node"); 398 _in[0] = n0; if (n0 != NULL) n0->add_out((Node *)this); 399 _in[1] = n1; if (n1 != NULL) n1->add_out((Node *)this); 400 _in[2] = n2; if (n2 != NULL) n2->add_out((Node *)this); 401 _in[3] = n3; if (n3 != NULL) n3->add_out((Node *)this); 402 } 403 404 //------------------------------Node------------------------------------------- 405 Node::Node(Node *n0, Node *n1, Node *n2, Node *n3, Node *n4) 406 : _idx(IDX_INIT(5)) 407 { 408 debug_only( verify_construction() ); 409 NOT_PRODUCT(nodes_created++); 410 // Assert we allocated space for input array already 411 assert( _in[4] == this, "Must pass arg count to 'new'" ); 412 assert( is_not_dead(n0), "can not use dead node"); 413 assert( is_not_dead(n1), "can not use dead node"); 414 assert( is_not_dead(n2), "can not use dead node"); 415 assert( is_not_dead(n3), "can not use dead node"); 416 assert( is_not_dead(n4), "can not use dead node"); 417 _in[0] = n0; if (n0 != NULL) n0->add_out((Node *)this); 418 _in[1] = n1; if (n1 != NULL) n1->add_out((Node *)this); 419 _in[2] = n2; if (n2 != NULL) n2->add_out((Node *)this); 420 _in[3] = n3; if (n3 != NULL) n3->add_out((Node *)this); 421 _in[4] = n4; if (n4 != NULL) n4->add_out((Node *)this); 422 } 423 424 //------------------------------Node------------------------------------------- 425 Node::Node(Node *n0, Node *n1, Node *n2, Node *n3, 426 Node *n4, Node *n5) 427 : _idx(IDX_INIT(6)) 428 { 429 debug_only( verify_construction() ); 430 NOT_PRODUCT(nodes_created++); 431 // Assert we allocated space for input array already 432 assert( _in[5] == this, "Must pass arg count to 'new'" ); 433 assert( is_not_dead(n0), "can not use dead node"); 434 assert( is_not_dead(n1), "can not use dead node"); 435 assert( is_not_dead(n2), "can not use dead node"); 436 assert( is_not_dead(n3), "can not use dead node"); 437 assert( is_not_dead(n4), "can not use dead node"); 438 assert( is_not_dead(n5), "can not use dead node"); 439 _in[0] = n0; if (n0 != NULL) n0->add_out((Node *)this); 440 _in[1] = n1; if (n1 != NULL) n1->add_out((Node *)this); 441 _in[2] = n2; if (n2 != NULL) n2->add_out((Node *)this); 442 _in[3] = n3; if (n3 != NULL) n3->add_out((Node *)this); 443 _in[4] = n4; if (n4 != NULL) n4->add_out((Node *)this); 444 _in[5] = n5; if (n5 != NULL) n5->add_out((Node *)this); 445 } 446 447 //------------------------------Node------------------------------------------- 448 Node::Node(Node *n0, Node *n1, Node *n2, Node *n3, 449 Node *n4, Node *n5, Node *n6) 450 : _idx(IDX_INIT(7)) 451 { 452 debug_only( verify_construction() ); 453 NOT_PRODUCT(nodes_created++); 454 // Assert we allocated space for input array already 455 assert( _in[6] == this, "Must pass arg count to 'new'" ); 456 assert( is_not_dead(n0), "can not use dead node"); 457 assert( is_not_dead(n1), "can not use dead node"); 458 assert( is_not_dead(n2), "can not use dead node"); 459 assert( is_not_dead(n3), "can not use dead node"); 460 assert( is_not_dead(n4), "can not use dead node"); 461 assert( is_not_dead(n5), "can not use dead node"); 462 assert( is_not_dead(n6), "can not use dead node"); 463 _in[0] = n0; if (n0 != NULL) n0->add_out((Node *)this); 464 _in[1] = n1; if (n1 != NULL) n1->add_out((Node *)this); 465 _in[2] = n2; if (n2 != NULL) n2->add_out((Node *)this); 466 _in[3] = n3; if (n3 != NULL) n3->add_out((Node *)this); 467 _in[4] = n4; if (n4 != NULL) n4->add_out((Node *)this); 468 _in[5] = n5; if (n5 != NULL) n5->add_out((Node *)this); 469 _in[6] = n6; if (n6 != NULL) n6->add_out((Node *)this); 470 } | 308 } 309 // If there are default notes floating around, capture them: 310 Node_Notes* nn = C->default_node_notes(); 311 if (nn != NULL) init_node_notes(C, idx, nn); 312 313 // Note: At this point, C is dead, 314 // and we begin to initialize the new Node. 315 316 _cnt = _max = req; 317 _outcnt = _outmax = 0; 318 _class_id = Class_Node; 319 _flags = 0; 320 _out = NO_OUT_ARRAY; 321 return idx; 322 } 323 324 //------------------------------Node------------------------------------------- 325 // Create a Node, with a given number of required edges. 326 Node::Node(uint req) 327 : _idx(IDX_INIT(req)) 328 #ifdef ASSERT 329 , _parse_idx(_idx) 330 #endif 331 { 332 assert( req < Compile::current()->max_node_limit() - NodeLimitFudgeFactor, "Input limit exceeded" ); 333 debug_only( verify_construction() ); 334 NOT_PRODUCT(nodes_created++); 335 if (req == 0) { 336 assert( _in == (Node**)this, "Must not pass arg count to 'new'" ); 337 _in = NULL; 338 } else { 339 assert( _in[req-1] == this, "Must pass arg count to 'new'" ); 340 Node** to = _in; 341 for(uint i = 0; i < req; i++) { 342 to[i] = NULL; 343 } 344 } 345 } 346 347 //------------------------------Node------------------------------------------- 348 Node::Node(Node *n0) 349 : _idx(IDX_INIT(1)) 350 #ifdef ASSERT 351 , _parse_idx(_idx) 352 #endif 353 { 354 debug_only( verify_construction() ); 355 NOT_PRODUCT(nodes_created++); 356 // Assert we allocated space for input array already 357 assert( _in[0] == this, "Must pass arg count to 'new'" ); 358 assert( is_not_dead(n0), "can not use dead node"); 359 _in[0] = n0; if (n0 != NULL) n0->add_out((Node *)this); 360 } 361 362 //------------------------------Node------------------------------------------- 363 Node::Node(Node *n0, Node *n1) 364 : _idx(IDX_INIT(2)) 365 #ifdef ASSERT 366 , _parse_idx(_idx) 367 #endif 368 { 369 debug_only( verify_construction() ); 370 NOT_PRODUCT(nodes_created++); 371 // Assert we allocated space for input array already 372 assert( _in[1] == this, "Must pass arg count to 'new'" ); 373 assert( is_not_dead(n0), "can not use dead node"); 374 assert( is_not_dead(n1), "can not use dead node"); 375 _in[0] = n0; if (n0 != NULL) n0->add_out((Node *)this); 376 _in[1] = n1; if (n1 != NULL) n1->add_out((Node *)this); 377 } 378 379 //------------------------------Node------------------------------------------- 380 Node::Node(Node *n0, Node *n1, Node *n2) 381 : _idx(IDX_INIT(3)) 382 #ifdef ASSERT 383 , _parse_idx(_idx) 384 #endif 385 { 386 debug_only( verify_construction() ); 387 NOT_PRODUCT(nodes_created++); 388 // Assert we allocated space for input array already 389 assert( _in[2] == this, "Must pass arg count to 'new'" ); 390 assert( is_not_dead(n0), "can not use dead node"); 391 assert( is_not_dead(n1), "can not use dead node"); 392 assert( is_not_dead(n2), "can not use dead node"); 393 _in[0] = n0; if (n0 != NULL) n0->add_out((Node *)this); 394 _in[1] = n1; if (n1 != NULL) n1->add_out((Node *)this); 395 _in[2] = n2; if (n2 != NULL) n2->add_out((Node *)this); 396 } 397 398 //------------------------------Node------------------------------------------- 399 Node::Node(Node *n0, Node *n1, Node *n2, Node *n3) 400 : _idx(IDX_INIT(4)) 401 #ifdef ASSERT 402 , _parse_idx(_idx) 403 #endif 404 { 405 debug_only( verify_construction() ); 406 NOT_PRODUCT(nodes_created++); 407 // Assert we allocated space for input array already 408 assert( _in[3] == this, "Must pass arg count to 'new'" ); 409 assert( is_not_dead(n0), "can not use dead node"); 410 assert( is_not_dead(n1), "can not use dead node"); 411 assert( is_not_dead(n2), "can not use dead node"); 412 assert( is_not_dead(n3), "can not use dead node"); 413 _in[0] = n0; if (n0 != NULL) n0->add_out((Node *)this); 414 _in[1] = n1; if (n1 != NULL) n1->add_out((Node *)this); 415 _in[2] = n2; if (n2 != NULL) n2->add_out((Node *)this); 416 _in[3] = n3; if (n3 != NULL) n3->add_out((Node *)this); 417 } 418 419 //------------------------------Node------------------------------------------- 420 Node::Node(Node *n0, Node *n1, Node *n2, Node *n3, Node *n4) 421 : _idx(IDX_INIT(5)) 422 #ifdef ASSERT 423 , _parse_idx(_idx) 424 #endif 425 { 426 debug_only( verify_construction() ); 427 NOT_PRODUCT(nodes_created++); 428 // Assert we allocated space for input array already 429 assert( _in[4] == this, "Must pass arg count to 'new'" ); 430 assert( is_not_dead(n0), "can not use dead node"); 431 assert( is_not_dead(n1), "can not use dead node"); 432 assert( is_not_dead(n2), "can not use dead node"); 433 assert( is_not_dead(n3), "can not use dead node"); 434 assert( is_not_dead(n4), "can not use dead node"); 435 _in[0] = n0; if (n0 != NULL) n0->add_out((Node *)this); 436 _in[1] = n1; if (n1 != NULL) n1->add_out((Node *)this); 437 _in[2] = n2; if (n2 != NULL) n2->add_out((Node *)this); 438 _in[3] = n3; if (n3 != NULL) n3->add_out((Node *)this); 439 _in[4] = n4; if (n4 != NULL) n4->add_out((Node *)this); 440 } 441 442 //------------------------------Node------------------------------------------- 443 Node::Node(Node *n0, Node *n1, Node *n2, Node *n3, 444 Node *n4, Node *n5) 445 : _idx(IDX_INIT(6)) 446 #ifdef ASSERT 447 , _parse_idx(_idx) 448 #endif 449 { 450 debug_only( verify_construction() ); 451 NOT_PRODUCT(nodes_created++); 452 // Assert we allocated space for input array already 453 assert( _in[5] == this, "Must pass arg count to 'new'" ); 454 assert( is_not_dead(n0), "can not use dead node"); 455 assert( is_not_dead(n1), "can not use dead node"); 456 assert( is_not_dead(n2), "can not use dead node"); 457 assert( is_not_dead(n3), "can not use dead node"); 458 assert( is_not_dead(n4), "can not use dead node"); 459 assert( is_not_dead(n5), "can not use dead node"); 460 _in[0] = n0; if (n0 != NULL) n0->add_out((Node *)this); 461 _in[1] = n1; if (n1 != NULL) n1->add_out((Node *)this); 462 _in[2] = n2; if (n2 != NULL) n2->add_out((Node *)this); 463 _in[3] = n3; if (n3 != NULL) n3->add_out((Node *)this); 464 _in[4] = n4; if (n4 != NULL) n4->add_out((Node *)this); 465 _in[5] = n5; if (n5 != NULL) n5->add_out((Node *)this); 466 } 467 468 //------------------------------Node------------------------------------------- 469 Node::Node(Node *n0, Node *n1, Node *n2, Node *n3, 470 Node *n4, Node *n5, Node *n6) 471 : _idx(IDX_INIT(7)) 472 #ifdef ASSERT 473 , _parse_idx(_idx) 474 #endif 475 { 476 debug_only( verify_construction() ); 477 NOT_PRODUCT(nodes_created++); 478 // Assert we allocated space for input array already 479 assert( _in[6] == this, "Must pass arg count to 'new'" ); 480 assert( is_not_dead(n0), "can not use dead node"); 481 assert( is_not_dead(n1), "can not use dead node"); 482 assert( is_not_dead(n2), "can not use dead node"); 483 assert( is_not_dead(n3), "can not use dead node"); 484 assert( is_not_dead(n4), "can not use dead node"); 485 assert( is_not_dead(n5), "can not use dead node"); 486 assert( is_not_dead(n6), "can not use dead node"); 487 _in[0] = n0; if (n0 != NULL) n0->add_out((Node *)this); 488 _in[1] = n1; if (n1 != NULL) n1->add_out((Node *)this); 489 _in[2] = n2; if (n2 != NULL) n2->add_out((Node *)this); 490 _in[3] = n3; if (n3 != NULL) n3->add_out((Node *)this); 491 _in[4] = n4; if (n4 != NULL) n4->add_out((Node *)this); 492 _in[5] = n5; if (n5 != NULL) n5->add_out((Node *)this); 493 _in[6] = n6; if (n6 != NULL) n6->add_out((Node *)this); 494 } |