OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 | 44 |
45 static void DummyStaticFunction(Object* result) { | 45 static void DummyStaticFunction(Object* result) { |
46 } | 46 } |
47 | 47 |
48 | 48 |
49 TEST(DisasmX64) { | 49 TEST(DisasmX64) { |
50 CcTest::InitializeVM(); | 50 CcTest::InitializeVM(); |
51 v8::HandleScope scope; | 51 v8::HandleScope scope; |
52 v8::internal::byte buffer[2048]; | 52 v8::internal::byte buffer[2048]; |
53 Assembler assm(Isolate::Current(), buffer, sizeof buffer); | 53 Assembler assm(CcTest::i_isolate(), buffer, sizeof buffer); |
54 DummyStaticFunction(NULL); // just bloody use it (DELETE; debugging) | 54 DummyStaticFunction(NULL); // just bloody use it (DELETE; debugging) |
55 | 55 |
56 // Short immediate instructions | 56 // Short immediate instructions |
57 __ addq(rax, Immediate(12345678)); | 57 __ addq(rax, Immediate(12345678)); |
58 __ or_(rax, Immediate(12345678)); | 58 __ or_(rax, Immediate(12345678)); |
59 __ subq(rax, Immediate(12345678)); | 59 __ subq(rax, Immediate(12345678)); |
60 __ xor_(rax, Immediate(12345678)); | 60 __ xor_(rax, Immediate(12345678)); |
61 __ and_(rax, Immediate(12345678)); | 61 __ and_(rax, Immediate(12345678)); |
62 | 62 |
63 // ---- This one caused crash | 63 // ---- This one caused crash |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 | 232 |
233 Label L1, L2; | 233 Label L1, L2; |
234 __ bind(&L1); | 234 __ bind(&L1); |
235 __ nop(); | 235 __ nop(); |
236 __ call(&L1); | 236 __ call(&L1); |
237 __ call(&L2); | 237 __ call(&L2); |
238 __ nop(); | 238 __ nop(); |
239 __ bind(&L2); | 239 __ bind(&L2); |
240 __ call(Operand(rbx, rcx, times_4, 10000)); | 240 __ call(Operand(rbx, rcx, times_4, 10000)); |
241 __ nop(); | 241 __ nop(); |
242 Handle<Code> ic(Isolate::Current()->builtins()->builtin( | 242 Handle<Code> ic(CcTest::i_isolate()->builtins()->builtin( |
243 Builtins::kLoadIC_Initialize)); | 243 Builtins::kLoadIC_Initialize)); |
244 __ call(ic, RelocInfo::CODE_TARGET); | 244 __ call(ic, RelocInfo::CODE_TARGET); |
245 __ nop(); | 245 __ nop(); |
246 __ nop(); | 246 __ nop(); |
247 | 247 |
248 __ jmp(&L1); | 248 __ jmp(&L1); |
249 __ jmp(Operand(rbx, rcx, times_4, 10000)); | 249 __ jmp(Operand(rbx, rcx, times_4, 10000)); |
250 #ifdef ENABLE_DEBUGGER_SUPPORT | 250 #ifdef ENABLE_DEBUGGER_SUPPORT |
251 ExternalReference after_break_target = | 251 ExternalReference after_break_target = |
252 ExternalReference(Debug_Address::AfterBreakTarget(), | 252 ExternalReference(Debug_Address::AfterBreakTarget(), |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 CHECK(code->IsCode()); | 408 CHECK(code->IsCode()); |
409 #ifdef OBJECT_PRINT | 409 #ifdef OBJECT_PRINT |
410 Code::cast(code)->Print(); | 410 Code::cast(code)->Print(); |
411 byte* begin = Code::cast(code)->instruction_start(); | 411 byte* begin = Code::cast(code)->instruction_start(); |
412 byte* end = begin + Code::cast(code)->instruction_size(); | 412 byte* end = begin + Code::cast(code)->instruction_size(); |
413 disasm::Disassembler::Disassemble(stdout, begin, end); | 413 disasm::Disassembler::Disassemble(stdout, begin, end); |
414 #endif | 414 #endif |
415 } | 415 } |
416 | 416 |
417 #undef __ | 417 #undef __ |
OLD | NEW |