Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: test/cctest/test-object-observe.cc

Issue 19132002: [Object.observe] Lazily allocate callbackInfo structure (Closed) Base URL: https://github.com/v8/v8.git@bleeding_edge
Patch Set: cr comments Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/object-observe.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « src/object-observe.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698