OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/code_generator.h" | 5 #include "vm/code_generator.h" |
6 | 6 |
7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
8 #include "vm/ast.h" | 8 #include "vm/ast.h" |
9 #include "vm/bigint_operations.h" | |
10 #include "vm/code_patcher.h" | 9 #include "vm/code_patcher.h" |
11 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
12 #include "vm/dart_api_impl.h" | 11 #include "vm/dart_api_impl.h" |
13 #include "vm/dart_entry.h" | 12 #include "vm/dart_entry.h" |
14 #include "vm/debugger.h" | 13 #include "vm/debugger.h" |
15 #include "vm/deopt_instructions.h" | 14 #include "vm/deopt_instructions.h" |
16 #include "vm/exceptions.h" | 15 #include "vm/exceptions.h" |
17 #include "vm/intermediate_language.h" | 16 #include "vm/intermediate_language.h" |
18 #include "vm/object_store.h" | 17 #include "vm/object_store.h" |
19 #include "vm/message.h" | 18 #include "vm/message.h" |
(...skipping 1505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1525 intptr_t deopt_arg_count = deopt_context->MaterializeDeferredObjects(); | 1524 intptr_t deopt_arg_count = deopt_context->MaterializeDeferredObjects(); |
1526 isolate->set_deopt_context(NULL); | 1525 isolate->set_deopt_context(NULL); |
1527 delete deopt_context; | 1526 delete deopt_context; |
1528 | 1527 |
1529 // Return value tells deoptimization stub to remove the given number of bytes | 1528 // Return value tells deoptimization stub to remove the given number of bytes |
1530 // from the stack. | 1529 // from the stack. |
1531 arguments.SetReturn(Smi::Handle(Smi::New(deopt_arg_count * kWordSize))); | 1530 arguments.SetReturn(Smi::Handle(Smi::New(deopt_arg_count * kWordSize))); |
1532 } | 1531 } |
1533 | 1532 |
1534 | 1533 |
| 1534 // TODO(regis): Is this still necessary? Can we stay in Dart instead? |
1535 DEFINE_LEAF_RUNTIME_ENTRY(intptr_t, | 1535 DEFINE_LEAF_RUNTIME_ENTRY(intptr_t, |
1536 BigintCompare, | 1536 BigintCompare, |
1537 2, | 1537 2, |
1538 RawBigint* left, | 1538 RawBigint* left, |
1539 RawBigint* right) { | 1539 RawBigint* right) { |
1540 Isolate* isolate = Isolate::Current(); | 1540 Isolate* isolate = Isolate::Current(); |
1541 StackZone zone(isolate); | 1541 StackZone zone(isolate); |
1542 HANDLESCOPE(isolate); | 1542 HANDLESCOPE(isolate); |
1543 const Bigint& big_left = Bigint::Handle(left); | 1543 const Bigint& big_left = Bigint::Handle(left); |
1544 const Bigint& big_right = Bigint::Handle(right); | 1544 const Bigint& big_right = Bigint::Handle(right); |
1545 return BigintOperations::Compare(big_left, big_right); | 1545 return big_left.CompareWith(big_right); |
1546 } | 1546 } |
1547 END_LEAF_RUNTIME_ENTRY | 1547 END_LEAF_RUNTIME_ENTRY |
1548 | 1548 |
1549 | 1549 |
1550 double DartModulo(double left, double right) { | 1550 double DartModulo(double left, double right) { |
1551 double remainder = fmod_ieee(left, right); | 1551 double remainder = fmod_ieee(left, right); |
1552 if (remainder == 0.0) { | 1552 if (remainder == 0.0) { |
1553 // We explicitely switch to the positive 0.0 (just in case it was negative). | 1553 // We explicitely switch to the positive 0.0 (just in case it was negative). |
1554 remainder = +0.0; | 1554 remainder = +0.0; |
1555 } else if (remainder < 0.0) { | 1555 } else if (remainder < 0.0) { |
(...skipping 25 matching lines...) Expand all Loading... |
1581 field.RecordStore(value); | 1581 field.RecordStore(value); |
1582 } | 1582 } |
1583 | 1583 |
1584 | 1584 |
1585 DEFINE_RUNTIME_ENTRY(InitStaticField, 1) { | 1585 DEFINE_RUNTIME_ENTRY(InitStaticField, 1) { |
1586 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); | 1586 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); |
1587 field.EvaluateInitializer(); | 1587 field.EvaluateInitializer(); |
1588 } | 1588 } |
1589 | 1589 |
1590 } // namespace dart | 1590 } // namespace dart |
OLD | NEW |