OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 | 2 |
3 #include <stdlib.h> | 3 #include <stdlib.h> |
4 | 4 |
5 #include "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #include "execution.h" | 7 #include "execution.h" |
8 #include "factory.h" | 8 #include "factory.h" |
9 #include "macro-assembler.h" | 9 #include "macro-assembler.h" |
10 #include "global-handles.h" | 10 #include "global-handles.h" |
(...skipping 1684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1695 "function c(x) {" | 1695 "function c(x) {" |
1696 " this.x = x;" | 1696 " this.x = x;" |
1697 " for (var i = 0; i < 32; i++) {" | 1697 " for (var i = 0; i < 32; i++) {" |
1698 " this['x' + i] = x;" | 1698 " this['x' + i] = x;" |
1699 " }" | 1699 " }" |
1700 "}" | 1700 "}" |
1701 "function f(x) { return new c(x); };" | 1701 "function f(x) { return new c(x); };" |
1702 "f(1); f(2); f(3);" | 1702 "f(1); f(2); f(3);" |
1703 "%OptimizeFunctionOnNextCall(f);" | 1703 "%OptimizeFunctionOnNextCall(f);" |
1704 "f(4);"); | 1704 "f(4);"); |
1705 CHECK(res->IsObject()); | 1705 CHECK_EQ(4, res->ToObject()->GetRealNamedProperty(v8_str("x"))->Int32Value()); |
1706 CHECK(res->ToObject()->GetRealNamedProperty(v8_str("x"))->Int32Value() == 4); | |
1707 | 1706 |
1708 Handle<JSObject> o = | 1707 Handle<JSObject> o = |
1709 v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res)); | 1708 v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res)); |
1710 | 1709 |
1711 CHECK(HEAP->InNewSpace(*o)); | 1710 CHECK(HEAP->InNewSpace(*o)); |
1712 } | 1711 } |
OLD | NEW |