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

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

Issue 11272: When probing a dictionary backing storage in generated code, make sure... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 12 years, 1 month 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/ic-ia32.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 2007-2008 the V8 project authors. All rights reserved. 1 // Copyright 2007-2008 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 5303 matching lines...) Expand 10 before | Expand all | Expand 10 after
5314 // multi-threaded setup. 5314 // multi-threaded setup.
5315 TEST(PreCompile) { 5315 TEST(PreCompile) {
5316 // TODO(155): This test would break without the initialization of V8. This is 5316 // TODO(155): This test would break without the initialization of V8. This is
5317 // a workaround for now to make this test not fail. 5317 // a workaround for now to make this test not fail.
5318 v8::V8::Initialize(); 5318 v8::V8::Initialize();
5319 const char *script = "function foo(a) { return a+1; }"; 5319 const char *script = "function foo(a) { return a+1; }";
5320 v8::ScriptData *sd = v8::ScriptData::PreCompile(script, strlen(script)); 5320 v8::ScriptData *sd = v8::ScriptData::PreCompile(script, strlen(script));
5321 CHECK_NE(sd->Length(), 0); 5321 CHECK_NE(sd->Length(), 0);
5322 CHECK_NE(sd->Data(), NULL); 5322 CHECK_NE(sd->Data(), NULL);
5323 } 5323 }
5324
5325
5326 // This tests that we do not allow dictionary load/call inline caches
5327 // to use functions that have not yet been compiled. The potential
5328 // problem of loading a function that has not yet been compiled can
5329 // arise because we share code between contexts via the compilation
5330 // cache.
5331 THREADED_TEST(DictionaryICLoadedFunction) {
5332 v8::HandleScope scope;
5333 // Test LoadIC.
5334 for (int i = 0; i < 2; i++) {
5335 LocalContext context;
5336 context->Global()->Set(v8_str("tmp"), v8::True());
5337 context->Global()->Delete(v8_str("tmp"));
5338 CompileRun("for (var j = 0; j < 10; j++) new RegExp('');");
5339 }
5340 // Test CallIC.
5341 for (int i = 0; i < 2; i++) {
5342 LocalContext context;
5343 context->Global()->Set(v8_str("tmp"), v8::True());
5344 context->Global()->Delete(v8_str("tmp"));
5345 CompileRun("for (var j = 0; j < 10; j++) RegExp('')");
5346 }
5347 }
OLDNEW
« no previous file with comments | « src/ic-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698