OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 // Allocate an executable page of memory. | 141 // Allocate an executable page of memory. |
142 size_t actual_size; | 142 size_t actual_size; |
143 byte* buffer = static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize, | 143 byte* buffer = static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize, |
144 &actual_size, | 144 &actual_size, |
145 true)); | 145 true)); |
146 CHECK(buffer); | 146 CHECK(buffer); |
147 Isolate* isolate = CcTest::i_isolate(); | 147 Isolate* isolate = CcTest::i_isolate(); |
148 HandleScope handles(isolate); | 148 HandleScope handles(isolate); |
149 MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size)); | 149 MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size)); |
150 MacroAssembler* masm = &assembler; // Create a pointer for the __ macro. | 150 MacroAssembler* masm = &assembler; // Create a pointer for the __ macro. |
151 masm->set_allow_stub_calls(false); | |
152 __ sub(sp, sp, Operand(1 * kPointerSize)); | 151 __ sub(sp, sp, Operand(1 * kPointerSize)); |
153 Label exit; | 152 Label exit; |
154 | 153 |
155 // Test 1. | 154 // Test 1. |
156 __ mov(r0, Operand(1)); // Test number. | 155 __ mov(r0, Operand(1)); // Test number. |
157 __ mov(r1, Operand(0)); | 156 __ mov(r1, Operand(0)); |
158 __ str(r1, MemOperand(sp, 0 * kPointerSize)); | 157 __ str(r1, MemOperand(sp, 0 * kPointerSize)); |
159 __ mov(r2, Operand(-1)); | 158 __ mov(r2, Operand(-1)); |
160 __ Store(r2, MemOperand(sp, 0 * kPointerSize), Representation::UInteger8()); | 159 __ Store(r2, MemOperand(sp, 0 * kPointerSize), Representation::UInteger8()); |
161 __ ldr(r3, MemOperand(sp, 0 * kPointerSize)); | 160 __ ldr(r3, MemOperand(sp, 0 * kPointerSize)); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 Code::ComputeFlags(Code::STUB), | 223 Code::ComputeFlags(Code::STUB), |
225 Handle<Code>())->ToObjectChecked(); | 224 Handle<Code>())->ToObjectChecked(); |
226 CHECK(code->IsCode()); | 225 CHECK(code->IsCode()); |
227 | 226 |
228 // Call the function from C++. | 227 // Call the function from C++. |
229 F5 f = FUNCTION_CAST<F5>(Code::cast(code)->entry()); | 228 F5 f = FUNCTION_CAST<F5>(Code::cast(code)->entry()); |
230 CHECK_EQ(0, CALL_GENERATED_CODE(f, 0, 0, 0, 0, 0)); | 229 CHECK_EQ(0, CALL_GENERATED_CODE(f, 0, 0, 0, 0, 0)); |
231 } | 230 } |
232 | 231 |
233 #undef __ | 232 #undef __ |
OLD | NEW |