| 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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 assm.GetCode(&desc); | 515 assm.GetCode(&desc); |
| 516 | 516 |
| 517 Object* code = isolate->heap()->CreateCode( | 517 Object* code = isolate->heap()->CreateCode( |
| 518 desc, | 518 desc, |
| 519 Code::ComputeFlags(Code::STUB), | 519 Code::ComputeFlags(Code::STUB), |
| 520 Handle<Code>())->ToObjectChecked(); | 520 Handle<Code>())->ToObjectChecked(); |
| 521 CHECK(code->IsCode()); | 521 CHECK(code->IsCode()); |
| 522 | 522 |
| 523 F0 f = FUNCTION_CAST<F0>(Code::cast(code)->entry()); | 523 F0 f = FUNCTION_CAST<F0>(Code::cast(code)->entry()); |
| 524 int res = f(); | 524 int res = f(); |
| 525 args.GetReturnValue().Set(v8::Integer::New(res)); | 525 args.GetReturnValue().Set(v8::Integer::New(CcTest::isolate(), res)); |
| 526 } | 526 } |
| 527 | 527 |
| 528 | 528 |
| 529 TEST(StackAlignmentForSSE2) { | 529 TEST(StackAlignmentForSSE2) { |
| 530 CcTest::InitializeVM(); | 530 CcTest::InitializeVM(); |
| 531 if (!CpuFeatures::IsSupported(SSE2)) return; | 531 if (!CpuFeatures::IsSupported(SSE2)) return; |
| 532 | 532 |
| 533 CHECK_EQ(0, OS::ActivationFrameAlignment() % 16); | 533 CHECK_EQ(0, OS::ActivationFrameAlignment() % 16); |
| 534 | 534 |
| 535 v8::Isolate* isolate = CcTest::isolate(); | 535 v8::Isolate* isolate = CcTest::isolate(); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 #ifdef OBJECT_PRINT | 634 #ifdef OBJECT_PRINT |
| 635 Code::cast(code)->Print(); | 635 Code::cast(code)->Print(); |
| 636 #endif | 636 #endif |
| 637 | 637 |
| 638 F8 f = FUNCTION_CAST<F8>(Code::cast(code)->entry()); | 638 F8 f = FUNCTION_CAST<F8>(Code::cast(code)->entry()); |
| 639 CHECK_EQ(2, f(1.0, 2.0)); | 639 CHECK_EQ(2, f(1.0, 2.0)); |
| 640 } | 640 } |
| 641 | 641 |
| 642 | 642 |
| 643 #undef __ | 643 #undef __ |
| OLD | NEW |