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

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

Issue 1475953002: [stubs] A new approach to TF stubs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Win64 build Created 5 years 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
« no previous file with comments | « test/cctest/compiler/test-simplified-lowering.cc ('k') | test/cctest/test-heap.cc » ('j') | 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 13200 matching lines...) Expand 10 before | Expand all | Expand 10 after
13211 int count = 0; 13211 int count = 0;
13212 i::HeapIterator it(CcTest::heap()); 13212 i::HeapIterator it(CcTest::heap());
13213 for (i::HeapObject* object = it.next(); object != NULL; object = it.next()) 13213 for (i::HeapObject* object = it.next(); object != NULL; object = it.next())
13214 if (object->IsJSGlobalObject()) { 13214 if (object->IsJSGlobalObject()) {
13215 i::JSGlobalObject* g = i::JSGlobalObject::cast(object); 13215 i::JSGlobalObject* g = i::JSGlobalObject::cast(object);
13216 // Skip dummy global object. 13216 // Skip dummy global object.
13217 if (i::GlobalDictionary::cast(g->properties())->NumberOfElements() != 0) { 13217 if (i::GlobalDictionary::cast(g->properties())->NumberOfElements() != 0) {
13218 count++; 13218 count++;
13219 } 13219 }
13220 } 13220 }
13221 // Subtract one to compensate for the code stub context that is always present 13221 return count;
13222 return count - 1;
13223 } 13222 }
13224 13223
13225 13224
13226 static void CheckSurvivingGlobalObjectsCount(int expected) { 13225 static void CheckSurvivingGlobalObjectsCount(int expected) {
13227 // We need to collect all garbage twice to be sure that everything 13226 // We need to collect all garbage twice to be sure that everything
13228 // has been collected. This is because inline caches are cleared in 13227 // has been collected. This is because inline caches are cleared in
13229 // the first garbage collection but some of the maps have already 13228 // the first garbage collection but some of the maps have already
13230 // been marked at that point. Therefore some of the maps are not 13229 // been marked at that point. Therefore some of the maps are not
13231 // collected until the second garbage collection. 13230 // collected until the second garbage collection.
13232 CcTest::heap()->CollectAllGarbage(); 13231 CcTest::heap()->CollectAllGarbage();
(...skipping 10596 matching lines...) Expand 10 before | Expand all | Expand 10 after
23829 env2->Global()->Set(env2.local(), v8_str("obj2"), object2).FromJust()); 23828 env2->Global()->Set(env2.local(), v8_str("obj2"), object2).FromJust());
23830 ExpectString("typeof obj2.values", "function"); 23829 ExpectString("typeof obj2.values", "function");
23831 CHECK_NE(*object->Get(v8_str("values")), *object2->Get(v8_str("values"))); 23830 CHECK_NE(*object->Get(v8_str("values")), *object2->Get(v8_str("values")));
23832 23831
23833 auto values2 = Local<Function>::Cast(object2->Get(v8_str("values"))); 23832 auto values2 = Local<Function>::Cast(object2->Get(v8_str("values")));
23834 auto fn2 = i::Handle<i::JSFunction>::cast(v8::Utils::OpenHandle(*values2)); 23833 auto fn2 = i::Handle<i::JSFunction>::cast(v8::Utils::OpenHandle(*values2));
23835 auto ctx2 = v8::Utils::OpenHandle(*env2.local()); 23834 auto ctx2 = v8::Utils::OpenHandle(*env2.local());
23836 CHECK_EQ(fn2->GetCreationContext(), *ctx2); 23835 CHECK_EQ(fn2->GetCreationContext(), *ctx2);
23837 } 23836 }
23838 } 23837 }
OLDNEW
« no previous file with comments | « test/cctest/compiler/test-simplified-lowering.cc ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698