OLD | NEW |
1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2008 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 #define __ assm. | 50 #define __ assm. |
51 | 51 |
52 | 52 |
53 static void DummyStaticFunction(Object* result) { | 53 static void DummyStaticFunction(Object* result) { |
54 } | 54 } |
55 | 55 |
56 | 56 |
57 TEST(DisasmIa320) { | 57 TEST(DisasmIa320) { |
58 InitializeVM(); | 58 InitializeVM(); |
59 Serializer::disable(); // Needed for Probe when running without snapshot. | |
60 CpuFeatures::Probe(); | |
61 v8::HandleScope scope; | 59 v8::HandleScope scope; |
62 v8::internal::byte buffer[1024]; | 60 v8::internal::byte buffer[1024]; |
63 Assembler assm(buffer, sizeof buffer); | 61 Assembler assm(buffer, sizeof buffer); |
64 DummyStaticFunction(NULL); // just bloody use it (DELETE; debugging) | 62 DummyStaticFunction(NULL); // just bloody use it (DELETE; debugging) |
65 | 63 |
66 // Short immediate instructions | 64 // Short immediate instructions |
67 __ adc(eax, 12345678); | 65 __ adc(eax, 12345678); |
68 __ add(Operand(eax), Immediate(12345678)); | 66 __ add(Operand(eax), Immediate(12345678)); |
69 __ or_(eax, 12345678); | 67 __ or_(eax, 12345678); |
70 __ sub(Operand(eax), Immediate(12345678)); | 68 __ sub(Operand(eax), Immediate(12345678)); |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 CHECK(code->IsCode()); | 372 CHECK(code->IsCode()); |
375 #ifdef DEBUG | 373 #ifdef DEBUG |
376 Code::cast(code)->Print(); | 374 Code::cast(code)->Print(); |
377 byte* begin = Code::cast(code)->instruction_start(); | 375 byte* begin = Code::cast(code)->instruction_start(); |
378 byte* end = begin + Code::cast(code)->instruction_size(); | 376 byte* end = begin + Code::cast(code)->instruction_size(); |
379 disasm::Disassembler::Disassemble(stdout, begin, end); | 377 disasm::Disassembler::Disassemble(stdout, begin, end); |
380 #endif | 378 #endif |
381 } | 379 } |
382 | 380 |
383 #undef __ | 381 #undef __ |
OLD | NEW |