diff options
author | Refael Ackermann <refack@gmail.com> | 2014-09-29 13:20:04 +0400 |
---|---|---|
committer | Fedor Indutny <fedor@indutny.com> | 2014-10-08 15:44:38 +0400 |
commit | 9116b240c924d37627313416b7ee038d0580afbc (patch) | |
tree | 86c586915a96d308b1b04de679a8ae293caf3e41 /deps/v8/test/cctest/test-mark-compact.cc | |
parent | a2a3fd48934f36d94575dd33d2a2cb732f937f77 (diff) | |
download | node-9116b240c924d37627313416b7ee038d0580afbc.tar.gz |
deps: update v8 to 3.28.73
Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: https://github.com/joyent/node/pull/8476
Diffstat (limited to 'deps/v8/test/cctest/test-mark-compact.cc')
-rw-r--r-- | deps/v8/test/cctest/test-mark-compact.cc | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/deps/v8/test/cctest/test-mark-compact.cc b/deps/v8/test/cctest/test-mark-compact.cc index 5f13bd25a..1d4b0d8e7 100644 --- a/deps/v8/test/cctest/test-mark-compact.cc +++ b/deps/v8/test/cctest/test-mark-compact.cc @@ -28,21 +28,21 @@ #include <stdlib.h> #ifdef __linux__ -#include <sys/types.h> -#include <sys/stat.h> +#include <errno.h> #include <fcntl.h> +#include <sys/stat.h> +#include <sys/types.h> #include <unistd.h> -#include <errno.h> #endif #include <utility> -#include "v8.h" +#include "src/v8.h" -#include "full-codegen.h" -#include "global-handles.h" -#include "snapshot.h" -#include "cctest.h" +#include "src/full-codegen.h" +#include "src/global-handles.h" +#include "src/snapshot.h" +#include "test/cctest/cctest.h" using namespace v8::internal; @@ -77,7 +77,7 @@ TEST(MarkingDeque) { TEST(Promotion) { CcTest::InitializeVM(); TestHeap* heap = CcTest::test_heap(); - heap->ConfigureHeap(2*256*KB, 1*MB, 1*MB, 0); + heap->ConfigureHeap(1, 1, 1, 0); v8::HandleScope sc(CcTest::isolate()); @@ -92,7 +92,8 @@ TEST(Promotion) { CHECK(heap->InSpace(*array, NEW_SPACE)); // Call mark compact GC, so array becomes an old object. - heap->CollectGarbage(OLD_POINTER_SPACE); + heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); + heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); // Array now sits in the old space CHECK(heap->InSpace(*array, OLD_POINTER_SPACE)); @@ -102,7 +103,7 @@ TEST(Promotion) { TEST(NoPromotion) { CcTest::InitializeVM(); TestHeap* heap = CcTest::test_heap(); - heap->ConfigureHeap(2*256*KB, 1*MB, 1*MB, 0); + heap->ConfigureHeap(1, 1, 1, 0); v8::HandleScope sc(CcTest::isolate()); @@ -156,12 +157,8 @@ TEST(MarkCompactCollector) { { HandleScope scope(isolate); // allocate a garbage Handle<String> func_name = factory->InternalizeUtf8String("theFunction"); - Handle<JSFunction> function = factory->NewFunctionWithPrototype( - func_name, factory->undefined_value()); - Handle<Map> initial_map = factory->NewMap( - JS_OBJECT_TYPE, JSObject::kHeaderSize); - function->set_initial_map(*initial_map); - JSReceiver::SetProperty(global, func_name, function, NONE, SLOPPY).Check(); + Handle<JSFunction> function = factory->NewFunction(func_name); + JSReceiver::SetProperty(global, func_name, function, SLOPPY).Check(); factory->NewJSObject(function); } @@ -170,7 +167,9 @@ TEST(MarkCompactCollector) { { HandleScope scope(isolate); Handle<String> func_name = factory->InternalizeUtf8String("theFunction"); - CHECK(JSReceiver::HasLocalProperty(global, func_name)); + v8::Maybe<bool> maybe = JSReceiver::HasOwnProperty(global, func_name); + CHECK(maybe.has_value); + CHECK(maybe.value); Handle<Object> func_value = Object::GetProperty(global, func_name).ToHandleChecked(); CHECK(func_value->IsJSFunction()); @@ -178,17 +177,19 @@ TEST(MarkCompactCollector) { Handle<JSObject> obj = factory->NewJSObject(function); Handle<String> obj_name = factory->InternalizeUtf8String("theObject"); - JSReceiver::SetProperty(global, obj_name, obj, NONE, SLOPPY).Check(); + JSReceiver::SetProperty(global, obj_name, obj, SLOPPY).Check(); Handle<String> prop_name = factory->InternalizeUtf8String("theSlot"); Handle<Smi> twenty_three(Smi::FromInt(23), isolate); - JSReceiver::SetProperty(obj, prop_name, twenty_three, NONE, SLOPPY).Check(); + JSReceiver::SetProperty(obj, prop_name, twenty_three, SLOPPY).Check(); } heap->CollectGarbage(OLD_POINTER_SPACE, "trigger 5"); { HandleScope scope(isolate); Handle<String> obj_name = factory->InternalizeUtf8String("theObject"); - CHECK(JSReceiver::HasLocalProperty(global, obj_name)); + v8::Maybe<bool> maybe = JSReceiver::HasOwnProperty(global, obj_name); + CHECK(maybe.has_value); + CHECK(maybe.value); Handle<Object> object = Object::GetProperty(global, obj_name).ToHandleChecked(); CHECK(object->IsJSObject()); @@ -240,7 +241,7 @@ static void WeakPointerCallback( std::pair<v8::Persistent<v8::Value>*, int>* p = reinterpret_cast<std::pair<v8::Persistent<v8::Value>*, int>*>( data.GetParameter()); - ASSERT_EQ(1234, p->second); + DCHECK_EQ(1234, p->second); NumberOfWeakCalls++; p->first->Reset(); } @@ -365,7 +366,7 @@ class TestRetainedObjectInfo : public v8::RetainedObjectInfo { bool has_been_disposed() { return has_been_disposed_; } virtual void Dispose() { - ASSERT(!has_been_disposed_); + DCHECK(!has_been_disposed_); has_been_disposed_ = true; } @@ -393,7 +394,7 @@ TEST(EmptyObjectGroups) { TestRetainedObjectInfo info; global_handles->AddObjectGroup(NULL, 0, &info); - ASSERT(info.has_been_disposed()); + DCHECK(info.has_been_disposed()); global_handles->AddImplicitReferences( Handle<HeapObject>::cast(object).location(), NULL, 0); |