Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/flow_graph_builder.h" | 5 #include "vm/flow_graph_builder.h" |
| 6 | 6 |
| 7 #include "vm/flags.h" | 7 #include "vm/flags.h" |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 #include "vm/longjump.h" | 9 #include "vm/longjump.h" |
| 10 #include "vm/os.h" | 10 #include "vm/os.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 113 // 3. Set the exit to the graph to be empty or a fresh target node | 113 // 3. Set the exit to the graph to be empty or a fresh target node |
| 114 // depending on whether the false branch of the test is reachable. | 114 // depending on whether the false branch of the test is reachable. |
| 115 if (test_fragment.can_be_false()) { | 115 if (test_fragment.can_be_false()) { |
| 116 exit_ = *test_fragment.false_successor_address() = new TargetEntryInstr(); | 116 exit_ = *test_fragment.false_successor_address() = new TargetEntryInstr(); |
| 117 } else { | 117 } else { |
| 118 exit_ = NULL; | 118 exit_ = NULL; |
| 119 } | 119 } |
| 120 } | 120 } |
| 121 | 121 |
| 122 | 122 |
| 123 void TestGraphVisitor::BranchOnValue(Value* value) { | 123 void TestGraphVisitor::ReturnValue(Value* value) { |
| 124 BranchInstr* branch = new BranchInstr(value); | 124 BranchInstr* branch = new BranchInstr(value); |
| 125 AddInstruction(branch); | 125 AddInstruction(branch); |
| 126 CloseFragment(); | 126 CloseFragment(); |
| 127 true_successor_address_ = branch->true_successor_address(); | 127 true_successor_address_ = branch->true_successor_address(); |
| 128 false_successor_address_ = branch->false_successor_address(); | 128 false_successor_address_ = branch->false_successor_address(); |
| 129 } | 129 } |
| 130 | 130 |
| 131 | 131 |
| 132 void ArgumentGraphVisitor::ReturnValue(Value* value) { | 132 void ArgumentGraphVisitor::ReturnValue(Value* value) { |
| 133 value_ = value; | 133 value_ = value; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 181 // <Expression> ::= Literal { literal: Instance } | 181 // <Expression> ::= Literal { literal: Instance } |
| 182 void EffectGraphVisitor::VisitLiteralNode(LiteralNode* node) { | 182 void EffectGraphVisitor::VisitLiteralNode(LiteralNode* node) { |
| 183 return; | 183 return; |
| 184 } | 184 } |
| 185 | 185 |
| 186 void ValueGraphVisitor::VisitLiteralNode(LiteralNode* node) { | 186 void ValueGraphVisitor::VisitLiteralNode(LiteralNode* node) { |
| 187 ReturnValue(new ConstantVal(node->literal())); | 187 ReturnValue(new ConstantVal(node->literal())); |
| 188 } | 188 } |
| 189 | 189 |
| 190 void TestGraphVisitor::VisitLiteralNode(LiteralNode* node) { | 190 void TestGraphVisitor::VisitLiteralNode(LiteralNode* node) { |
| 191 BranchOnValue(new ConstantVal(node->literal())); | 191 ReturnValue(new ConstantVal(node->literal())); |
| 192 } | 192 } |
| 193 | 193 |
| 194 | 194 |
| 195 // Type nodes only occur as the right-hand side of instanceof comparisons, | 195 // Type nodes only occur as the right-hand side of instanceof comparisons, |
| 196 // and they are handled specially in that context. | 196 // and they are handled specially in that context. |
| 197 void EffectGraphVisitor::VisitTypeNode(TypeNode* node) { UNREACHABLE(); } | 197 void EffectGraphVisitor::VisitTypeNode(TypeNode* node) { UNREACHABLE(); } |
| 198 | 198 |
| 199 | 199 |
| 200 // <Expression> :: Assignable { expr: <Expression> | 200 // <Expression> :: Assignable { expr: <Expression> |
| 201 // type: AbstractType | 201 // type: AbstractType |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 223 node->left()->Visit(&for_left_value); | 223 node->left()->Visit(&for_left_value); |
| 224 Append(for_left_value); | 224 Append(for_left_value); |
| 225 ArgumentGraphVisitor for_right_value(owner(), for_left_value.temp_index()); | 225 ArgumentGraphVisitor for_right_value(owner(), for_left_value.temp_index()); |
| 226 node->right()->Visit(&for_right_value); | 226 node->right()->Visit(&for_right_value); |
| 227 Append(for_right_value); | 227 Append(for_right_value); |
| 228 ZoneGrowableArray<Value*>* arguments = new ZoneGrowableArray<Value*>(2); | 228 ZoneGrowableArray<Value*>* arguments = new ZoneGrowableArray<Value*>(2); |
| 229 arguments->Add(for_left_value.value()); | 229 arguments->Add(for_left_value.value()); |
| 230 arguments->Add(for_right_value.value()); | 230 arguments->Add(for_right_value.value()); |
| 231 const String& name = String::ZoneHandle(String::NewSymbol(node->Name())); | 231 const String& name = String::ZoneHandle(String::NewSymbol(node->Name())); |
| 232 InstanceCallComp* call = | 232 InstanceCallComp* call = |
| 233 new InstanceCallComp(node, name, arguments, Array::ZoneHandle(), 2); | 233 new InstanceCallComp(node->id(), node->token_index(), name, |
|
srdjan
2012/03/05 21:44:38
FYI: In the old compiler node->id() is used for de
| |
| 234 arguments, Array::ZoneHandle(), 2); | |
| 234 ReturnComputation(call); | 235 ReturnComputation(call); |
| 235 } | 236 } |
| 236 | 237 |
| 237 | 238 |
| 238 void EffectGraphVisitor::VisitStringConcatNode(StringConcatNode* node) { | 239 void EffectGraphVisitor::VisitStringConcatNode(StringConcatNode* node) { |
| 239 Bailout("EffectGraphVisitor::VisitStringConcatNode"); | 240 Bailout("EffectGraphVisitor::VisitStringConcatNode"); |
| 240 } | 241 } |
| 241 | 242 |
| 242 | 243 |
| 243 // <Expression> :: Comparison { kind: Token::Kind | 244 // <Expression> :: Comparison { kind: Token::Kind |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 267 node->left()->Visit(&for_left_value); | 268 node->left()->Visit(&for_left_value); |
| 268 Append(for_left_value); | 269 Append(for_left_value); |
| 269 ArgumentGraphVisitor for_right_value(owner(), for_left_value.temp_index()); | 270 ArgumentGraphVisitor for_right_value(owner(), for_left_value.temp_index()); |
| 270 node->right()->Visit(&for_right_value); | 271 node->right()->Visit(&for_right_value); |
| 271 Append(for_right_value); | 272 Append(for_right_value); |
| 272 ZoneGrowableArray<Value*>* arguments = new ZoneGrowableArray<Value*>(2); | 273 ZoneGrowableArray<Value*>* arguments = new ZoneGrowableArray<Value*>(2); |
| 273 arguments->Add(for_left_value.value()); | 274 arguments->Add(for_left_value.value()); |
| 274 arguments->Add(for_right_value.value()); | 275 arguments->Add(for_right_value.value()); |
| 275 const String& name = String::ZoneHandle(String::NewSymbol(node->Name())); | 276 const String& name = String::ZoneHandle(String::NewSymbol(node->Name())); |
| 276 InstanceCallComp* call = | 277 InstanceCallComp* call = |
| 277 new InstanceCallComp(node, name, arguments, Array::ZoneHandle(), 2); | 278 new InstanceCallComp(node->id(), node->token_index(), name, |
| 279 arguments, Array::ZoneHandle(), 2); | |
| 278 ReturnComputation(call); | 280 ReturnComputation(call); |
| 279 } | 281 } |
| 280 | 282 |
| 281 | 283 |
| 282 void EffectGraphVisitor::VisitUnaryOpNode(UnaryOpNode* node) { | 284 void EffectGraphVisitor::VisitUnaryOpNode(UnaryOpNode* node) { |
| 283 // "!" cannot be overloaded, therefore do not call operator. | 285 // "!" cannot be overloaded, therefore do not call operator. |
| 284 if (node->kind() == Token::kNOT) { | 286 if (node->kind() == Token::kNOT) { |
| 285 Bailout("EffectGraphVisitor::VisitUnaryOpNode NOT"); | 287 Bailout("EffectGraphVisitor::VisitUnaryOpNode NOT"); |
| 286 } | 288 } |
| 287 ArgumentGraphVisitor for_value(owner(), temp_index()); | 289 ArgumentGraphVisitor for_value(owner(), temp_index()); |
| 288 node->operand()->Visit(&for_value); | 290 node->operand()->Visit(&for_value); |
| 289 Append(for_value); | 291 Append(for_value); |
| 290 ZoneGrowableArray<Value*>* arguments = new ZoneGrowableArray<Value*>(1); | 292 ZoneGrowableArray<Value*>* arguments = new ZoneGrowableArray<Value*>(1); |
| 291 arguments->Add(for_value.value()); | 293 arguments->Add(for_value.value()); |
| 292 const String& name = | 294 const String& name = |
| 293 String::ZoneHandle(String::NewSymbol((node->kind() == Token::kSUB) | 295 String::ZoneHandle(String::NewSymbol((node->kind() == Token::kSUB) |
| 294 ? Token::Str(Token::kNEGATE) | 296 ? Token::Str(Token::kNEGATE) |
| 295 : node->Name())); | 297 : node->Name())); |
| 296 InstanceCallComp* call = | 298 InstanceCallComp* call = |
| 297 new InstanceCallComp(node, name, arguments, Array::ZoneHandle(), 1); | 299 new InstanceCallComp(node->id(), node->token_index(), name, |
| 300 arguments, Array::ZoneHandle(), 1); | |
| 298 ReturnComputation(call); | 301 ReturnComputation(call); |
| 299 } | 302 } |
| 300 | 303 |
| 301 | 304 |
| 302 void EffectGraphVisitor::VisitIncrOpLocalNode(IncrOpLocalNode* node) { | 305 void EffectGraphVisitor::VisitIncrOpLocalNode(IncrOpLocalNode* node) { |
| 303 Bailout("EffectGraphVisitor::VisitIncrOpLocalNode"); | 306 Bailout("EffectGraphVisitor::VisitIncrOpLocalNode"); |
| 304 } | 307 } |
| 305 | 308 |
| 306 | 309 |
| 307 void EffectGraphVisitor::VisitIncrOpInstanceFieldNode( | 310 void EffectGraphVisitor::VisitIncrOpInstanceFieldNode( |
| 308 IncrOpInstanceFieldNode* node) { | 311 IncrOpInstanceFieldNode* node) { |
| 309 Bailout("EffectGraphVisitor::VisitIncrOpInstanceFieldNode"); | 312 Bailout("EffectGraphVisitor::VisitIncrOpInstanceFieldNode"); |
| 310 } | 313 } |
| 311 | 314 |
| 312 | 315 |
| 313 void EffectGraphVisitor::VisitIncrOpStaticFieldNode( | 316 void EffectGraphVisitor::VisitIncrOpStaticFieldNode( |
| 314 IncrOpStaticFieldNode* node) { | 317 IncrOpStaticFieldNode* node) { |
| 315 Bailout("EffectGraphVisitor::VisitIncrOpStaticFieldNode"); | 318 Bailout("EffectGraphVisitor::VisitIncrOpStaticFieldNode"); |
| 316 } | 319 } |
| 317 | 320 |
| 318 | 321 |
| 319 void EffectGraphVisitor::VisitIncrOpIndexedNode(IncrOpIndexedNode* node) { | 322 void EffectGraphVisitor::VisitIncrOpIndexedNode(IncrOpIndexedNode* node) { |
| 320 Bailout("EffectGraphVisitor::VisitIncrOpIndexedNode"); | 323 ASSERT((node->kind() == Token::kINCR) || (node->kind() == Token::kDECR)); |
| 324 if (node->prefix()) { | |
| 325 Bailout("IncrOpIndexed prefix"); | |
| 326 } else { | |
| 327 // Leave a placeholder, evaluate receiver and index. | |
| 328 // t0 <- #0 | |
| 329 // t1 <- ... receiver ... | |
| 330 // t2 <- ... index ... | |
| 331 const Smi& placeholder = Smi::ZoneHandle(Smi::New(0)); | |
| 332 AddInstruction(new BindInstr(temp_index(), new ConstantVal(placeholder))); | |
| 333 ArgumentGraphVisitor for_array(owner(), temp_index() + 1); | |
| 334 node->array()->Visit(&for_array); | |
| 335 Append(for_array); | |
| 336 ArgumentGraphVisitor for_index(owner(), for_array.temp_index()); | |
| 337 node->index()->Visit(&for_index); | |
| 338 Append(for_index); | |
| 339 | |
| 340 // Duplicate the receiver and index values, load the value. | |
| 341 // t3 <- Copy(t1) | |
| 342 // t4 <- Copy(t2) | |
| 343 // t3 <- InstanceCall([], t3, t4) | |
| 344 int next_index = for_index.temp_index(); | |
| 345 AddInstruction(new BindInstr(next_index, new CopyTempComp(-1))); | |
| 346 AddInstruction(new BindInstr(next_index + 1, new CopyTempComp(-1))); | |
| 347 ZoneGrowableArray<Value*>* arguments = new ZoneGrowableArray<Value*>(2); | |
| 348 arguments->Add(new TempVal(next_index)); | |
| 349 arguments->Add(new TempVal(next_index + 1)); | |
| 350 const String& load_name = | |
| 351 String::ZoneHandle(String::NewSymbol(Token::Str(Token::kINDEX))); | |
| 352 InstanceCallComp* load = | |
| 353 new InstanceCallComp(node->load_id(), node->token_index(), load_name, | |
| 354 arguments, Array::ZoneHandle(), 1); | |
| 355 AddInstruction(new BindInstr(next_index, load)); | |
| 356 | |
| 357 // Preserve the original value and then increment. | |
| 358 // t0 := t3 | |
| 359 // t4 <- #1 | |
| 360 // t3 <- InstanceCall(op, t3, t4) | |
| 361 AddInstruction(new DoInstr(new SetTempComp(-3))); | |
| 362 const Smi& one = Smi::ZoneHandle(Smi::New(1)); | |
| 363 AddInstruction(new BindInstr(next_index + 1, new ConstantVal(one))); | |
| 364 arguments = new ZoneGrowableArray<Value*>(2); | |
| 365 arguments->Add(new TempVal(next_index)); | |
| 366 arguments->Add(new TempVal(next_index + 1)); | |
| 367 const String& op_name = String::ZoneHandle(String::NewSymbol( | |
| 368 (node->kind() == Token::kINCR) ? "+" : "-")); | |
| 369 InstanceCallComp* add = | |
| 370 new InstanceCallComp(node->operator_id(), node->token_index(), op_name, | |
| 371 arguments, Array::ZoneHandle(), 2); | |
| 372 AddInstruction(new BindInstr(next_index, add)); | |
| 373 | |
| 374 // Perform the store. | |
| 375 // InstanceCallComp([]=, t1, t2, t3) | |
| 376 // ... value is t0 ... | |
| 377 arguments = new ZoneGrowableArray<Value*>(3); | |
| 378 arguments->Add(for_array.value()); | |
| 379 arguments->Add(for_index.value()); | |
| 380 arguments->Add(new TempVal(next_index)); | |
| 381 const String& store_name = | |
| 382 String::ZoneHandle(String::NewSymbol(Token::Str(Token::kASSIGN_INDEX))); | |
| 383 InstanceCallComp* store = | |
| 384 new InstanceCallComp(node->store_id(), node->token_index(), store_name, | |
| 385 arguments, Array::ZoneHandle(), 1); | |
| 386 AddInstruction(new DoInstr(store)); | |
| 387 | |
| 388 ReturnValue(new TempVal(AllocateTempIndex())); | |
| 389 } | |
| 321 } | 390 } |
| 322 | 391 |
| 323 | 392 |
| 324 void EffectGraphVisitor::VisitConditionalExprNode(ConditionalExprNode* node) { | 393 void EffectGraphVisitor::VisitConditionalExprNode(ConditionalExprNode* node) { |
| 325 Bailout("EffectGraphVisitor::VisitConditionalExprNode"); | 394 Bailout("EffectGraphVisitor::VisitConditionalExprNode"); |
| 326 } | 395 } |
| 327 | 396 |
| 328 | 397 |
| 329 // <Statement> ::= If { condition: <Expression> | 398 // <Statement> ::= If { condition: <Expression> |
| 330 // true_branch: <Sequence> | 399 // true_branch: <Sequence> |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 417 int length = arguments->length(); | 486 int length = arguments->length(); |
| 418 ZoneGrowableArray<Value*>* values = new ZoneGrowableArray<Value*>(length + 1); | 487 ZoneGrowableArray<Value*>* values = new ZoneGrowableArray<Value*>(length + 1); |
| 419 | 488 |
| 420 ArgumentGraphVisitor for_receiver(owner(), temp_index()); | 489 ArgumentGraphVisitor for_receiver(owner(), temp_index()); |
| 421 node->receiver()->Visit(&for_receiver); | 490 node->receiver()->Visit(&for_receiver); |
| 422 Append(for_receiver); | 491 Append(for_receiver); |
| 423 values->Add(for_receiver.value()); | 492 values->Add(for_receiver.value()); |
| 424 | 493 |
| 425 TranslateArgumentList(*arguments, for_receiver.temp_index(), values); | 494 TranslateArgumentList(*arguments, for_receiver.temp_index(), values); |
| 426 InstanceCallComp* call = | 495 InstanceCallComp* call = |
| 427 new InstanceCallComp(node, node->function_name(), values, | 496 new InstanceCallComp(node->id(), node->token_index(), |
| 497 node->function_name(), values, | |
| 428 arguments->names(), 1); | 498 arguments->names(), 1); |
| 429 ReturnComputation(call); | 499 ReturnComputation(call); |
| 430 } | 500 } |
| 431 | 501 |
| 432 | 502 |
| 433 // <Expression> ::= StaticCall { function: Function | 503 // <Expression> ::= StaticCall { function: Function |
| 434 // arguments: <ArgumentList> } | 504 // arguments: <ArgumentList> } |
| 435 void EffectGraphVisitor::VisitStaticCallNode(StaticCallNode* node) { | 505 void EffectGraphVisitor::VisitStaticCallNode(StaticCallNode* node) { |
| 436 int length = node->arguments()->length(); | 506 int length = node->arguments()->length(); |
| 437 ZoneGrowableArray<Value*>* values = new ZoneGrowableArray<Value*>(length); | 507 ZoneGrowableArray<Value*>* values = new ZoneGrowableArray<Value*>(length); |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 458 | 528 |
| 459 void EffectGraphVisitor::VisitInstanceGetterNode(InstanceGetterNode* node) { | 529 void EffectGraphVisitor::VisitInstanceGetterNode(InstanceGetterNode* node) { |
| 460 ArgumentGraphVisitor for_receiver(owner(), temp_index()); | 530 ArgumentGraphVisitor for_receiver(owner(), temp_index()); |
| 461 node->receiver()->Visit(&for_receiver); | 531 node->receiver()->Visit(&for_receiver); |
| 462 Append(for_receiver); | 532 Append(for_receiver); |
| 463 ZoneGrowableArray<Value*>* arguments = new ZoneGrowableArray<Value*>(1); | 533 ZoneGrowableArray<Value*>* arguments = new ZoneGrowableArray<Value*>(1); |
| 464 arguments->Add(for_receiver.value()); | 534 arguments->Add(for_receiver.value()); |
| 465 const String& name = | 535 const String& name = |
| 466 String::ZoneHandle(Field::GetterSymbol(node->field_name())); | 536 String::ZoneHandle(Field::GetterSymbol(node->field_name())); |
| 467 InstanceCallComp* call = | 537 InstanceCallComp* call = |
| 468 new InstanceCallComp(node, name, arguments, Array::ZoneHandle(), 1); | 538 new InstanceCallComp(node->id(), node->token_index(), name, |
| 539 arguments, Array::ZoneHandle(), 1); | |
| 469 ReturnComputation(call); | 540 ReturnComputation(call); |
| 470 } | 541 } |
| 471 | 542 |
| 472 | 543 |
| 473 void EffectGraphVisitor::VisitInstanceSetterNode(InstanceSetterNode* node) { | 544 void EffectGraphVisitor::VisitInstanceSetterNode(InstanceSetterNode* node) { |
| 474 ArgumentGraphVisitor for_receiver(owner(), temp_index()); | 545 ArgumentGraphVisitor for_receiver(owner(), temp_index()); |
| 475 node->receiver()->Visit(&for_receiver); | 546 node->receiver()->Visit(&for_receiver); |
| 476 Append(for_receiver); | 547 Append(for_receiver); |
| 477 ArgumentGraphVisitor for_value(owner(), for_receiver.temp_index()); | 548 ArgumentGraphVisitor for_value(owner(), for_receiver.temp_index()); |
| 478 node->value()->Visit(&for_value); | 549 node->value()->Visit(&for_value); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 569 Append(for_array); | 640 Append(for_array); |
| 570 ArgumentGraphVisitor for_index(owner(), for_array.temp_index()); | 641 ArgumentGraphVisitor for_index(owner(), for_array.temp_index()); |
| 571 node->index_expr()->Visit(&for_index); | 642 node->index_expr()->Visit(&for_index); |
| 572 Append(for_index); | 643 Append(for_index); |
| 573 ZoneGrowableArray<Value*>* arguments = new ZoneGrowableArray<Value*>(2); | 644 ZoneGrowableArray<Value*>* arguments = new ZoneGrowableArray<Value*>(2); |
| 574 arguments->Add(for_array.value()); | 645 arguments->Add(for_array.value()); |
| 575 arguments->Add(for_index.value()); | 646 arguments->Add(for_index.value()); |
| 576 const String& name = | 647 const String& name = |
| 577 String::ZoneHandle(String::NewSymbol(Token::Str(Token::kINDEX))); | 648 String::ZoneHandle(String::NewSymbol(Token::Str(Token::kINDEX))); |
| 578 InstanceCallComp* call = | 649 InstanceCallComp* call = |
| 579 new InstanceCallComp(node, name, arguments, Array::ZoneHandle(), 1); | 650 new InstanceCallComp(node->id(), node->token_index(), name, |
| 651 arguments, Array::ZoneHandle(), 1); | |
| 580 ReturnComputation(call); | 652 ReturnComputation(call); |
| 581 } | 653 } |
| 582 | 654 |
| 583 | 655 |
| 584 void EffectGraphVisitor::VisitStoreIndexedNode(StoreIndexedNode* node) { | 656 void EffectGraphVisitor::VisitStoreIndexedNode(StoreIndexedNode* node) { |
| 585 ArgumentGraphVisitor for_array(owner(), temp_index()); | 657 ArgumentGraphVisitor for_array(owner(), temp_index()); |
| 586 node->array()->Visit(&for_array); | 658 node->array()->Visit(&for_array); |
| 587 Append(for_array); | 659 Append(for_array); |
| 588 ArgumentGraphVisitor for_index(owner(), for_array.temp_index()); | 660 ArgumentGraphVisitor for_index(owner(), for_array.temp_index()); |
| 589 node->index_expr()->Visit(&for_index); | 661 node->index_expr()->Visit(&for_index); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 694 void FlowGraphPrinter::VisitTemp(TempVal* val) { | 766 void FlowGraphPrinter::VisitTemp(TempVal* val) { |
| 695 OS::Print("t%d", val->index()); | 767 OS::Print("t%d", val->index()); |
| 696 } | 768 } |
| 697 | 769 |
| 698 | 770 |
| 699 void FlowGraphPrinter::VisitConstant(ConstantVal* val) { | 771 void FlowGraphPrinter::VisitConstant(ConstantVal* val) { |
| 700 OS::Print("#%s", val->instance().ToCString()); | 772 OS::Print("#%s", val->instance().ToCString()); |
| 701 } | 773 } |
| 702 | 774 |
| 703 | 775 |
| 776 void FlowGraphPrinter::VisitCopyTemp(CopyTempComp* comp) { | |
| 777 OS::Print("CopyTemp(%d)", comp->index()); | |
| 778 } | |
| 779 | |
| 780 | |
| 781 void FlowGraphPrinter::VisitSetTemp(SetTempComp* comp) { | |
| 782 OS::Print("SetTemp(%d)", comp->index()); | |
| 783 } | |
| 784 | |
| 785 | |
| 704 void FlowGraphPrinter::VisitAssertAssignable(AssertAssignableComp* comp) { | 786 void FlowGraphPrinter::VisitAssertAssignable(AssertAssignableComp* comp) { |
| 705 OS::Print("AssertAssignable("); | 787 OS::Print("AssertAssignable("); |
| 706 comp->value()->Accept(this); | 788 comp->value()->Accept(this); |
| 707 OS::Print(", %s)", comp->type().ToCString()); | 789 OS::Print(", %s)", comp->type().ToCString()); |
| 708 } | 790 } |
| 709 | 791 |
| 710 | 792 |
| 711 void FlowGraphPrinter::VisitInstanceCall(InstanceCallComp* comp) { | 793 void FlowGraphPrinter::VisitInstanceCall(InstanceCallComp* comp) { |
| 712 OS::Print("InstanceCall(%s", comp->function_name().ToCString()); | 794 OS::Print("InstanceCall(%s", comp->function_name().ToCString()); |
| 713 for (int i = 0; i < comp->ArgumentCount(); ++i) { | 795 for (int i = 0; i < comp->ArgumentCount(); ++i) { |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 841 char* chars = reinterpret_cast<char*>( | 923 char* chars = reinterpret_cast<char*>( |
| 842 Isolate::Current()->current_zone()->Allocate(len)); | 924 Isolate::Current()->current_zone()->Allocate(len)); |
| 843 OS::SNPrint(chars, len, kFormat, function_name, reason); | 925 OS::SNPrint(chars, len, kFormat, function_name, reason); |
| 844 const Error& error = Error::Handle( | 926 const Error& error = Error::Handle( |
| 845 LanguageError::New(String::Handle(String::New(chars)))); | 927 LanguageError::New(String::Handle(String::New(chars)))); |
| 846 Isolate::Current()->long_jump_base()->Jump(1, error); | 928 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 847 } | 929 } |
| 848 | 930 |
| 849 | 931 |
| 850 } // namespace dart | 932 } // namespace dart |
| OLD | NEW |