OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 5084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5095 { 4, 1 }, | 5095 { 4, 1 }, |
5096 }; | 5096 }; |
5097 | 5097 |
5098 size_t nr_test_cases = sizeof(tc) / sizeof(TestCaseBal); | 5098 size_t nr_test_cases = sizeof(tc) / sizeof(TestCaseBal); |
5099 for (size_t i = 0; i < nr_test_cases; ++i) { | 5099 for (size_t i = 0; i < nr_test_cases; ++i) { |
5100 CHECK_EQ(tc[i].expected_res, run_bal(tc[i].offset)); | 5100 CHECK_EQ(tc[i].expected_res, run_bal(tc[i].offset)); |
5101 } | 5101 } |
5102 } | 5102 } |
5103 | 5103 |
5104 | 5104 |
5105 TEST(Trampoline) { | |
5106 if (IsMipsArchVariant(kMips32r6)) { | |
paul.l...
2015/11/17 19:59:45
Does this test have to be r6-only? Can we write a
balazs.kilvady
2015/11/18 12:22:53
I am thinking about it. Would be fine.
balazs.kilvady
2015/11/18 14:04:05
Fortunately this test case forces trampoline gener
| |
5107 // Private member of Assembler class. | |
5108 static const int kMaxBranchOffset = (1 << (18 - 1)) - 1; | |
5109 | |
5110 CcTest::InitializeVM(); | |
5111 Isolate* isolate = CcTest::i_isolate(); | |
5112 HandleScope scope(isolate); | |
5113 | |
5114 MacroAssembler assm(isolate, NULL, 0); | |
5115 Label done; | |
5116 size_t nr_calls = kMaxBranchOffset / (2 * Instruction::kInstrSize) + 2; | |
5117 | |
5118 for (size_t i = 0; i < nr_calls; ++i) { | |
5119 __ BranchShort(&done, eq, a0, Operand(a1)); | |
5120 } | |
5121 __ bind(&done); | |
5122 __ Ret(USE_DELAY_SLOT); | |
5123 __ mov(v0, zero_reg); | |
5124 | |
5125 CodeDesc desc; | |
5126 assm.GetCode(&desc); | |
5127 Handle<Code> code = isolate->factory()->NewCode( | |
5128 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | |
5129 F2 f = FUNCTION_CAST<F2>(code->entry()); | |
5130 | |
5131 int32_t res = | |
5132 reinterpret_cast<int32_t>(CALL_GENERATED_CODE(f, 5, 5, 0, 0, 0)); | |
5133 CHECK_EQ(res, 0); | |
5134 } | |
5135 } | |
5136 | |
5137 | |
5105 #undef __ | 5138 #undef __ |
OLD | NEW |