| 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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 CompileRun( | 405 CompileRun( |
| 406 "var obj = {};" | 406 "var obj = {};" |
| 407 "Object.observe(obj, function(){});" | 407 "Object.observe(obj, function(){});" |
| 408 "Object.getNotifier(obj);" | 408 "Object.getNotifier(obj);" |
| 409 "obj = null;"); | 409 "obj = null;"); |
| 410 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(CcTest::isolate()); | 410 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(CcTest::isolate()); |
| 411 i::Handle<i::JSObject> observation_state = | 411 i::Handle<i::JSObject> observation_state = |
| 412 i_isolate->factory()->observation_state(); | 412 i_isolate->factory()->observation_state(); |
| 413 i::Handle<i::JSWeakMap> callbackInfoMap = | 413 i::Handle<i::JSWeakMap> callbackInfoMap = |
| 414 i::Handle<i::JSWeakMap>::cast( | 414 i::Handle<i::JSWeakMap>::cast( |
| 415 i::GetProperty(observation_state, "callbackInfoMap")); | 415 i::GetProperty( |
| 416 observation_state, "callbackInfoMap").ToHandleChecked()); |
| 416 i::Handle<i::JSWeakMap> objectInfoMap = | 417 i::Handle<i::JSWeakMap> objectInfoMap = |
| 417 i::Handle<i::JSWeakMap>::cast( | 418 i::Handle<i::JSWeakMap>::cast( |
| 418 i::GetProperty(observation_state, "objectInfoMap")); | 419 i::GetProperty(observation_state, "objectInfoMap").ToHandleChecked()); |
| 419 i::Handle<i::JSWeakMap> notifierObjectInfoMap = | 420 i::Handle<i::JSWeakMap> notifierObjectInfoMap = |
| 420 i::Handle<i::JSWeakMap>::cast( | 421 i::Handle<i::JSWeakMap>::cast( |
| 421 i::GetProperty(observation_state, "notifierObjectInfoMap")); | 422 i::GetProperty( |
| 423 observation_state, "notifierObjectInfoMap").ToHandleChecked()); |
| 422 CHECK_EQ(1, NumberOfElements(callbackInfoMap)); | 424 CHECK_EQ(1, NumberOfElements(callbackInfoMap)); |
| 423 CHECK_EQ(1, NumberOfElements(objectInfoMap)); | 425 CHECK_EQ(1, NumberOfElements(objectInfoMap)); |
| 424 CHECK_EQ(1, NumberOfElements(notifierObjectInfoMap)); | 426 CHECK_EQ(1, NumberOfElements(notifierObjectInfoMap)); |
| 425 i_isolate->heap()->CollectAllGarbage(i::Heap::kAbortIncrementalMarkingMask); | 427 i_isolate->heap()->CollectAllGarbage(i::Heap::kAbortIncrementalMarkingMask); |
| 426 CHECK_EQ(0, NumberOfElements(callbackInfoMap)); | 428 CHECK_EQ(0, NumberOfElements(callbackInfoMap)); |
| 427 CHECK_EQ(0, NumberOfElements(objectInfoMap)); | 429 CHECK_EQ(0, NumberOfElements(objectInfoMap)); |
| 428 CHECK_EQ(0, NumberOfElements(notifierObjectInfoMap)); | 430 CHECK_EQ(0, NumberOfElements(notifierObjectInfoMap)); |
| 429 } | 431 } |
| 430 | 432 |
| 431 | 433 |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 719 "var observer = function(r) { records = r };" | 721 "var observer = function(r) { records = r };" |
| 720 "Object.observe(obj, observer);"); | 722 "Object.observe(obj, observer);"); |
| 721 Handle<Value> obj = | 723 Handle<Value> obj = |
| 722 context->Global()->Get(String::NewFromUtf8(CcTest::isolate(), "obj")); | 724 context->Global()->Get(String::NewFromUtf8(CcTest::isolate(), "obj")); |
| 723 Handle<Object>::Cast(obj) | 725 Handle<Object>::Cast(obj) |
| 724 ->SetHiddenValue(String::NewFromUtf8(CcTest::isolate(), "foo"), | 726 ->SetHiddenValue(String::NewFromUtf8(CcTest::isolate(), "foo"), |
| 725 Null(CcTest::isolate())); | 727 Null(CcTest::isolate())); |
| 726 CompileRun(""); // trigger delivery | 728 CompileRun(""); // trigger delivery |
| 727 CHECK(CompileRun("records")->IsNull()); | 729 CHECK(CompileRun("records")->IsNull()); |
| 728 } | 730 } |
| OLD | NEW |