OLD | NEW |
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 3901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3912 "function foo%d(x) { with (x) { return 1 + x; } };" | 3912 "function foo%d(x) { with (x) { return 1 + x; } };" |
3913 "bar%d();" | 3913 "bar%d();" |
3914 "bar%d();" | 3914 "bar%d();" |
3915 "bar%d();" | 3915 "bar%d();" |
3916 "%OptimizeFunctionOnNextCall(bar%d);" | 3916 "%OptimizeFunctionOnNextCall(bar%d);" |
3917 "bar%d();", i, i, i, i, i, i, i, i); | 3917 "bar%d();", i, i, i, i, i, i, i, i); |
3918 CompileRun(source.start()); | 3918 CompileRun(source.start()); |
3919 } | 3919 } |
3920 heap->CollectAllGarbage(i::Heap::kNoGCFlags); | 3920 heap->CollectAllGarbage(i::Heap::kNoGCFlags); |
3921 } | 3921 } |
3922 WeakHashTable* table = WeakHashTable::cast(heap->weak_object_to_code_table()); | 3922 int elements = 0; |
3923 CHECK_EQ(0, table->NumberOfElements()); | 3923 if (heap->weak_object_to_code_table()->IsHashTable()) { |
| 3924 WeakHashTable* t = WeakHashTable::cast(heap->weak_object_to_code_table()); |
| 3925 elements = t->NumberOfElements(); |
| 3926 } |
| 3927 CHECK_EQ(0, elements); |
3924 } | 3928 } |
3925 | 3929 |
3926 | 3930 |
3927 static Handle<JSFunction> OptimizeDummyFunction(const char* name) { | 3931 static Handle<JSFunction> OptimizeDummyFunction(const char* name) { |
3928 EmbeddedVector<char, 256> source; | 3932 EmbeddedVector<char, 256> source; |
3929 OS::SNPrintF(source, | 3933 OS::SNPrintF(source, |
3930 "function %s() { return 0; }" | 3934 "function %s() { return 0; }" |
3931 "%s(); %s();" | 3935 "%s(); %s();" |
3932 "%%OptimizeFunctionOnNextCall(%s);" | 3936 "%%OptimizeFunctionOnNextCall(%s);" |
3933 "%s();", name, name, name, name, name); | 3937 "%s();", name, name, name, name, name); |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4240 "array;"); | 4244 "array;"); |
4241 | 4245 |
4242 Handle<JSObject> o = | 4246 Handle<JSObject> o = |
4243 v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(result)); | 4247 v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(result)); |
4244 CHECK(heap->InOldPointerSpace(o->elements())); | 4248 CHECK(heap->InOldPointerSpace(o->elements())); |
4245 CHECK(heap->InOldPointerSpace(*o)); | 4249 CHECK(heap->InOldPointerSpace(*o)); |
4246 Page* page = Page::FromAddress(o->elements()->address()); | 4250 Page* page = Page::FromAddress(o->elements()->address()); |
4247 CHECK(page->WasSwept() || | 4251 CHECK(page->WasSwept() || |
4248 Marking::IsBlack(Marking::MarkBitFrom(o->elements()))); | 4252 Marking::IsBlack(Marking::MarkBitFrom(o->elements()))); |
4249 } | 4253 } |
OLD | NEW |