Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: test/cctest/test-assembler-x64.cc

Issue 6597029: [Isolates] Merge r 6300:6500 from bleeding_edge to isolates. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/cctest/test-assembler-mips.cc ('k') | test/es5conform/es5conform.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 30 matching lines...) Expand all
41 using v8::internal::Operand; 41 using v8::internal::Operand;
42 using v8::internal::Immediate; 42 using v8::internal::Immediate;
43 using v8::internal::Label; 43 using v8::internal::Label;
44 using v8::internal::rax; 44 using v8::internal::rax;
45 using v8::internal::rsi; 45 using v8::internal::rsi;
46 using v8::internal::rdi; 46 using v8::internal::rdi;
47 using v8::internal::rcx; 47 using v8::internal::rcx;
48 using v8::internal::rdx; 48 using v8::internal::rdx;
49 using v8::internal::rbp; 49 using v8::internal::rbp;
50 using v8::internal::rsp; 50 using v8::internal::rsp;
51 using v8::internal::r8;
52 using v8::internal::r9;
53 using v8::internal::r12;
54 using v8::internal::r13;
55 using v8::internal::times_1;
56
51 using v8::internal::FUNCTION_CAST; 57 using v8::internal::FUNCTION_CAST;
52 using v8::internal::CodeDesc; 58 using v8::internal::CodeDesc;
53 using v8::internal::less_equal; 59 using v8::internal::less_equal;
54 using v8::internal::not_equal; 60 using v8::internal::not_equal;
55 using v8::internal::greater; 61 using v8::internal::greater;
56 62
57 // Test the x64 assembler by compiling some simple functions into 63 // Test the x64 assembler by compiling some simple functions into
58 // a buffer and executing them. These tests do not initialize the 64 // a buffer and executing them. These tests do not initialize the
59 // V8 library, create a context, or use any V8 objects. 65 // V8 library, create a context, or use any V8 objects.
60 // The AMD64 calling convention is used, with the first six arguments 66 // The AMD64 calling convention is used, with the first six arguments
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 __ movq(rax, Immediate(0)); 295 __ movq(rax, Immediate(0));
290 __ ret(0); 296 __ ret(0);
291 297
292 CodeDesc desc; 298 CodeDesc desc;
293 assm.GetCode(&desc); 299 assm.GetCode(&desc);
294 // Call the function from C++. 300 // Call the function from C++.
295 int result = FUNCTION_CAST<F0>(buffer)(); 301 int result = FUNCTION_CAST<F0>(buffer)();
296 CHECK_EQ(1, result); 302 CHECK_EQ(1, result);
297 } 303 }
298 304
305
306 TEST(OperandRegisterDependency) {
307 int offsets[4] = {0, 1, 0xfed, 0xbeefcad};
308 for (int i = 0; i < 4; i++) {
309 int offset = offsets[i];
310 CHECK(Operand(rax, offset).AddressUsesRegister(rax));
311 CHECK(!Operand(rax, offset).AddressUsesRegister(r8));
312 CHECK(!Operand(rax, offset).AddressUsesRegister(rcx));
313
314 CHECK(Operand(rax, rax, times_1, offset).AddressUsesRegister(rax));
315 CHECK(!Operand(rax, rax, times_1, offset).AddressUsesRegister(r8));
316 CHECK(!Operand(rax, rax, times_1, offset).AddressUsesRegister(rcx));
317
318 CHECK(Operand(rax, rcx, times_1, offset).AddressUsesRegister(rax));
319 CHECK(Operand(rax, rcx, times_1, offset).AddressUsesRegister(rcx));
320 CHECK(!Operand(rax, rcx, times_1, offset).AddressUsesRegister(r8));
321 CHECK(!Operand(rax, rcx, times_1, offset).AddressUsesRegister(r9));
322 CHECK(!Operand(rax, rcx, times_1, offset).AddressUsesRegister(rdx));
323 CHECK(!Operand(rax, rcx, times_1, offset).AddressUsesRegister(rsp));
324
325 CHECK(Operand(rsp, offset).AddressUsesRegister(rsp));
326 CHECK(!Operand(rsp, offset).AddressUsesRegister(rax));
327 CHECK(!Operand(rsp, offset).AddressUsesRegister(r12));
328
329 CHECK(Operand(rbp, offset).AddressUsesRegister(rbp));
330 CHECK(!Operand(rbp, offset).AddressUsesRegister(rax));
331 CHECK(!Operand(rbp, offset).AddressUsesRegister(r13));
332
333 CHECK(Operand(rbp, rax, times_1, offset).AddressUsesRegister(rbp));
334 CHECK(Operand(rbp, rax, times_1, offset).AddressUsesRegister(rax));
335 CHECK(!Operand(rbp, rax, times_1, offset).AddressUsesRegister(rcx));
336 CHECK(!Operand(rbp, rax, times_1, offset).AddressUsesRegister(r13));
337 CHECK(!Operand(rbp, rax, times_1, offset).AddressUsesRegister(r8));
338 CHECK(!Operand(rbp, rax, times_1, offset).AddressUsesRegister(rsp));
339
340 CHECK(Operand(rsp, rbp, times_1, offset).AddressUsesRegister(rsp));
341 CHECK(Operand(rsp, rbp, times_1, offset).AddressUsesRegister(rbp));
342 CHECK(!Operand(rsp, rbp, times_1, offset).AddressUsesRegister(rax));
343 CHECK(!Operand(rsp, rbp, times_1, offset).AddressUsesRegister(r12));
344 CHECK(!Operand(rsp, rbp, times_1, offset).AddressUsesRegister(r13));
345 }
346 }
347
299 #undef __ 348 #undef __
OLDNEW
« no previous file with comments | « test/cctest/test-assembler-mips.cc ('k') | test/es5conform/es5conform.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698