• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_OBJECTS_TEMPLATE_OBJECTS_H_
6 #define V8_OBJECTS_TEMPLATE_OBJECTS_H_
7 
8 #include "src/objects/fixed-array.h"
9 #include "src/objects/struct.h"
10 
11 // Has to be the last include (doesn't have include guards):
12 #include "src/objects/object-macros.h"
13 
14 namespace v8 {
15 namespace internal {
16 
17 #include "torque-generated/src/objects/template-objects-tq.inc"
18 
19 // CachedTemplateObject is a tuple used to cache a TemplateObject that has been
20 // created. All the CachedTemplateObject's for a given SharedFunctionInfo form a
21 // linked list via the next fields.
22 class CachedTemplateObject final
23     : public TorqueGeneratedCachedTemplateObject<CachedTemplateObject, Struct> {
24  public:
25   static Handle<CachedTemplateObject> New(Isolate* isolate, int slot_id,
26                                           Handle<JSArray> template_object,
27                                           Handle<HeapObject> next);
28 
29   TQ_OBJECT_CONSTRUCTORS(CachedTemplateObject)
30 };
31 
32 // TemplateObjectDescription is a tuple of raw strings and cooked strings for
33 // tagged template literals. Used to communicate with the runtime for template
34 // object creation within the {Runtime_GetTemplateObject} method.
35 class TemplateObjectDescription final
36     : public TorqueGeneratedTemplateObjectDescription<TemplateObjectDescription,
37                                                       Struct> {
38  public:
39   static Handle<JSArray> GetTemplateObject(
40       Isolate* isolate, Handle<NativeContext> native_context,
41       Handle<TemplateObjectDescription> description,
42       Handle<SharedFunctionInfo> shared_info, int slot_id);
43 
44   TQ_OBJECT_CONSTRUCTORS(TemplateObjectDescription)
45 };
46 
47 }  // namespace internal
48 }  // namespace v8
49 
50 #include "src/objects/object-macros-undef.h"
51 
52 #endif  // V8_OBJECTS_TEMPLATE_OBJECTS_H_
53