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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 args.GetReturnValue().Set(v8::Integer::New(res)); | 525 args.GetReturnValue().Set(v8::Integer::New(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 = v8::Isolate::GetCurrent(); | 535 v8::Isolate* isolate = CcTest::isolate(); |
536 v8::HandleScope handle_scope(isolate); | 536 v8::HandleScope handle_scope(isolate); |
537 v8::Handle<v8::ObjectTemplate> global_template = v8::ObjectTemplate::New(); | 537 v8::Handle<v8::ObjectTemplate> global_template = v8::ObjectTemplate::New(); |
538 global_template->Set(v8_str("do_sse2"), v8::FunctionTemplate::New(DoSSE2)); | 538 global_template->Set(v8_str("do_sse2"), v8::FunctionTemplate::New(DoSSE2)); |
539 | 539 |
540 LocalContext env(NULL, global_template); | 540 LocalContext env(NULL, global_template); |
541 CompileRun( | 541 CompileRun( |
542 "function foo(vec) {" | 542 "function foo(vec) {" |
543 " return do_sse2(vec);" | 543 " return do_sse2(vec);" |
544 "}"); | 544 "}"); |
545 | 545 |
(...skipping 12 matching lines...) Expand all Loading... |
558 | 558 |
559 // The mask should be 0b1000. | 559 // The mask should be 0b1000. |
560 CHECK_EQ(8, result->Int32Value()); | 560 CHECK_EQ(8, result->Int32Value()); |
561 } | 561 } |
562 | 562 |
563 #undef ELEMENT_COUNT | 563 #undef ELEMENT_COUNT |
564 #endif // __GNUC__ | 564 #endif // __GNUC__ |
565 | 565 |
566 | 566 |
567 #undef __ | 567 #undef __ |
OLD | NEW |