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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 Code::ComputeFlags(Code::STUB), | 429 Code::ComputeFlags(Code::STUB), |
430 v8::internal::Handle<Code>())->ToObjectChecked()); | 430 v8::internal::Handle<Code>())->ToObjectChecked()); |
431 CHECK(code->IsCode()); | 431 CHECK(code->IsCode()); |
432 | 432 |
433 F0 f = FUNCTION_CAST<F0>(code->entry()); | 433 F0 f = FUNCTION_CAST<F0>(code->entry()); |
434 int res = f(); | 434 int res = f(); |
435 CHECK_EQ(42, res); | 435 CHECK_EQ(42, res); |
436 } | 436 } |
437 | 437 |
438 | 438 |
439 #ifdef __GNUC__ | 439 #if V8_CC_GNU |
440 #define ELEMENT_COUNT 4 | 440 #define ELEMENT_COUNT 4 |
441 | 441 |
442 void DoSSE2(const v8::FunctionCallbackInfo<v8::Value>& args) { | 442 void DoSSE2(const v8::FunctionCallbackInfo<v8::Value>& args) { |
443 CcTest::InitializeVM(); | 443 CcTest::InitializeVM(); |
444 v8::HandleScope scope(CcTest::isolate()); | 444 v8::HandleScope scope(CcTest::isolate()); |
445 v8::internal::byte buffer[1024]; | 445 v8::internal::byte buffer[1024]; |
446 | 446 |
447 CHECK(args[0]->IsArray()); | 447 CHECK(args[0]->IsArray()); |
448 v8::Local<v8::Array> vec = v8::Local<v8::Array>::Cast(args[0]); | 448 v8::Local<v8::Array> vec = v8::Local<v8::Array>::Cast(args[0]); |
449 CHECK_EQ(ELEMENT_COUNT, vec->Length()); | 449 CHECK_EQ(ELEMENT_COUNT, vec->Length()); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 } | 514 } |
515 | 515 |
516 v8::Local<v8::Value> args[] = { v8_vec }; | 516 v8::Local<v8::Value> args[] = { v8_vec }; |
517 v8::Local<v8::Value> result = foo->Call(global_object, 1, args); | 517 v8::Local<v8::Value> result = foo->Call(global_object, 1, args); |
518 | 518 |
519 // The mask should be 0b1000. | 519 // The mask should be 0b1000. |
520 CHECK_EQ(8, result->Int32Value()); | 520 CHECK_EQ(8, result->Int32Value()); |
521 } | 521 } |
522 | 522 |
523 #undef ELEMENT_COUNT | 523 #undef ELEMENT_COUNT |
524 #endif // __GNUC__ | 524 #endif // V8_CC_GNU |
525 | 525 |
526 | 526 |
527 #undef __ | 527 #undef __ |
OLD | NEW |