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

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

Issue 291193011: Check for cached transition to ExternalArray elements kind. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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/objects.cc ('K') | « 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 21386 matching lines...) Expand 10 before | Expand all | Expand 10 after
21397 SetterWhichSetsYOnThisTo23); 21397 SetterWhichSetsYOnThisTo23);
21398 context->Global()->Set(v8_str("obj"), templ->NewInstance()); 21398 context->Global()->Set(v8_str("obj"), templ->NewInstance());
21399 21399
21400 CompileRun("function load(x) { return x.foo; }" 21400 CompileRun("function load(x) { return x.foo; }"
21401 "var o = Object.create(obj);" 21401 "var o = Object.create(obj);"
21402 "%OptimizeObjectForAddingMultipleProperties(obj, 1);" 21402 "%OptimizeObjectForAddingMultipleProperties(obj, 1);"
21403 "load(o); load(o); load(o); load(o);"); 21403 "load(o); load(o); load(o); load(o);");
21404 } 21404 }
21405 21405
21406 21406
21407 THREADED_TEST(Regress3337) {
21408 LocalContext context;
21409 v8::Isolate* isolate = context->GetIsolate();
21410 v8::HandleScope scope(isolate);
21411 Local<v8::Object> o1 = Object::New(isolate);
21412 Local<v8::Object> o2 = Object::New(isolate);
21413 i::Handle<i::JSObject> io1 = v8::Utils::OpenHandle(*o1);
21414 i::Handle<i::JSObject> io2 = v8::Utils::OpenHandle(*o2);
21415 CHECK(io1->map() == io2->map());
21416 o1->SetIndexedPropertiesToExternalArrayData(
21417 NULL, v8::kExternalUint32Array, 0);
21418 o2->SetIndexedPropertiesToExternalArrayData(
21419 NULL, v8::kExternalUint32Array, 0);
21420 CHECK(io1->map() == io2->map());
21421 }
21422
21423
21407 THREADED_TEST(Regress137496) { 21424 THREADED_TEST(Regress137496) {
21408 i::FLAG_expose_gc = true; 21425 i::FLAG_expose_gc = true;
21409 LocalContext context; 21426 LocalContext context;
21410 v8::HandleScope scope(context->GetIsolate()); 21427 v8::HandleScope scope(context->GetIsolate());
21411 21428
21412 // Compile a try-finally clause where the finally block causes a GC 21429 // Compile a try-finally clause where the finally block causes a GC
21413 // while there still is a message pending for external reporting. 21430 // while there still is a message pending for external reporting.
21414 TryCatch try_catch; 21431 TryCatch try_catch;
21415 try_catch.SetVerbose(true); 21432 try_catch.SetVerbose(true);
21416 CompileRun("try { throw new Error(); } finally { gc(); }"); 21433 CompileRun("try { throw new Error(); } finally { gc(); }");
(...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after
22672 Local<Script> script = v8::ScriptCompiler::Compile( 22689 Local<Script> script = v8::ScriptCompiler::Compile(
22673 isolate, &script_source); 22690 isolate, &script_source);
22674 Local<Value> script_name = script->GetUnboundScript()->GetScriptName(); 22691 Local<Value> script_name = script->GetUnboundScript()->GetScriptName();
22675 CHECK(!script_name.IsEmpty()); 22692 CHECK(!script_name.IsEmpty());
22676 CHECK(script_name->IsString()); 22693 CHECK(script_name->IsString());
22677 String::Utf8Value utf8_name(script_name); 22694 String::Utf8Value utf8_name(script_name);
22678 CHECK_EQ(url, *utf8_name); 22695 CHECK_EQ(url, *utf8_name);
22679 int line_number = script->GetUnboundScript()->GetLineNumber(0); 22696 int line_number = script->GetUnboundScript()->GetLineNumber(0);
22680 CHECK_EQ(13, line_number); 22697 CHECK_EQ(13, line_number);
22681 } 22698 }
OLDNEW
« src/objects.cc ('K') | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698