| 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/globals.h"  // Needed here to get TARGET_ARCH_MIPS. | 5 #include "vm/globals.h"  // Needed here to get TARGET_ARCH_MIPS. | 
| 6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) | 
| 7 | 7 | 
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" | 
| 9 | 9 | 
| 10 #include "lib/error.h" | 10 #include "lib/error.h" | 
| (...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1019       break; | 1019       break; | 
| 1020     case kTypedDataUint16ArrayCid: | 1020     case kTypedDataUint16ArrayCid: | 
| 1021     case kTwoByteStringCid: | 1021     case kTwoByteStringCid: | 
| 1022       __ lhu(result, element_address); | 1022       __ lhu(result, element_address); | 
| 1023       __ SmiTag(result); | 1023       __ SmiTag(result); | 
| 1024       break; | 1024       break; | 
| 1025     case kTypedDataInt32ArrayCid: { | 1025     case kTypedDataInt32ArrayCid: { | 
| 1026         Label* deopt = compiler->AddDeoptStub(deopt_id(), kDeoptInt32Load); | 1026         Label* deopt = compiler->AddDeoptStub(deopt_id(), kDeoptInt32Load); | 
| 1027         __ lw(result, element_address); | 1027         __ lw(result, element_address); | 
| 1028         // Verify that the signed value in 'result' can fit inside a Smi. | 1028         // Verify that the signed value in 'result' can fit inside a Smi. | 
| 1029         __ BranchLess(result, 0xC0000000, deopt); | 1029         __ BranchSignedLess(result, 0xC0000000, deopt); | 
| 1030         __ SmiTag(result); | 1030         __ SmiTag(result); | 
| 1031       } | 1031       } | 
| 1032       break; | 1032       break; | 
| 1033     case kTypedDataUint32ArrayCid: { | 1033     case kTypedDataUint32ArrayCid: { | 
| 1034         Label* deopt = compiler->AddDeoptStub(deopt_id(), kDeoptUint32Load); | 1034         Label* deopt = compiler->AddDeoptStub(deopt_id(), kDeoptUint32Load); | 
| 1035         __ lw(result, element_address); | 1035         __ lw(result, element_address); | 
| 1036         // Verify that the unsigned value in 'result' can fit inside a Smi. | 1036         // Verify that the unsigned value in 'result' can fit inside a Smi. | 
| 1037         __ LoadImmediate(TMP1, 0xC0000000); | 1037         __ LoadImmediate(TMP1, 0xC0000000); | 
| 1038         __ and_(CMPRES, result, TMP1); | 1038         __ and_(CMPRES, result, TMP1); | 
| 1039         __ bne(CMPRES, ZR, deopt); | 1039         __ bne(CMPRES, ZR, deopt); | 
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1728 | 1728 | 
| 1729 | 1729 | 
| 1730 void CheckStackOverflowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1730 void CheckStackOverflowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 
| 1731   __ TraceSimMsg("CheckStackOverflowInstr"); | 1731   __ TraceSimMsg("CheckStackOverflowInstr"); | 
| 1732   CheckStackOverflowSlowPath* slow_path = new CheckStackOverflowSlowPath(this); | 1732   CheckStackOverflowSlowPath* slow_path = new CheckStackOverflowSlowPath(this); | 
| 1733   compiler->AddSlowPathCode(slow_path); | 1733   compiler->AddSlowPathCode(slow_path); | 
| 1734 | 1734 | 
| 1735   __ LoadImmediate(TMP1, Isolate::Current()->stack_limit_address()); | 1735   __ LoadImmediate(TMP1, Isolate::Current()->stack_limit_address()); | 
| 1736 | 1736 | 
| 1737   __ lw(TMP1, Address(TMP1)); | 1737   __ lw(TMP1, Address(TMP1)); | 
| 1738   __ BranchLessEqual(SP, TMP1, slow_path->entry_label()); | 1738   __ BranchUnsignedLessEqual(SP, TMP1, slow_path->entry_label()); | 
| 1739 | 1739 | 
| 1740   __ Bind(slow_path->exit_label()); | 1740   __ Bind(slow_path->exit_label()); | 
| 1741 } | 1741 } | 
| 1742 | 1742 | 
| 1743 | 1743 | 
| 1744 LocationSummary* BinarySmiOpInstr::MakeLocationSummary() const { | 1744 LocationSummary* BinarySmiOpInstr::MakeLocationSummary() const { | 
| 1745   const intptr_t kNumInputs = 2; | 1745   const intptr_t kNumInputs = 2; | 
| 1746   if (op_kind() == Token::kTRUNCDIV) { | 1746   if (op_kind() == Token::kTRUNCDIV) { | 
| 1747     UNIMPLEMENTED(); | 1747     UNIMPLEMENTED(); | 
| 1748     return NULL; | 1748     return NULL; | 
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2292     // Unconditionally deoptimize for constant bounds checks because they | 2292     // Unconditionally deoptimize for constant bounds checks because they | 
| 2293     // only occur only when index is out-of-bounds. | 2293     // only occur only when index is out-of-bounds. | 
| 2294     __ b(deopt); | 2294     __ b(deopt); | 
| 2295     return; | 2295     return; | 
| 2296   } | 2296   } | 
| 2297 | 2297 | 
| 2298   if (locs()->in(1).IsConstant()) { | 2298   if (locs()->in(1).IsConstant()) { | 
| 2299     Register length = locs()->in(0).reg(); | 2299     Register length = locs()->in(0).reg(); | 
| 2300     const Object& constant = locs()->in(1).constant(); | 2300     const Object& constant = locs()->in(1).constant(); | 
| 2301     ASSERT(constant.IsSmi()); | 2301     ASSERT(constant.IsSmi()); | 
| 2302     __ BranchLessEqual(length, reinterpret_cast<int32_t>(constant.raw()), | 2302     __ BranchUnsignedLessEqual( | 
| 2303                       deopt); | 2303         length, reinterpret_cast<int32_t>(constant.raw()), deopt); | 
| 2304   } else if (locs()->in(0).IsConstant()) { | 2304   } else if (locs()->in(0).IsConstant()) { | 
| 2305     ASSERT(locs()->in(0).constant().IsSmi()); | 2305     ASSERT(locs()->in(0).constant().IsSmi()); | 
| 2306     const Smi& smi_const = Smi::Cast(locs()->in(0).constant()); | 2306     const Smi& smi_const = Smi::Cast(locs()->in(0).constant()); | 
| 2307     Register index = locs()->in(1).reg(); | 2307     Register index = locs()->in(1).reg(); | 
| 2308     __ BranchGreaterEqual(index, reinterpret_cast<int32_t>(smi_const.raw()), | 2308     __ BranchUnsignedGreaterEqual( | 
| 2309                           deopt); | 2309         index, reinterpret_cast<int32_t>(smi_const.raw()), deopt); | 
| 2310   } else { | 2310   } else { | 
| 2311     Register length = locs()->in(0).reg(); | 2311     Register length = locs()->in(0).reg(); | 
| 2312     Register index = locs()->in(1).reg(); | 2312     Register index = locs()->in(1).reg(); | 
| 2313     __ BranchGreaterEqual(index, length, deopt); | 2313     __ BranchUnsignedGreaterEqual(index, length, deopt); | 
| 2314   } | 2314   } | 
| 2315 } | 2315 } | 
| 2316 | 2316 | 
| 2317 | 2317 | 
| 2318 LocationSummary* UnboxIntegerInstr::MakeLocationSummary() const { | 2318 LocationSummary* UnboxIntegerInstr::MakeLocationSummary() const { | 
| 2319   UNIMPLEMENTED(); | 2319   UNIMPLEMENTED(); | 
| 2320   return NULL; | 2320   return NULL; | 
| 2321 } | 2321 } | 
| 2322 | 2322 | 
| 2323 | 2323 | 
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2692                          &label, | 2692                          &label, | 
| 2693                          PcDescriptors::kOther, | 2693                          PcDescriptors::kOther, | 
| 2694                          locs()); | 2694                          locs()); | 
| 2695   __ Drop(2);  // Discard type arguments and receiver. | 2695   __ Drop(2);  // Discard type arguments and receiver. | 
| 2696 } | 2696 } | 
| 2697 | 2697 | 
| 2698 }  // namespace dart | 2698 }  // namespace dart | 
| 2699 | 2699 | 
| 2700 #endif  // defined TARGET_ARCH_MIPS | 2700 #endif  // defined TARGET_ARCH_MIPS | 
| 2701 | 2701 | 
| OLD | NEW | 
|---|