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 marking->Step(MB, IncrementalMarking::NO_GC_VIA_STACK_GUARD); |
1525 } | 1525 } |
1526 | 1526 |
1527 CHECK(marking->IsMarking()); | 1527 CHECK(marking->IsMarking()); |
1528 | 1528 |
1529 // Discard any pending GC requests otherwise we will get GC when we enter | |
1530 // code below. | |
Michael Starzinger
2012/04/02 09:48:55
Can you preserve this comment above the call to St
| |
1531 if (ISOLATE->stack_guard()->IsGCRequest()) { | |
1532 ISOLATE->stack_guard()->Continue(GC_REQUEST); | |
1533 } | |
1534 | |
1535 { | 1529 { |
1536 v8::HandleScope scope; | 1530 v8::HandleScope scope; |
1537 v8::Handle<v8::Object> global = v8::Context::GetCurrent()->Global(); | 1531 v8::Handle<v8::Object> global = v8::Context::GetCurrent()->Global(); |
1538 v8::Handle<v8::Function> g = | 1532 v8::Handle<v8::Function> g = |
1539 v8::Handle<v8::Function>::Cast(global->Get(v8_str("g"))); | 1533 v8::Handle<v8::Function>::Cast(global->Get(v8_str("g"))); |
1540 g->Call(global, 0, NULL); | 1534 g->Call(global, 0, NULL); |
1541 } | 1535 } |
1542 | 1536 |
1543 HEAP->incremental_marking()->set_should_hurry(true); | 1537 HEAP->incremental_marking()->set_should_hurry(true); |
1544 HEAP->CollectGarbage(OLD_POINTER_SPACE); | 1538 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. | 1584 // clearing correctly records slots in prototype transition array. |
1591 i::FLAG_always_compact = true; | 1585 i::FLAG_always_compact = true; |
1592 Handle<Map> map(baseObject->map()); | 1586 Handle<Map> map(baseObject->map()); |
1593 CHECK(!space->LastPage()->Contains(map->prototype_transitions()->address())); | 1587 CHECK(!space->LastPage()->Contains(map->prototype_transitions()->address())); |
1594 CHECK(space->LastPage()->Contains(prototype->address())); | 1588 CHECK(space->LastPage()->Contains(prototype->address())); |
1595 baseObject->SetPrototype(*prototype, false)->ToObjectChecked(); | 1589 baseObject->SetPrototype(*prototype, false)->ToObjectChecked(); |
1596 CHECK(map->GetPrototypeTransition(*prototype)->IsMap()); | 1590 CHECK(map->GetPrototypeTransition(*prototype)->IsMap()); |
1597 HEAP->CollectAllGarbage(Heap::kNoGCFlags); | 1591 HEAP->CollectAllGarbage(Heap::kNoGCFlags); |
1598 CHECK(map->GetPrototypeTransition(*prototype)->IsMap()); | 1592 CHECK(map->GetPrototypeTransition(*prototype)->IsMap()); |
1599 } | 1593 } |
OLD | NEW |