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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 = v8::ObjectTemplate::New(); |
618 global_template->Set(v8_str("do_sse2"), v8::FunctionTemplate::New(DoSSE2)); | 618 global_template->Set(v8_str("do_sse2"), |
| 619 v8::FunctionTemplate::New(isolate, DoSSE2)); |
619 | 620 |
620 LocalContext env(NULL, global_template); | 621 LocalContext env(NULL, global_template); |
621 CompileRun( | 622 CompileRun( |
622 "function foo(vec) {" | 623 "function foo(vec) {" |
623 " return do_sse2(vec);" | 624 " return do_sse2(vec);" |
624 "}"); | 625 "}"); |
625 | 626 |
626 v8::Local<v8::Object> global_object = env->Global(); | 627 v8::Local<v8::Object> global_object = env->Global(); |
627 v8::Local<v8::Function> foo = | 628 v8::Local<v8::Function> foo = |
628 v8::Local<v8::Function>::Cast(global_object->Get(v8_str("foo"))); | 629 v8::Local<v8::Function>::Cast(global_object->Get(v8_str("foo"))); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 Handle<Code>())->ToObjectChecked()); | 705 Handle<Code>())->ToObjectChecked()); |
705 CHECK(code->IsCode()); | 706 CHECK(code->IsCode()); |
706 #ifdef OBJECT_PRINT | 707 #ifdef OBJECT_PRINT |
707 Code::cast(code)->Print(); | 708 Code::cast(code)->Print(); |
708 #endif | 709 #endif |
709 | 710 |
710 F6 f = FUNCTION_CAST<F6>(Code::cast(code)->entry()); | 711 F6 f = FUNCTION_CAST<F6>(Code::cast(code)->entry()); |
711 CHECK_EQ(2, f(1.0, 2.0)); | 712 CHECK_EQ(2, f(1.0, 2.0)); |
712 } | 713 } |
713 #undef __ | 714 #undef __ |
OLD | NEW |