OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 typedef Object* (*F1)(int x, int p1, int p2, int p3, int p4); | 42 typedef Object* (*F1)(int x, int p1, int p2, int p3, int p4); |
43 typedef Object* (*F2)(int x, int y, int p2, int p3, int p4); | 43 typedef Object* (*F2)(int x, int y, int p2, int p3, int p4); |
44 typedef Object* (*F3)(void* p, int p1, int p2, int p3, int p4); | 44 typedef Object* (*F3)(void* p, int p1, int p2, int p3, int p4); |
45 | 45 |
46 | 46 |
47 static v8::Persistent<v8::Context> env; | 47 static v8::Persistent<v8::Context> env; |
48 | 48 |
49 | 49 |
50 // The test framework does not accept flags on the command line, so we set them. | 50 // The test framework does not accept flags on the command line, so we set them. |
51 static void InitializeVM() { | 51 static void InitializeVM() { |
52 // Disable compilation of natives by specifying an empty natives file. | 52 // Disable compilation of natives. |
53 FLAG_natives_file = ""; | 53 FLAG_disable_native_files = true; |
54 | 54 |
55 // Enable generation of comments. | 55 // Enable generation of comments. |
56 FLAG_debug_code = true; | 56 FLAG_debug_code = true; |
57 | 57 |
58 if (env.IsEmpty()) { | 58 if (env.IsEmpty()) { |
59 env = v8::Context::New(); | 59 env = v8::Context::New(); |
60 } | 60 } |
61 } | 61 } |
62 | 62 |
63 | 63 |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 #ifdef DEBUG | 248 #ifdef DEBUG |
249 Code::cast(code)->Print(); | 249 Code::cast(code)->Print(); |
250 #endif | 250 #endif |
251 F2 f = FUNCTION_CAST<F2>(Code::cast(code)->entry()); | 251 F2 f = FUNCTION_CAST<F2>(Code::cast(code)->entry()); |
252 int res = reinterpret_cast<int>(CALL_GENERATED_CODE(f, 0xab0, 0xc, 0, 0, 0)); | 252 int res = reinterpret_cast<int>(CALL_GENERATED_CODE(f, 0xab0, 0xc, 0, 0, 0)); |
253 ::printf("f() = %d\n", res); | 253 ::printf("f() = %d\n", res); |
254 CHECK_EQ(0x31415926, res); | 254 CHECK_EQ(0x31415926, res); |
255 } | 255 } |
256 | 256 |
257 #undef __ | 257 #undef __ |
OLD | NEW |