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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/builtins/builtins-generator.cc ('k') | src/code-factory.h » ('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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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 #include "src/builtins/builtins-utils.h" 5 #include "src/builtins/builtins-utils.h"
6 #include "src/builtins/builtins.h" 6 #include "src/builtins/builtins.h"
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/code-stub-assembler.h" 8 #include "src/code-stub-assembler.h"
9 #include "src/property-descriptor.h" 9 #include "src/property-descriptor.h"
10 10
(...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after
920 HandleScope scope(isolate); 920 HandleScope scope(isolate);
921 Handle<Object> object = args.atOrUndefined(isolate, 1); 921 Handle<Object> object = args.atOrUndefined(isolate, 1);
922 if (object->IsJSReceiver()) { 922 if (object->IsJSReceiver()) {
923 MAYBE_RETURN(JSReceiver::SetIntegrityLevel(Handle<JSReceiver>::cast(object), 923 MAYBE_RETURN(JSReceiver::SetIntegrityLevel(Handle<JSReceiver>::cast(object),
924 SEALED, Object::THROW_ON_ERROR), 924 SEALED, Object::THROW_ON_ERROR),
925 isolate->heap()->exception()); 925 isolate->heap()->exception());
926 } 926 }
927 return *object; 927 return *object;
928 } 928 }
929 929
930 void Builtins::Generate_CreateIterResultObject(
931 compiler::CodeAssemblerState* state) {
932 typedef CreateIterResultObjectDescriptor Descriptor;
933 typedef compiler::Node Node;
934 CodeStubAssembler a(state);
935
936 Node* const value = a.Parameter(Descriptor::kValue);
937 Node* const done = a.Parameter(Descriptor::kDone);
938 Node* const context = a.Parameter(Descriptor::kContext);
939
940 Node* const native_context = a.LoadNativeContext(context);
941 Node* const map =
942 a.LoadContextElement(native_context, Context::ITERATOR_RESULT_MAP_INDEX);
943
944 Node* const result = a.AllocateJSObjectFromMap(map);
945
946 a.StoreObjectFieldNoWriteBarrier(result, JSIteratorResult::kValueOffset,
947 value);
948 a.StoreObjectFieldNoWriteBarrier(result, JSIteratorResult::kDoneOffset, done);
949
950 a.Return(result);
951 }
952
930 void Builtins::Generate_HasProperty(compiler::CodeAssemblerState* state) { 953 void Builtins::Generate_HasProperty(compiler::CodeAssemblerState* state) {
931 typedef HasPropertyDescriptor Descriptor; 954 typedef HasPropertyDescriptor Descriptor;
932 typedef compiler::Node Node; 955 typedef compiler::Node Node;
933 CodeStubAssembler assembler(state); 956 CodeStubAssembler assembler(state);
934 957
935 Node* key = assembler.Parameter(Descriptor::kKey); 958 Node* key = assembler.Parameter(Descriptor::kKey);
936 Node* object = assembler.Parameter(Descriptor::kObject); 959 Node* object = assembler.Parameter(Descriptor::kObject);
937 Node* context = assembler.Parameter(Descriptor::kContext); 960 Node* context = assembler.Parameter(Descriptor::kContext);
938 961
939 assembler.Return( 962 assembler.Return(
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 CodeStubAssembler assembler(state); 1008 CodeStubAssembler assembler(state);
986 1009
987 Node* object = assembler.Parameter(Descriptor::kObject); 1010 Node* object = assembler.Parameter(Descriptor::kObject);
988 Node* context = assembler.Parameter(Descriptor::kContext); 1011 Node* context = assembler.Parameter(Descriptor::kContext);
989 1012
990 assembler.Return(assembler.GetSuperConstructor(object, context)); 1013 assembler.Return(assembler.GetSuperConstructor(object, context));
991 } 1014 }
992 1015
993 } // namespace internal 1016 } // namespace internal
994 } // namespace v8 1017 } // namespace v8
OLDNEW
« 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