Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: runtime/vm/intermediate_language.cc

Issue 12038013: Reland r17365. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: replace enter with EnterFrame Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/dart_entry.h" 8 #include "vm/dart_entry.h"
9 #include "vm/flow_graph_allocator.h" 9 #include "vm/flow_graph_allocator.h"
10 #include "vm/flow_graph_builder.h" 10 #include "vm/flow_graph_builder.h"
(...skipping 1532 matching lines...) Expand 10 before | Expand all | Expand 10 after
1543 RawAbstractType* DoubleToSmiInstr::CompileType() const { 1543 RawAbstractType* DoubleToSmiInstr::CompileType() const {
1544 return Type::SmiType(); 1544 return Type::SmiType();
1545 } 1545 }
1546 1546
1547 1547
1548 RawAbstractType* DoubleToDoubleInstr::CompileType() const { 1548 RawAbstractType* DoubleToDoubleInstr::CompileType() const {
1549 return Type::Double(); 1549 return Type::Double();
1550 } 1550 }
1551 1551
1552 1552
1553 RawAbstractType* InvokeMathCFunctionInstr::CompileType() const {
1554 return Type::Double();
1555 }
1556
1557
1553 RawAbstractType* CheckClassInstr::CompileType() const { 1558 RawAbstractType* CheckClassInstr::CompileType() const {
1554 return AbstractType::null(); 1559 return AbstractType::null();
1555 } 1560 }
1556 1561
1557 1562
1558 RawAbstractType* CheckSmiInstr::CompileType() const { 1563 RawAbstractType* CheckSmiInstr::CompileType() const {
1559 return AbstractType::null(); 1564 return AbstractType::null();
1560 } 1565 }
1561 1566
1562 1567
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after
2609 case kFloat64ArrayCid: 2614 case kFloat64ArrayCid:
2610 case kFloat32ArrayCid: 2615 case kFloat32ArrayCid:
2611 case kExternalUint8ArrayCid: 2616 case kExternalUint8ArrayCid:
2612 return ByteArray::length_offset(); 2617 return ByteArray::length_offset();
2613 default: 2618 default:
2614 UNREACHABLE(); 2619 UNREACHABLE();
2615 return -1; 2620 return -1;
2616 } 2621 }
2617 } 2622 }
2618 2623
2624
2625 intptr_t InvokeMathCFunctionInstr::ArgumentCountFor(
2626 MethodRecognizer::Kind kind) {
2627 switch (kind) {
2628 case MethodRecognizer::kDoubleTruncate:
2629 case MethodRecognizer::kDoubleRound:
2630 case MethodRecognizer::kDoubleFloor:
2631 case MethodRecognizer::kDoubleCeil: {
2632 ASSERT(!CPUFeatures::double_truncate_round_supported());
2633 return 1;
2634 }
2635 case MethodRecognizer::kDoublePow:
2636 return 2;
2637 default:
2638 UNREACHABLE();
2639 }
2640 return 0;
2641 }
2642
2643 // Use expected function signatures to help MSVC compiler resolve overloading.
2644 typedef double (*UnaryMathCFunction) (double x);
2645 typedef double (*BinaryMathCFunction) (double x, double y);
2646
2647 extern const RuntimeEntry kPowRuntimeEntry(
2648 "libc_pow", reinterpret_cast<RuntimeFunction>(
2649 static_cast<BinaryMathCFunction>(&pow)), 0, true);
2650
2651 extern const RuntimeEntry kFloorRuntimeEntry(
2652 "libc_floor", reinterpret_cast<RuntimeFunction>(
2653 static_cast<UnaryMathCFunction>(&floor)), 0, true);
2654
2655 extern const RuntimeEntry kCeilRuntimeEntry(
2656 "libc_ceil", reinterpret_cast<RuntimeFunction>(
2657 static_cast<UnaryMathCFunction>(&ceil)), 0, true);
2658
2659 extern const RuntimeEntry kTruncRuntimeEntry(
2660 "libc_trunc", reinterpret_cast<RuntimeFunction>(
2661 static_cast<UnaryMathCFunction>(&trunc)), 0, true);
2662
2663 extern const RuntimeEntry kRoundRuntimeEntry(
2664 "libc_round", reinterpret_cast<RuntimeFunction>(
2665 static_cast<UnaryMathCFunction>(&round)), 0, true);
2666
2667
2668 const RuntimeEntry& InvokeMathCFunctionInstr::TargetFunction() const {
2669 switch (recognized_kind_) {
2670 case MethodRecognizer::kDoubleTruncate:
2671 return kTruncRuntimeEntry;
2672 case MethodRecognizer::kDoubleRound:
2673 return kRoundRuntimeEntry;
2674 case MethodRecognizer::kDoubleFloor:
2675 return kFloorRuntimeEntry;
2676 case MethodRecognizer::kDoubleCeil:
2677 return kCeilRuntimeEntry;
2678 case MethodRecognizer::kDoublePow:
2679 return kPowRuntimeEntry;
2680 default:
2681 UNREACHABLE();
2682 }
2683 return kPowRuntimeEntry;
2684 }
2685
2686
2619 #undef __ 2687 #undef __
2620 2688
2621 } // namespace dart 2689 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698