OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 HarmonyIsolate isolate; | 422 HarmonyIsolate isolate; |
423 HandleScope scope(isolate.GetIsolate()); | 423 HandleScope scope(isolate.GetIsolate()); |
424 LocalContext context; | 424 LocalContext context; |
425 CompileRun( | 425 CompileRun( |
426 "var obj = {};" | 426 "var obj = {};" |
427 "Object.observe(obj, function(){});" | 427 "Object.observe(obj, function(){});" |
428 "Object.getNotifier(obj);" | 428 "Object.getNotifier(obj);" |
429 "obj = null;"); | 429 "obj = null;"); |
430 i::Handle<i::JSObject> observation_state = | 430 i::Handle<i::JSObject> observation_state = |
431 i::Isolate::Current()->factory()->observation_state(); | 431 i::Isolate::Current()->factory()->observation_state(); |
432 i::Handle<i::JSWeakMap> observerInfoMap = | 432 i::Handle<i::JSWeakMap> callbackInfoMap = |
433 i::Handle<i::JSWeakMap>::cast( | 433 i::Handle<i::JSWeakMap>::cast( |
434 i::GetProperty(observation_state, "observerInfoMap")); | 434 i::GetProperty(observation_state, "callbackInfoMap")); |
435 i::Handle<i::JSWeakMap> objectInfoMap = | 435 i::Handle<i::JSWeakMap> objectInfoMap = |
436 i::Handle<i::JSWeakMap>::cast( | 436 i::Handle<i::JSWeakMap>::cast( |
437 i::GetProperty(observation_state, "objectInfoMap")); | 437 i::GetProperty(observation_state, "objectInfoMap")); |
438 i::Handle<i::JSWeakMap> notifierTargetMap = | 438 i::Handle<i::JSWeakMap> notifierTargetMap = |
439 i::Handle<i::JSWeakMap>::cast( | 439 i::Handle<i::JSWeakMap>::cast( |
440 i::GetProperty(observation_state, "notifierTargetMap")); | 440 i::GetProperty(observation_state, "notifierTargetMap")); |
441 CHECK_EQ(1, NumberOfElements(observerInfoMap)); | 441 CHECK_EQ(1, NumberOfElements(callbackInfoMap)); |
442 CHECK_EQ(1, NumberOfElements(objectInfoMap)); | 442 CHECK_EQ(1, NumberOfElements(objectInfoMap)); |
443 CHECK_EQ(1, NumberOfElements(notifierTargetMap)); | 443 CHECK_EQ(1, NumberOfElements(notifierTargetMap)); |
444 HEAP->CollectAllGarbage(i::Heap::kAbortIncrementalMarkingMask); | 444 HEAP->CollectAllGarbage(i::Heap::kAbortIncrementalMarkingMask); |
445 CHECK_EQ(0, NumberOfElements(observerInfoMap)); | 445 CHECK_EQ(0, NumberOfElements(callbackInfoMap)); |
446 CHECK_EQ(0, NumberOfElements(objectInfoMap)); | 446 CHECK_EQ(0, NumberOfElements(objectInfoMap)); |
447 CHECK_EQ(0, NumberOfElements(notifierTargetMap)); | 447 CHECK_EQ(0, NumberOfElements(notifierTargetMap)); |
448 } | 448 } |
OLD | NEW |