OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 2724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2735 CompileRun( | 2735 CompileRun( |
2736 "var ab = new ArrayBuffer(1024);" | 2736 "var ab = new ArrayBuffer(1024);" |
2737 "var u8a = new Uint8Array(ab, 1, 1023);" | 2737 "var u8a = new Uint8Array(ab, 1, 1023);" |
2738 "var u8c = new Uint8ClampedArray(ab, 1, 1023);" | 2738 "var u8c = new Uint8ClampedArray(ab, 1, 1023);" |
2739 "var i8a = new Int8Array(ab, 1, 1023);" | 2739 "var i8a = new Int8Array(ab, 1, 1023);" |
2740 "var u16a = new Uint16Array(ab, 2, 511);" | 2740 "var u16a = new Uint16Array(ab, 2, 511);" |
2741 "var i16a = new Int16Array(ab, 2, 511);" | 2741 "var i16a = new Int16Array(ab, 2, 511);" |
2742 "var u32a = new Uint32Array(ab, 4, 255);" | 2742 "var u32a = new Uint32Array(ab, 4, 255);" |
2743 "var i32a = new Int32Array(ab, 4, 255);" | 2743 "var i32a = new Int32Array(ab, 4, 255);" |
2744 "var f32a = new Float32Array(ab, 4, 255);" | 2744 "var f32a = new Float32Array(ab, 4, 255);" |
2745 "var f64a = new Float64Array(ab, 8, 127);"); | 2745 "var f64a = new Float64Array(ab, 8, 127);" |
| 2746 "var dv = new DataView(ab, 1, 1023);"); |
2746 | 2747 |
2747 v8::Handle<v8::ArrayBuffer> ab = | 2748 v8::Handle<v8::ArrayBuffer> ab = |
2748 Local<v8::ArrayBuffer>::Cast(CompileRun("ab")); | 2749 Local<v8::ArrayBuffer>::Cast(CompileRun("ab")); |
2749 | 2750 |
2750 v8::Handle<v8::Uint8Array> u8a = | 2751 v8::Handle<v8::Uint8Array> u8a = |
2751 v8::Handle<v8::Uint8Array>::Cast(CompileRun("u8a")); | 2752 v8::Handle<v8::Uint8Array>::Cast(CompileRun("u8a")); |
2752 v8::Handle<v8::Uint8ClampedArray> u8c = | 2753 v8::Handle<v8::Uint8ClampedArray> u8c = |
2753 v8::Handle<v8::Uint8ClampedArray>::Cast(CompileRun("u8c")); | 2754 v8::Handle<v8::Uint8ClampedArray>::Cast(CompileRun("u8c")); |
2754 v8::Handle<v8::Int8Array> i8a = | 2755 v8::Handle<v8::Int8Array> i8a = |
2755 v8::Handle<v8::Int8Array>::Cast(CompileRun("i8a")); | 2756 v8::Handle<v8::Int8Array>::Cast(CompileRun("i8a")); |
(...skipping 16 matching lines...) Expand all Loading... |
2772 CHECK_EQ(0, static_cast<int>(ab->ByteLength())); | 2773 CHECK_EQ(0, static_cast<int>(ab->ByteLength())); |
2773 CheckIsNeutered(u8a); | 2774 CheckIsNeutered(u8a); |
2774 CheckIsNeutered(u8c); | 2775 CheckIsNeutered(u8c); |
2775 CheckIsNeutered(i8a); | 2776 CheckIsNeutered(i8a); |
2776 CheckIsNeutered(u16a); | 2777 CheckIsNeutered(u16a); |
2777 CheckIsNeutered(i16a); | 2778 CheckIsNeutered(i16a); |
2778 CheckIsNeutered(u32a); | 2779 CheckIsNeutered(u32a); |
2779 CheckIsNeutered(i32a); | 2780 CheckIsNeutered(i32a); |
2780 CheckIsNeutered(f32a); | 2781 CheckIsNeutered(f32a); |
2781 CheckIsNeutered(f64a); | 2782 CheckIsNeutered(f64a); |
| 2783 CHECK(CompileRun("dv.byteLength == 0 && dv.byteOffset == 0")->IsTrue()); |
2782 } | 2784 } |
2783 | 2785 |
2784 | 2786 |
2785 | 2787 |
2786 THREADED_TEST(HiddenProperties) { | 2788 THREADED_TEST(HiddenProperties) { |
2787 LocalContext env; | 2789 LocalContext env; |
2788 v8::HandleScope scope(env->GetIsolate()); | 2790 v8::HandleScope scope(env->GetIsolate()); |
2789 | 2791 |
2790 v8::Local<v8::Object> obj = v8::Object::New(); | 2792 v8::Local<v8::Object> obj = v8::Object::New(); |
2791 v8::Local<v8::String> key = v8_str("api-test::hidden-key"); | 2793 v8::Local<v8::String> key = v8_str("api-test::hidden-key"); |
(...skipping 16545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19337 i::Semaphore* sem_; | 19339 i::Semaphore* sem_; |
19338 volatile int sem_value_; | 19340 volatile int sem_value_; |
19339 }; | 19341 }; |
19340 | 19342 |
19341 | 19343 |
19342 THREADED_TEST(SemaphoreInterruption) { | 19344 THREADED_TEST(SemaphoreInterruption) { |
19343 ThreadInterruptTest().RunTest(); | 19345 ThreadInterruptTest().RunTest(); |
19344 } | 19346 } |
19345 | 19347 |
19346 #endif // WIN32 | 19348 #endif // WIN32 |
OLD | NEW |