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 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 args.GetReturnValue().Set(v8::Integer::New(CcTest::isolate(), res)); | 607 args.GetReturnValue().Set(v8::Integer::New(CcTest::isolate(), res)); |
608 } | 608 } |
609 | 609 |
610 | 610 |
611 TEST(StackAlignmentForSSE2) { | 611 TEST(StackAlignmentForSSE2) { |
612 CcTest::InitializeVM(); | 612 CcTest::InitializeVM(); |
613 CHECK_EQ(0, OS::ActivationFrameAlignment() % 16); | 613 CHECK_EQ(0, OS::ActivationFrameAlignment() % 16); |
614 | 614 |
615 v8::Isolate* isolate = CcTest::isolate(); | 615 v8::Isolate* isolate = CcTest::isolate(); |
616 v8::HandleScope handle_scope(isolate); | 616 v8::HandleScope handle_scope(isolate); |
617 v8::Handle<v8::ObjectTemplate> global_template = v8::ObjectTemplate::New(); | 617 v8::Handle<v8::ObjectTemplate> global_template = |
| 618 v8::ObjectTemplate::New(isolate); |
618 global_template->Set(v8_str("do_sse2"), | 619 global_template->Set(v8_str("do_sse2"), |
619 v8::FunctionTemplate::New(isolate, DoSSE2)); | 620 v8::FunctionTemplate::New(isolate, DoSSE2)); |
620 | 621 |
621 LocalContext env(NULL, global_template); | 622 LocalContext env(NULL, global_template); |
622 CompileRun( | 623 CompileRun( |
623 "function foo(vec) {" | 624 "function foo(vec) {" |
624 " return do_sse2(vec);" | 625 " return do_sse2(vec);" |
625 "}"); | 626 "}"); |
626 | 627 |
627 v8::Local<v8::Object> global_object = env->Global(); | 628 v8::Local<v8::Object> global_object = env->Global(); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 Handle<Code>())->ToObjectChecked()); | 706 Handle<Code>())->ToObjectChecked()); |
706 CHECK(code->IsCode()); | 707 CHECK(code->IsCode()); |
707 #ifdef OBJECT_PRINT | 708 #ifdef OBJECT_PRINT |
708 Code::cast(code)->Print(); | 709 Code::cast(code)->Print(); |
709 #endif | 710 #endif |
710 | 711 |
711 F6 f = FUNCTION_CAST<F6>(Code::cast(code)->entry()); | 712 F6 f = FUNCTION_CAST<F6>(Code::cast(code)->entry()); |
712 CHECK_EQ(2, f(1.0, 2.0)); | 713 CHECK_EQ(2, f(1.0, 2.0)); |
713 } | 714 } |
714 #undef __ | 715 #undef __ |
OLD | NEW |