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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 for (int i = 0; i < data_size; i++) { | 130 for (int i = 0; i < data_size; i++) { |
131 CHECK(src_buffer[i] == to_non_zero(i)); | 131 CHECK(src_buffer[i] == to_non_zero(i)); |
132 } | 132 } |
133 } | 133 } |
134 | 134 |
135 | 135 |
136 typedef int (*F5)(void*, void*, void*, void*, void*); | 136 typedef int (*F5)(void*, void*, void*, void*, void*); |
137 | 137 |
138 | 138 |
139 TEST(LoadAndStoreWithRepresentation) { | 139 TEST(LoadAndStoreWithRepresentation) { |
| 140 v8::internal::V8::Initialize(NULL); |
| 141 |
140 // Allocate an executable page of memory. | 142 // Allocate an executable page of memory. |
141 size_t actual_size; | 143 size_t actual_size; |
142 byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 144 byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( |
143 Assembler::kMinimalBufferSize, &actual_size, true)); | 145 Assembler::kMinimalBufferSize, &actual_size, true)); |
144 CHECK(buffer); | 146 CHECK(buffer); |
145 Isolate* isolate = CcTest::i_isolate(); | 147 Isolate* isolate = CcTest::i_isolate(); |
146 HandleScope handles(isolate); | 148 HandleScope handles(isolate); |
147 MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size)); | 149 MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size)); |
148 MacroAssembler* masm = &assembler; // Create a pointer for the __ macro. | 150 MacroAssembler* masm = &assembler; // Create a pointer for the __ macro. |
149 __ sub(sp, sp, Operand(1 * kPointerSize)); | 151 __ sub(sp, sp, Operand(1 * kPointerSize)); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 masm->GetCode(&desc); | 220 masm->GetCode(&desc); |
219 Handle<Code> code = isolate->factory()->NewCode( | 221 Handle<Code> code = isolate->factory()->NewCode( |
220 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 222 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
221 | 223 |
222 // Call the function from C++. | 224 // Call the function from C++. |
223 F5 f = FUNCTION_CAST<F5>(code->entry()); | 225 F5 f = FUNCTION_CAST<F5>(code->entry()); |
224 CHECK_EQ(0, CALL_GENERATED_CODE(f, 0, 0, 0, 0, 0)); | 226 CHECK_EQ(0, CALL_GENERATED_CODE(f, 0, 0, 0, 0, 0)); |
225 } | 227 } |
226 | 228 |
227 #undef __ | 229 #undef __ |
OLD | NEW |