| OLD | NEW |
| 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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 CHECK(Operand(rsp, rbp, times_1, offset).AddressUsesRegister(rbp)); | 354 CHECK(Operand(rsp, rbp, times_1, offset).AddressUsesRegister(rbp)); |
| 355 CHECK(!Operand(rsp, rbp, times_1, offset).AddressUsesRegister(rax)); | 355 CHECK(!Operand(rsp, rbp, times_1, offset).AddressUsesRegister(rax)); |
| 356 CHECK(!Operand(rsp, rbp, times_1, offset).AddressUsesRegister(r15)); | 356 CHECK(!Operand(rsp, rbp, times_1, offset).AddressUsesRegister(r15)); |
| 357 CHECK(!Operand(rsp, rbp, times_1, offset).AddressUsesRegister(r13)); | 357 CHECK(!Operand(rsp, rbp, times_1, offset).AddressUsesRegister(r13)); |
| 358 } | 358 } |
| 359 } | 359 } |
| 360 | 360 |
| 361 | 361 |
| 362 TEST(AssemblerX64LabelChaining) { | 362 TEST(AssemblerX64LabelChaining) { |
| 363 // Test chaining of label usages within instructions (issue 1644). | 363 // Test chaining of label usages within instructions (issue 1644). |
| 364 v8::HandleScope scope; | 364 InitializeVM(); |
| 365 v8::HandleScope scope(env->GetIsolate()); |
| 365 Assembler assm(Isolate::Current(), NULL, 0); | 366 Assembler assm(Isolate::Current(), NULL, 0); |
| 366 | 367 |
| 367 Label target; | 368 Label target; |
| 368 __ j(equal, &target); | 369 __ j(equal, &target); |
| 369 __ j(not_equal, &target); | 370 __ j(not_equal, &target); |
| 370 __ bind(&target); | 371 __ bind(&target); |
| 371 __ nop(); | 372 __ nop(); |
| 372 } | 373 } |
| 373 | 374 |
| 374 | 375 |
| 375 TEST(AssemblerMultiByteNop) { | 376 TEST(AssemblerMultiByteNop) { |
| 376 InitializeVM(); | 377 InitializeVM(); |
| 377 v8::HandleScope scope; | 378 v8::HandleScope scope(env->GetIsolate()); |
| 378 v8::internal::byte buffer[1024]; | 379 v8::internal::byte buffer[1024]; |
| 379 Isolate* isolate = Isolate::Current(); | 380 Isolate* isolate = Isolate::Current(); |
| 380 Assembler assm(isolate, buffer, sizeof(buffer)); | 381 Assembler assm(isolate, buffer, sizeof(buffer)); |
| 381 __ push(rbx); | 382 __ push(rbx); |
| 382 __ push(rcx); | 383 __ push(rcx); |
| 383 __ push(rdx); | 384 __ push(rdx); |
| 384 __ push(rdi); | 385 __ push(rdi); |
| 385 __ push(rsi); | 386 __ push(rsi); |
| 386 __ movq(rax, Immediate(1)); | 387 __ movq(rax, Immediate(1)); |
| 387 __ movq(rbx, Immediate(2)); | 388 __ movq(rbx, Immediate(2)); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 | 435 |
| 435 F0 f = FUNCTION_CAST<F0>(code->entry()); | 436 F0 f = FUNCTION_CAST<F0>(code->entry()); |
| 436 int res = f(); | 437 int res = f(); |
| 437 CHECK_EQ(42, res); | 438 CHECK_EQ(42, res); |
| 438 } | 439 } |
| 439 | 440 |
| 440 | 441 |
| 441 | 442 |
| 442 | 443 |
| 443 #undef __ | 444 #undef __ |
| OLD | NEW |