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 "platform/globals.h" | 5 #include "platform/globals.h" |
| 6 | 6 |
| 7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "vm/globals.h" | 8 #include "vm/globals.h" |
| 9 #include "vm/ast.h" | 9 #include "vm/ast.h" |
| 10 #include "vm/assembler.h" | 10 #include "vm/assembler.h" |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 502 false /* Not bootstrap native */))); | 502 false /* Not bootstrap native */))); |
| 503 } | 503 } |
| 504 | 504 |
| 505 | 505 |
| 506 // Tested Dart code, calling function sum declared above: | 506 // Tested Dart code, calling function sum declared above: |
| 507 // return sum(1, null, 3); | 507 // return sum(1, null, 3); |
| 508 CODEGEN_TEST2_GENERATE(StaticNonNullSumCallCodegen, function, test) { | 508 CODEGEN_TEST2_GENERATE(StaticNonNullSumCallCodegen, function, test) { |
| 509 SequenceNode* node_seq = test->node_sequence(); | 509 SequenceNode* node_seq = test->node_sequence(); |
| 510 ArgumentListNode* arguments = new ArgumentListNode(kPos); | 510 ArgumentListNode* arguments = new ArgumentListNode(kPos); |
| 511 arguments->Add(new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(1)))); | 511 arguments->Add(new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(1)))); |
| 512 arguments->Add(new LiteralNode(kPos, Smi::ZoneHandle())); | 512 arguments->Add(new LiteralNode(kPos, Instance::ZoneHandle())); |
|
Ivan Posva
2014/08/21 16:33:11
Object::null_object() would be the correct thing t
| |
| 513 arguments->Add(new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(3)))); | 513 arguments->Add(new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(3)))); |
| 514 node_seq->Add(new ReturnNode(kPos, | 514 node_seq->Add(new ReturnNode(kPos, |
| 515 new StaticCallNode(kPos, function, arguments))); | 515 new StaticCallNode(kPos, function, arguments))); |
| 516 } | 516 } |
| 517 CODEGEN_TEST2_RUN(StaticNonNullSumCallCodegen, | 517 CODEGEN_TEST2_RUN(StaticNonNullSumCallCodegen, |
| 518 NativeNonNullSumCodegen, | 518 NativeNonNullSumCodegen, |
| 519 Smi::New(1 + 3)) | 519 Smi::New(1 + 3)) |
| 520 | 520 |
| 521 | 521 |
| 522 // Test allocation of dart objects. | 522 // Test allocation of dart objects. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 561 intptr_t num_libs = libs.Length(); | 561 intptr_t num_libs = libs.Length(); |
| 562 Library& app_lib = Library::Handle(); | 562 Library& app_lib = Library::Handle(); |
| 563 app_lib ^= libs.At(num_libs - 1); | 563 app_lib ^= libs.At(num_libs - 1); |
| 564 ASSERT(!app_lib.IsNull()); | 564 ASSERT(!app_lib.IsNull()); |
| 565 const Class& cls = Class::Handle( | 565 const Class& cls = Class::Handle( |
| 566 app_lib.LookupClass(String::Handle(Symbols::New("A")))); | 566 app_lib.LookupClass(String::Handle(Symbols::New("A")))); |
| 567 EXPECT_EQ(cls.raw(), result.clazz()); | 567 EXPECT_EQ(cls.raw(), result.clazz()); |
| 568 } | 568 } |
| 569 | 569 |
| 570 } // namespace dart | 570 } // namespace dart |
| OLD | NEW |