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 2192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2203 " this.a = 1.1;" | 2203 " this.a = 1.1;" |
2204 " this.b = [{}];" | 2204 " this.b = [{}];" |
2205 " this.c = 1.2;" | 2205 " this.c = 1.2;" |
2206 " this.d = [{}];" | 2206 " this.d = [{}];" |
2207 " this.e = 1.3;" | 2207 " this.e = 1.3;" |
2208 " this.f = [{}];" | 2208 " this.f = [{}];" |
2209 "}" | 2209 "}" |
2210 "var number_elements = 20000;" | 2210 "var number_elements = 20000;" |
2211 "var elements = new Array();" | 2211 "var elements = new Array();" |
2212 "function f() {" | 2212 "function f() {" |
2213 " for (var i = 0; i < 20000-1; i++) {" | 2213 " for (var i = 0; i < number_elements; i++) {" |
2214 " elements[i] = new DataObject();" | 2214 " elements[i] = new DataObject();" |
2215 " }" | 2215 " }" |
2216 " return new DataObject()" | 2216 " return elements[number_elements-1]" |
2217 "};" | 2217 "};" |
2218 "f(); f(); f();" | 2218 "f(); f(); f();" |
2219 "%OptimizeFunctionOnNextCall(f);" | 2219 "%OptimizeFunctionOnNextCall(f);" |
2220 "f();"); | 2220 "f();"); |
2221 | 2221 |
2222 Handle<JSObject> o = | 2222 Handle<JSObject> o = |
2223 v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res)); | 2223 v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res)); |
2224 | 2224 |
2225 CHECK(CcTest::heap()->InOldDataSpace(o->RawFastPropertyAt(0))); | 2225 CHECK(CcTest::heap()->InOldDataSpace(o->RawFastPropertyAt(0))); |
2226 CHECK(CcTest::heap()->InOldPointerSpace(o->RawFastPropertyAt(1))); | 2226 CHECK(CcTest::heap()->InOldPointerSpace(o->RawFastPropertyAt(1))); |
(...skipping 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3681 code = scope.CloseAndEscape(Handle<Code>(bar->code())); | 3681 code = scope.CloseAndEscape(Handle<Code>(bar->code())); |
3682 } | 3682 } |
3683 | 3683 |
3684 // Now make sure that a gc should get rid of the function | 3684 // Now make sure that a gc should get rid of the function |
3685 for (int i = 0; i < 4; i++) { | 3685 for (int i = 0; i < 4; i++) { |
3686 heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); | 3686 heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); |
3687 } | 3687 } |
3688 | 3688 |
3689 ASSERT(code->marked_for_deoptimization()); | 3689 ASSERT(code->marked_for_deoptimization()); |
3690 } | 3690 } |
OLD | NEW |