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

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

Issue 8133020: Simplify calling generated code from the runtime. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 2 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
« src/ic.cc ('K') | « src/runtime.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2011 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
11 // with the distribution. 11 // with the distribution.
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 Handle<JSObject> global(Isolate::Current()->context()->global()); 298 Handle<JSObject> global(Isolate::Current()->context()->global());
299 Execution::Call(fun0, global, 0, NULL, &has_pending_exception); 299 Execution::Call(fun0, global, 0, NULL, &has_pending_exception);
300 CHECK(!has_pending_exception); 300 CHECK(!has_pending_exception);
301 301
302 Object* foo_symbol = FACTORY->LookupAsciiSymbol("foo")->ToObjectChecked(); 302 Object* foo_symbol = FACTORY->LookupAsciiSymbol("foo")->ToObjectChecked();
303 MaybeObject* fun1_object = Isolate::Current()->context()->global()-> 303 MaybeObject* fun1_object = Isolate::Current()->context()->global()->
304 GetProperty(String::cast(foo_symbol)); 304 GetProperty(String::cast(foo_symbol));
305 Handle<Object> fun1(fun1_object->ToObjectChecked()); 305 Handle<Object> fun1(fun1_object->ToObjectChecked());
306 CHECK(fun1->IsJSFunction()); 306 CHECK(fun1->IsJSFunction());
307 307
308 Object** argv[1] = { 308 Handle<Object> argv[] = { FACTORY->LookupAsciiSymbol("hello") };
309 Handle<Object>::cast(FACTORY->LookupAsciiSymbol("hello")).location() 309 Execution::Call(Handle<JSFunction>::cast(fun1),
310 }; 310 global,
311 Execution::Call(Handle<JSFunction>::cast(fun1), global, 1, argv, 311 ARRAY_SIZE(argv),
312 argv,
312 &has_pending_exception); 313 &has_pending_exception);
313 CHECK(!has_pending_exception); 314 CHECK(!has_pending_exception);
314 } 315 }
315 316
316 317
317 // Regression 236. Calling InitLineEnds on a Script with undefined 318 // Regression 236. Calling InitLineEnds on a Script with undefined
318 // source resulted in crash. 319 // source resulted in crash.
319 TEST(Regression236) { 320 TEST(Regression236) {
320 InitializeVM(); 321 InitializeVM();
321 v8::HandleScope scope; 322 v8::HandleScope scope;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 CompileRun("function f() { a = 12345678 }; f();"); 397 CompileRun("function f() { a = 12345678 }; f();");
397 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); 398 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f"));
398 CompileRun("function f(x) { a = 12345678 + x}; f(1);"); 399 CompileRun("function f(x) { a = 12345678 + x}; f(1);");
399 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); 400 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f"));
400 CompileRun("function f(x) { var arguments = 1; x += 12345678}; f(1);"); 401 CompileRun("function f(x) { var arguments = 1; x += 12345678}; f(1);");
401 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); 402 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f"));
402 CompileRun("function f(x) { var arguments = 1; x = 12345678}; f(1);"); 403 CompileRun("function f(x) { var arguments = 1; x = 12345678}; f(1);");
403 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); 404 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f"));
404 } 405 }
405 #endif 406 #endif
OLDNEW
« src/ic.cc ('K') | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698