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

Side by Side Diff: src/object-observe.js

Issue 290633010: Move microtask queueing logic from JavaScript to C++ (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Handle comments Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « src/isolate.cc ('k') | src/promise.js » ('j') | 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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 "use strict"; 5 "use strict";
6 6
7 // Overview: 7 // Overview:
8 // 8 //
9 // This file contains all of the routing and accounting for Object.observe. 9 // This file contains all of the routing and accounting for Object.observe.
10 // User code will interact with these mechanisms via the Object.observe APIs 10 // User code will interact with these mechanisms via the Object.observe APIs
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 } 412 }
413 413
414 var callback = ObserverGetCallback(observer); 414 var callback = ObserverGetCallback(observer);
415 if (!%ObserverObjectAndRecordHaveSameOrigin(callback, changeRecord.object, 415 if (!%ObserverObjectAndRecordHaveSameOrigin(callback, changeRecord.object,
416 changeRecord)) { 416 changeRecord)) {
417 return; 417 return;
418 } 418 }
419 419
420 var callbackInfo = CallbackInfoNormalize(callback); 420 var callbackInfo = CallbackInfoNormalize(callback);
421 if (IS_NULL(GetPendingObservers())) { 421 if (IS_NULL(GetPendingObservers())) {
422 SetPendingObservers(nullProtoObject()) 422 SetPendingObservers(nullProtoObject());
423 EnqueueMicrotask(ObserveMicrotaskRunner); 423 %EnqueueMicrotask(ObserveMicrotaskRunner);
424 } 424 }
425 GetPendingObservers()[callbackInfo.priority] = callback; 425 GetPendingObservers()[callbackInfo.priority] = callback;
426 callbackInfo.push(changeRecord); 426 callbackInfo.push(changeRecord);
427 } 427 }
428 428
429 function ObjectInfoEnqueueExternalChangeRecord(objectInfo, changeRecord, type) { 429 function ObjectInfoEnqueueExternalChangeRecord(objectInfo, changeRecord, type) {
430 if (!ObjectInfoHasActiveObservers(objectInfo)) 430 if (!ObjectInfoHasActiveObservers(objectInfo))
431 return; 431 return;
432 432
433 var hasType = !IS_UNDEFINED(type); 433 var hasType = !IS_UNDEFINED(type);
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 "observe", ArrayObserve, 630 "observe", ArrayObserve,
631 "unobserve", ArrayUnobserve 631 "unobserve", ArrayUnobserve
632 )); 632 ));
633 InstallFunctions(notifierPrototype, DONT_ENUM, $Array( 633 InstallFunctions(notifierPrototype, DONT_ENUM, $Array(
634 "notify", ObjectNotifierNotify, 634 "notify", ObjectNotifierNotify,
635 "performChange", ObjectNotifierPerformChange 635 "performChange", ObjectNotifierPerformChange
636 )); 636 ));
637 } 637 }
638 638
639 SetupObjectObserve(); 639 SetupObjectObserve();
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | src/promise.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698