1 // Copyright 2017 the V8 project authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef V8_BUILTINS_BUILTINS_CONSTRUCTOR_GEN_H_ 6 #define V8_BUILTINS_BUILTINS_CONSTRUCTOR_GEN_H_ 7 8 #include "src/codegen/code-stub-assembler.h" 9 10 namespace v8 { 11 namespace internal { 12 13 class ConstructorBuiltinsAssembler : public CodeStubAssembler { 14 public: ConstructorBuiltinsAssembler(compiler::CodeAssemblerState * state)15 explicit ConstructorBuiltinsAssembler(compiler::CodeAssemblerState* state) 16 : CodeStubAssembler(state) {} 17 18 TNode<Context> FastNewFunctionContext(TNode<ScopeInfo> scope_info, 19 TNode<Uint32T> slots, 20 TNode<Context> context, 21 ScopeType scope_type); 22 23 TNode<JSRegExp> CreateRegExpLiteral(TNode<HeapObject> maybe_feedback_vector, 24 TNode<TaggedIndex> slot, 25 TNode<Object> pattern, TNode<Smi> flags, 26 TNode<Context> context); 27 28 TNode<JSArray> CreateShallowArrayLiteral( 29 TNode<FeedbackVector> feedback_vector, TNode<TaggedIndex> slot, 30 TNode<Context> context, AllocationSiteMode allocation_site_mode, 31 Label* call_runtime); 32 33 TNode<JSArray> CreateEmptyArrayLiteral(TNode<FeedbackVector> feedback_vector, 34 TNode<TaggedIndex> slot, 35 TNode<Context> context); 36 37 TNode<HeapObject> CreateShallowObjectLiteral( 38 TNode<FeedbackVector> feedback_vector, TNode<TaggedIndex> slot, 39 Label* call_runtime); 40 TNode<JSObject> CreateEmptyObjectLiteral(TNode<Context> context); 41 42 TNode<JSObject> FastNewObject(TNode<Context> context, 43 TNode<JSFunction> target, 44 TNode<JSReceiver> new_target); 45 46 TNode<JSObject> FastNewObject(TNode<Context> context, 47 TNode<JSFunction> target, 48 TNode<JSReceiver> new_target, 49 Label* call_runtime); 50 51 void CopyMutableHeapNumbersInObject(TNode<HeapObject> copy, 52 TNode<IntPtrT> start_offset, 53 TNode<IntPtrT> instance_size); 54 }; 55 56 } // namespace internal 57 } // namespace v8 58 59 #endif // V8_BUILTINS_BUILTINS_CONSTRUCTOR_GEN_H_ 60