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

Unified Diff: src/builtins/builtins-object.cc

Issue 2619163004: [stubs] Add CreateIterResultObject stub (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/builtins/builtins-generator.cc ('k') | src/code-factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins-object.cc
diff --git a/src/builtins/builtins-object.cc b/src/builtins/builtins-object.cc
index 6b2d5865103005bec4d78e82cdc5debd8ad126f5..95ef2441b2d23dd614b9d16c31b08ea1d0d19cc8 100644
--- a/src/builtins/builtins-object.cc
+++ b/src/builtins/builtins-object.cc
@@ -927,6 +927,29 @@ BUILTIN(ObjectSeal) {
return *object;
}
+void Builtins::Generate_CreateIterResultObject(
+ compiler::CodeAssemblerState* state) {
+ typedef CreateIterResultObjectDescriptor Descriptor;
+ typedef compiler::Node Node;
+ CodeStubAssembler a(state);
+
+ Node* const value = a.Parameter(Descriptor::kValue);
+ Node* const done = a.Parameter(Descriptor::kDone);
+ Node* const context = a.Parameter(Descriptor::kContext);
+
+ Node* const native_context = a.LoadNativeContext(context);
+ Node* const map =
+ a.LoadContextElement(native_context, Context::ITERATOR_RESULT_MAP_INDEX);
+
+ Node* const result = a.AllocateJSObjectFromMap(map);
+
+ a.StoreObjectFieldNoWriteBarrier(result, JSIteratorResult::kValueOffset,
+ value);
+ a.StoreObjectFieldNoWriteBarrier(result, JSIteratorResult::kDoneOffset, done);
+
+ a.Return(result);
+}
+
void Builtins::Generate_HasProperty(compiler::CodeAssemblerState* state) {
typedef HasPropertyDescriptor Descriptor;
typedef compiler::Node Node;
« no previous file with comments | « src/builtins/builtins-generator.cc ('k') | src/code-factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698