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