| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1510 } | 1510 } |
| 1511 HEAP->CollectAllAvailableGarbage(); | 1511 HEAP->CollectAllAvailableGarbage(); |
| 1512 CHECK_EQ(2, NumberOfGlobalObjects()); | 1512 CHECK_EQ(2, NumberOfGlobalObjects()); |
| 1513 ctx2.Dispose(); | 1513 ctx2.Dispose(); |
| 1514 HEAP->CollectAllAvailableGarbage(); | 1514 HEAP->CollectAllAvailableGarbage(); |
| 1515 CHECK_EQ(0, NumberOfGlobalObjects()); | 1515 CHECK_EQ(0, NumberOfGlobalObjects()); |
| 1516 } | 1516 } |
| 1517 | 1517 |
| 1518 | 1518 |
| 1519 TEST(InstanceOfStubWriteBarrier) { | 1519 TEST(InstanceOfStubWriteBarrier) { |
| 1520 if (!i::FLAG_crankshaft) return; | |
| 1521 i::FLAG_allow_natives_syntax = true; | 1520 i::FLAG_allow_natives_syntax = true; |
| 1522 #ifdef DEBUG | 1521 #ifdef DEBUG |
| 1523 i::FLAG_verify_heap = true; | 1522 i::FLAG_verify_heap = true; |
| 1524 #endif | 1523 #endif |
| 1525 InitializeVM(); | 1524 InitializeVM(); |
| 1525 if (!i::V8::UseCrankshaft()) return; |
| 1526 v8::HandleScope outer_scope; | 1526 v8::HandleScope outer_scope; |
| 1527 | 1527 |
| 1528 { | 1528 { |
| 1529 v8::HandleScope scope; | 1529 v8::HandleScope scope; |
| 1530 CompileRun( | 1530 CompileRun( |
| 1531 "function foo () { }" | 1531 "function foo () { }" |
| 1532 "function mkbar () { return new (new Function(\"\")) (); }" | 1532 "function mkbar () { return new (new Function(\"\")) (); }" |
| 1533 "function f (x) { return (x instanceof foo); }" | 1533 "function f (x) { return (x instanceof foo); }" |
| 1534 "function g () { f(mkbar()); }" | 1534 "function g () { f(mkbar()); }" |
| 1535 "f(new foo()); f(new foo());" | 1535 "f(new foo()); f(new foo());" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 1565 v8::HandleScope scope; | 1565 v8::HandleScope scope; |
| 1566 v8::Handle<v8::Object> global = v8::Context::GetCurrent()->Global(); | 1566 v8::Handle<v8::Object> global = v8::Context::GetCurrent()->Global(); |
| 1567 v8::Handle<v8::Function> g = | 1567 v8::Handle<v8::Function> g = |
| 1568 v8::Handle<v8::Function>::Cast(global->Get(v8_str("g"))); | 1568 v8::Handle<v8::Function>::Cast(global->Get(v8_str("g"))); |
| 1569 g->Call(global, 0, NULL); | 1569 g->Call(global, 0, NULL); |
| 1570 } | 1570 } |
| 1571 | 1571 |
| 1572 HEAP->incremental_marking()->set_should_hurry(true); | 1572 HEAP->incremental_marking()->set_should_hurry(true); |
| 1573 HEAP->CollectGarbage(OLD_POINTER_SPACE); | 1573 HEAP->CollectGarbage(OLD_POINTER_SPACE); |
| 1574 } | 1574 } |
| OLD | NEW |