| 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 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1514 | 1514 |
| 1515 Handle<JSFunction> f = | 1515 Handle<JSFunction> f = |
| 1516 v8::Utils::OpenHandle( | 1516 v8::Utils::OpenHandle( |
| 1517 *v8::Handle<v8::Function>::Cast( | 1517 *v8::Handle<v8::Function>::Cast( |
| 1518 v8::Context::GetCurrent()->Global()->Get(v8_str("f")))); | 1518 v8::Context::GetCurrent()->Global()->Get(v8_str("f")))); |
| 1519 | 1519 |
| 1520 CHECK(f->IsOptimized()); | 1520 CHECK(f->IsOptimized()); |
| 1521 | 1521 |
| 1522 while (!Marking::IsBlack(Marking::MarkBitFrom(f->code())) && | 1522 while (!Marking::IsBlack(Marking::MarkBitFrom(f->code())) && |
| 1523 !marking->IsStopped()) { | 1523 !marking->IsStopped()) { |
| 1524 marking->Step(MB); | 1524 // Discard any pending GC requests otherwise we will get GC when we enter |
| 1525 // code below. |
| 1526 marking->Step(MB, IncrementalMarking::NO_GC_VIA_STACK_GUARD); |
| 1525 } | 1527 } |
| 1526 | 1528 |
| 1527 CHECK(marking->IsMarking()); | 1529 CHECK(marking->IsMarking()); |
| 1528 | 1530 |
| 1529 // Discard any pending GC requests otherwise we will get GC when we enter | |
| 1530 // code below. | |
| 1531 if (ISOLATE->stack_guard()->IsGCRequest()) { | |
| 1532 ISOLATE->stack_guard()->Continue(GC_REQUEST); | |
| 1533 } | |
| 1534 | |
| 1535 { | 1531 { |
| 1536 v8::HandleScope scope; | 1532 v8::HandleScope scope; |
| 1537 v8::Handle<v8::Object> global = v8::Context::GetCurrent()->Global(); | 1533 v8::Handle<v8::Object> global = v8::Context::GetCurrent()->Global(); |
| 1538 v8::Handle<v8::Function> g = | 1534 v8::Handle<v8::Function> g = |
| 1539 v8::Handle<v8::Function>::Cast(global->Get(v8_str("g"))); | 1535 v8::Handle<v8::Function>::Cast(global->Get(v8_str("g"))); |
| 1540 g->Call(global, 0, NULL); | 1536 g->Call(global, 0, NULL); |
| 1541 } | 1537 } |
| 1542 | 1538 |
| 1543 HEAP->incremental_marking()->set_should_hurry(true); | 1539 HEAP->incremental_marking()->set_should_hurry(true); |
| 1544 HEAP->CollectGarbage(OLD_POINTER_SPACE); | 1540 HEAP->CollectGarbage(OLD_POINTER_SPACE); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1590 // clearing correctly records slots in prototype transition array. | 1586 // clearing correctly records slots in prototype transition array. |
| 1591 i::FLAG_always_compact = true; | 1587 i::FLAG_always_compact = true; |
| 1592 Handle<Map> map(baseObject->map()); | 1588 Handle<Map> map(baseObject->map()); |
| 1593 CHECK(!space->LastPage()->Contains(map->prototype_transitions()->address())); | 1589 CHECK(!space->LastPage()->Contains(map->prototype_transitions()->address())); |
| 1594 CHECK(space->LastPage()->Contains(prototype->address())); | 1590 CHECK(space->LastPage()->Contains(prototype->address())); |
| 1595 baseObject->SetPrototype(*prototype, false)->ToObjectChecked(); | 1591 baseObject->SetPrototype(*prototype, false)->ToObjectChecked(); |
| 1596 CHECK(map->GetPrototypeTransition(*prototype)->IsMap()); | 1592 CHECK(map->GetPrototypeTransition(*prototype)->IsMap()); |
| 1597 HEAP->CollectAllGarbage(Heap::kNoGCFlags); | 1593 HEAP->CollectAllGarbage(Heap::kNoGCFlags); |
| 1598 CHECK(map->GetPrototypeTransition(*prototype)->IsMap()); | 1594 CHECK(map->GetPrototypeTransition(*prototype)->IsMap()); |
| 1599 } | 1595 } |
| OLD | NEW |