| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 <map> | 5 #include <map> |
| 6 #include <set> | 6 #include <set> |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "vm/kernel_to_il.h" | 9 #include "vm/kernel_to_il.h" |
| 10 | 10 |
| (...skipping 2686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2697 const dart::String& url = H.DartString( | 2697 const dart::String& url = H.DartString( |
| 2698 parsed_function_->function().ToLibNamePrefixedQualifiedCString(), | 2698 parsed_function_->function().ToLibNamePrefixedQualifiedCString(), |
| 2699 Heap::kOld); | 2699 Heap::kOld); |
| 2700 | 2700 |
| 2701 Fragment instructions; | 2701 Fragment instructions; |
| 2702 | 2702 |
| 2703 // Create instance of _FallThroughError | 2703 // Create instance of _FallThroughError |
| 2704 instructions += AllocateObject(klass, 0); | 2704 instructions += AllocateObject(klass, 0); |
| 2705 LocalVariable* instance = MakeTemporary(); | 2705 LocalVariable* instance = MakeTemporary(); |
| 2706 | 2706 |
| 2707 // Call _AssertionError._create constructor. | 2707 // Call _TypeError._create constructor. |
| 2708 instructions += LoadLocal(instance); | 2708 instructions += LoadLocal(instance); |
| 2709 instructions += PushArgument(); // this | 2709 instructions += PushArgument(); // this |
| 2710 | 2710 |
| 2711 instructions += Constant(url); | 2711 instructions += Constant(url); |
| 2712 instructions += PushArgument(); // url | 2712 instructions += PushArgument(); // url |
| 2713 | 2713 |
| 2714 instructions += NullConstant(); | 2714 instructions += NullConstant(); |
| 2715 instructions += PushArgument(); // line | 2715 instructions += PushArgument(); // line |
| 2716 | 2716 |
| 2717 instructions += IntConstant(0); | 2717 instructions += IntConstant(0); |
| (...skipping 2661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5379 H.DartSymbol("FallThroughError._create"))); | 5379 H.DartSymbol("FallThroughError._create"))); |
| 5380 ASSERT(!constructor.IsNull()); | 5380 ASSERT(!constructor.IsNull()); |
| 5381 const dart::String& url = H.DartString( | 5381 const dart::String& url = H.DartString( |
| 5382 parsed_function_->function().ToLibNamePrefixedQualifiedCString(), | 5382 parsed_function_->function().ToLibNamePrefixedQualifiedCString(), |
| 5383 Heap::kOld); | 5383 Heap::kOld); |
| 5384 | 5384 |
| 5385 // Create instance of _FallThroughError | 5385 // Create instance of _FallThroughError |
| 5386 body_fragment += AllocateObject(klass, 0); | 5386 body_fragment += AllocateObject(klass, 0); |
| 5387 LocalVariable* instance = MakeTemporary(); | 5387 LocalVariable* instance = MakeTemporary(); |
| 5388 | 5388 |
| 5389 // Call _AssertionError._create constructor. | 5389 // Call _FallThroughError._create constructor. |
| 5390 body_fragment += LoadLocal(instance); | 5390 body_fragment += LoadLocal(instance); |
| 5391 body_fragment += PushArgument(); // this | 5391 body_fragment += PushArgument(); // this |
| 5392 | 5392 |
| 5393 body_fragment += Constant(url); | 5393 body_fragment += Constant(url); |
| 5394 body_fragment += PushArgument(); // url | 5394 body_fragment += PushArgument(); // url |
| 5395 | 5395 |
| 5396 body_fragment += NullConstant(); | 5396 body_fragment += NullConstant(); |
| 5397 body_fragment += PushArgument(); // line | 5397 body_fragment += PushArgument(); // line |
| 5398 | 5398 |
| 5399 body_fragment += StaticCall(TokenPosition::kNoSource, constructor, 3); | 5399 body_fragment += StaticCall(TokenPosition::kNoSource, constructor, 3); |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5570 LocalVariable* instance = MakeTemporary(); | 5570 LocalVariable* instance = MakeTemporary(); |
| 5571 | 5571 |
| 5572 // Call _AssertionError._create constructor. | 5572 // Call _AssertionError._create constructor. |
| 5573 otherwise_fragment += LoadLocal(instance); | 5573 otherwise_fragment += LoadLocal(instance); |
| 5574 otherwise_fragment += PushArgument(); // this | 5574 otherwise_fragment += PushArgument(); // this |
| 5575 | 5575 |
| 5576 otherwise_fragment += | 5576 otherwise_fragment += |
| 5577 node->message() != NULL | 5577 node->message() != NULL |
| 5578 ? TranslateExpression(node->message()) | 5578 ? TranslateExpression(node->message()) |
| 5579 : Constant(H.DartString("<no message>", Heap::kOld)); | 5579 : Constant(H.DartString("<no message>", Heap::kOld)); |
| 5580 otherwise_fragment += PushArgument(); // message | 5580 otherwise_fragment += PushArgument(); // failedAssertion |
| 5581 | 5581 |
| 5582 otherwise_fragment += Constant(url); | 5582 otherwise_fragment += Constant(url); |
| 5583 otherwise_fragment += PushArgument(); // url | 5583 otherwise_fragment += PushArgument(); // url |
| 5584 | 5584 |
| 5585 otherwise_fragment += IntConstant(0); | 5585 otherwise_fragment += IntConstant(0); |
| 5586 otherwise_fragment += PushArgument(); // line | 5586 otherwise_fragment += PushArgument(); // line |
| 5587 | 5587 |
| 5588 otherwise_fragment += IntConstant(0); | 5588 otherwise_fragment += IntConstant(0); |
| 5589 otherwise_fragment += PushArgument(); // column | 5589 otherwise_fragment += PushArgument(); // column |
| 5590 | 5590 |
| 5591 otherwise_fragment += StaticCall(TokenPosition::kNoSource, constructor, 5); | 5591 otherwise_fragment += Constant(H.DartString("<no message>", Heap::kOld)); |
| 5592 otherwise_fragment += PushArgument(); // message |
| 5593 |
| 5594 otherwise_fragment += StaticCall(TokenPosition::kNoSource, constructor, 6); |
| 5592 otherwise_fragment += Drop(); | 5595 otherwise_fragment += Drop(); |
| 5593 | 5596 |
| 5594 // Throw _AssertionError exception. | 5597 // Throw _AssertionError exception. |
| 5595 otherwise_fragment += PushArgument(); | 5598 otherwise_fragment += PushArgument(); |
| 5596 otherwise_fragment += ThrowException(TokenPosition::kNoSource); | 5599 otherwise_fragment += ThrowException(TokenPosition::kNoSource); |
| 5597 otherwise_fragment += Drop(); | 5600 otherwise_fragment += Drop(); |
| 5598 | 5601 |
| 5599 fragment_ = Fragment(instructions.entry, then); | 5602 fragment_ = Fragment(instructions.entry, then); |
| 5600 } | 5603 } |
| 5601 | 5604 |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6041 thread->clear_sticky_error(); | 6044 thread->clear_sticky_error(); |
| 6042 return error.raw(); | 6045 return error.raw(); |
| 6043 } | 6046 } |
| 6044 } | 6047 } |
| 6045 | 6048 |
| 6046 | 6049 |
| 6047 } // namespace kernel | 6050 } // namespace kernel |
| 6048 } // namespace dart | 6051 } // namespace dart |
| 6049 | 6052 |
| 6050 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 6053 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
| OLD | NEW |