| 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 1537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1548 __ incq(rax); | 1548 __ incq(rax); |
| 1549 } | 1549 } |
| 1550 } | 1550 } |
| 1551 | 1551 |
| 1552 | 1552 |
| 1553 TEST(SmiIndex) { | 1553 TEST(SmiIndex) { |
| 1554 i::V8::Initialize(NULL); | 1554 i::V8::Initialize(NULL); |
| 1555 // Allocate an executable page of memory. | 1555 // Allocate an executable page of memory. |
| 1556 size_t actual_size; | 1556 size_t actual_size; |
| 1557 byte* buffer = | 1557 byte* buffer = |
| 1558 static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize * 4, | 1558 static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize * 5, |
| 1559 &actual_size, | 1559 &actual_size, |
| 1560 true)); | 1560 true)); |
| 1561 CHECK(buffer); | 1561 CHECK(buffer); |
| 1562 Isolate* isolate = CcTest::i_isolate(); | 1562 Isolate* isolate = CcTest::i_isolate(); |
| 1563 HandleScope handles(isolate); | 1563 HandleScope handles(isolate); |
| 1564 MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size)); | 1564 MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size)); |
| 1565 | 1565 |
| 1566 MacroAssembler* masm = &assembler; | 1566 MacroAssembler* masm = &assembler; |
| 1567 EntryCode(masm); | 1567 EntryCode(masm); |
| 1568 Label exit; | 1568 Label exit; |
| (...skipping 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2804 | 2804 |
| 2805 CodeDesc desc; | 2805 CodeDesc desc; |
| 2806 masm->GetCode(&desc); | 2806 masm->GetCode(&desc); |
| 2807 // Call the function from C++. | 2807 // Call the function from C++. |
| 2808 int result = FUNCTION_CAST<F0>(buffer)(); | 2808 int result = FUNCTION_CAST<F0>(buffer)(); |
| 2809 CHECK_EQ(0, result); | 2809 CHECK_EQ(0, result); |
| 2810 } | 2810 } |
| 2811 | 2811 |
| 2812 | 2812 |
| 2813 #undef __ | 2813 #undef __ |
| OLD | NEW |