| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 | 187 |
| 188 Assembler assm(isolate, NULL, 0); | 188 Assembler assm(isolate, NULL, 0); |
| 189 | 189 |
| 190 AssembleLoadExcl(&assm, access1, r1, r1); | 190 AssembleLoadExcl(&assm, access1, r1, r1); |
| 191 AssembleMemoryAccess(&assm, access2, r3, r2, r1); | 191 AssembleMemoryAccess(&assm, access2, r3, r2, r1); |
| 192 AssembleStoreExcl(&assm, access3, r0, r3, r1); | 192 AssembleStoreExcl(&assm, access3, r0, r3, r1); |
| 193 | 193 |
| 194 __ mov(pc, Operand(lr)); | 194 __ mov(pc, Operand(lr)); |
| 195 | 195 |
| 196 CodeDesc desc; | 196 CodeDesc desc; |
| 197 assm.GetCode(&desc); | 197 assm.GetCode(isolate, &desc); |
| 198 Handle<Code> code = isolate->factory()->NewCode( | 198 Handle<Code> code = isolate->factory()->NewCode( |
| 199 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 199 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
| 200 F3 f = FUNCTION_CAST<F3>(code->entry()); | 200 F3 f = FUNCTION_CAST<F3>(code->entry()); |
| 201 TestData t = initial_data; | 201 TestData t = initial_data; |
| 202 | 202 |
| 203 int res = | 203 int res = |
| 204 reinterpret_cast<int>(CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0)); | 204 reinterpret_cast<int>(CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0)); |
| 205 CHECK_EQ(expected_res, res); | 205 CHECK_EQ(expected_res, res); |
| 206 switch (access3.size) { | 206 switch (access3.size) { |
| 207 case MemoryAccess::Size::Byte: | 207 case MemoryAccess::Size::Byte: |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 } | 255 } |
| 256 | 256 |
| 257 static int ExecuteMemoryAccess(Isolate* isolate, TestData* test_data, | 257 static int ExecuteMemoryAccess(Isolate* isolate, TestData* test_data, |
| 258 MemoryAccess access) { | 258 MemoryAccess access) { |
| 259 HandleScope scope(isolate); | 259 HandleScope scope(isolate); |
| 260 Assembler assm(isolate, NULL, 0); | 260 Assembler assm(isolate, NULL, 0); |
| 261 AssembleMemoryAccess(&assm, access, r0, r2, r1); | 261 AssembleMemoryAccess(&assm, access, r0, r2, r1); |
| 262 __ bx(lr); | 262 __ bx(lr); |
| 263 | 263 |
| 264 CodeDesc desc; | 264 CodeDesc desc; |
| 265 assm.GetCode(&desc); | 265 assm.GetCode(isolate, &desc); |
| 266 Handle<Code> code = isolate->factory()->NewCode( | 266 Handle<Code> code = isolate->factory()->NewCode( |
| 267 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 267 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
| 268 F3 f = FUNCTION_CAST<F3>(code->entry()); | 268 F3 f = FUNCTION_CAST<F3>(code->entry()); |
| 269 | 269 |
| 270 return reinterpret_cast<int>( | 270 return reinterpret_cast<int>( |
| 271 CALL_GENERATED_CODE(isolate, f, test_data, 0, 0, 0, 0)); | 271 CALL_GENERATED_CODE(isolate, f, test_data, 0, 0, 0, 0)); |
| 272 } | 272 } |
| 273 | 273 |
| 274 class MemoryAccessThread : public v8::base::Thread { | 274 class MemoryAccessThread : public v8::base::Thread { |
| 275 public: | 275 public: |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 CHECK_EQ(1, ExecuteMemoryAccess(isolate, &test_data, strex_w)); | 378 CHECK_EQ(1, ExecuteMemoryAccess(isolate, &test_data, strex_w)); |
| 379 CHECK_EQ(1, test_data.w); | 379 CHECK_EQ(1, test_data.w); |
| 380 | 380 |
| 381 thread.Finish(); | 381 thread.Finish(); |
| 382 thread.Join(); | 382 thread.Join(); |
| 383 } | 383 } |
| 384 | 384 |
| 385 #undef __ | 385 #undef __ |
| 386 | 386 |
| 387 #endif // USE_SIMULATOR | 387 #endif // USE_SIMULATOR |
| OLD | NEW |