| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 Handle<SharedFunctionInfo> shared_function = | 118 Handle<SharedFunctionInfo> shared_function = |
| 119 Compiler::Compile(source_code, | 119 Compiler::Compile(source_code, |
| 120 Handle<String>(), | 120 Handle<String>(), |
| 121 0, | 121 0, |
| 122 0, | 122 0, |
| 123 NULL, | 123 NULL, |
| 124 NULL, | 124 NULL, |
| 125 Handle<String>::null(), | 125 Handle<String>::null(), |
| 126 NOT_NATIVES_CODE); | 126 NOT_NATIVES_CODE); |
| 127 return FACTORY->NewFunctionFromSharedFunctionInfo(shared_function, | 127 return FACTORY->NewFunctionFromSharedFunctionInfo(shared_function, |
| 128 Isolate::Current()->global_context()); | 128 Isolate::Current()->native_context()); |
| 129 } | 129 } |
| 130 | 130 |
| 131 | 131 |
| 132 static double Inc(int x) { | 132 static double Inc(int x) { |
| 133 const char* source = "result = %d + 1;"; | 133 const char* source = "result = %d + 1;"; |
| 134 EmbeddedVector<char, 512> buffer; | 134 EmbeddedVector<char, 512> buffer; |
| 135 OS::SNPrintF(buffer, source, x); | 135 OS::SNPrintF(buffer, source, x); |
| 136 | 136 |
| 137 Handle<JSFunction> fun = Compile(buffer.start()); | 137 Handle<JSFunction> fun = Compile(buffer.start()); |
| 138 if (fun.is_null()) return -1; | 138 if (fun.is_null()) return -1; |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 CompileRun("function f() { a = 12345678 }; f();"); | 429 CompileRun("function f() { a = 12345678 }; f();"); |
| 430 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); | 430 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); |
| 431 CompileRun("function f(x) { a = 12345678 + x}; f(1);"); | 431 CompileRun("function f(x) { a = 12345678 + x}; f(1);"); |
| 432 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); | 432 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); |
| 433 CompileRun("function f(x) { var arguments = 1; x += 12345678}; f(1);"); | 433 CompileRun("function f(x) { var arguments = 1; x += 12345678}; f(1);"); |
| 434 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); | 434 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); |
| 435 CompileRun("function f(x) { var arguments = 1; x = 12345678}; f(1);"); | 435 CompileRun("function f(x) { var arguments = 1; x = 12345678}; f(1);"); |
| 436 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); | 436 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); |
| 437 } | 437 } |
| 438 #endif | 438 #endif |
| OLD | NEW |