Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: test/cctest/test-compiler.cc

Issue 10878007: Index script compilation cache over context (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Respect language flags. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 } 113 }
114 114
115 115
116 static Handle<JSFunction> Compile(const char* source) { 116 static Handle<JSFunction> Compile(const char* source) {
117 Handle<String> source_code(FACTORY->NewStringFromUtf8(CStrVector(source))); 117 Handle<String> source_code(FACTORY->NewStringFromUtf8(CStrVector(source)));
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 Handle<Context>(Isolate::Current()->native_context()),
123 NULL, 124 NULL,
124 NULL, 125 NULL,
125 Handle<String>::null(), 126 Handle<String>::null(),
126 NOT_NATIVES_CODE); 127 NOT_NATIVES_CODE);
127 return FACTORY->NewFunctionFromSharedFunctionInfo(shared_function, 128 return FACTORY->NewFunctionFromSharedFunctionInfo(shared_function,
128 Isolate::Current()->native_context()); 129 Isolate::Current()->native_context());
129 } 130 }
130 131
131 132
132 static double Inc(int x) { 133 static double Inc(int x) {
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 CompileRun("function f() { a = 12345678 }; f();"); 430 CompileRun("function f() { a = 12345678 }; f();");
430 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); 431 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f"));
431 CompileRun("function f(x) { a = 12345678 + x}; f(1);"); 432 CompileRun("function f(x) { a = 12345678 + x}; f(1);");
432 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); 433 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f"));
433 CompileRun("function f(x) { var arguments = 1; x += 12345678}; f(1);"); 434 CompileRun("function f(x) { var arguments = 1; x += 12345678}; f(1);");
434 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); 435 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f"));
435 CompileRun("function f(x) { var arguments = 1; x = 12345678}; f(1);"); 436 CompileRun("function f(x) { var arguments = 1; x = 12345678}; f(1);");
436 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); 437 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f"));
437 } 438 }
438 #endif 439 #endif
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698