Просмотр исходного кода

[MERGE #395] Record a couple of my iterators notes as comments

Merge pull request #395 from ianwjhalliday:consider
I had some notes regarding potential optimizations we could explore
for the iterators implementation.  Instead of keeping them lying around
in a random text file on my desktop I decided to integrate them into the
code itself.
Ian Halliday 10 лет назад
Родитель
Сommit
9ea1d76e60

+ 1 - 0
lib/Runtime/Language/JavascriptOperators.cpp

@@ -10129,6 +10129,7 @@ CommonNumber:
 
     bool JavascriptOperators::IteratorStepAndValue(RecyclableObject* iterator, ScriptContext* scriptContext, Var* resultValue)
     {
+        // CONSIDER: Fast-pathing for iterators that are built-ins?
         RecyclableObject* result = JavascriptOperators::IteratorNext(iterator, scriptContext);
 
         if (!JavascriptOperators::IteratorComplete(result, scriptContext))

+ 1 - 0
lib/Runtime/Library/JavascriptMap.cpp

@@ -111,6 +111,7 @@ namespace Js
                     value = undefined;
                 }
 
+                // CONSIDER: if adder is the default built-in, fast path it and skip the JS call?
                 adder->GetEntryPoint()(adder, CallInfo(CallFlags_Value, 3), mapObject, key, value);
             }
         }