Generator.cpp 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  1. /*
  2. * Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibJS/AST.h>
  7. #include <LibJS/Bytecode/BasicBlock.h>
  8. #include <LibJS/Bytecode/Generator.h>
  9. #include <LibJS/Bytecode/Instruction.h>
  10. #include <LibJS/Bytecode/Op.h>
  11. #include <LibJS/Bytecode/Register.h>
  12. namespace JS::Bytecode {
  13. Generator::Generator()
  14. : m_string_table(make<StringTable>())
  15. , m_identifier_table(make<IdentifierTable>())
  16. {
  17. }
  18. CodeGenerationErrorOr<NonnullOwnPtr<Executable>> Generator::generate(ASTNode const& node, FunctionKind enclosing_function_kind)
  19. {
  20. Generator generator;
  21. generator.switch_to_basic_block(generator.make_block());
  22. generator.m_enclosing_function_kind = enclosing_function_kind;
  23. if (generator.is_in_generator_or_async_function()) {
  24. // Immediately yield with no value.
  25. auto& start_block = generator.make_block();
  26. generator.emit<Bytecode::Op::Yield>(Label { start_block });
  27. generator.switch_to_basic_block(start_block);
  28. // NOTE: This doesn't have to handle received throw/return completions, as GeneratorObject::resume_abrupt
  29. // will not enter the generator from the SuspendedStart state and immediately completes the generator.
  30. }
  31. TRY(node.generate_bytecode(generator));
  32. if (generator.is_in_generator_or_async_function()) {
  33. // Terminate all unterminated blocks with yield return
  34. for (auto& block : generator.m_root_basic_blocks) {
  35. if (block->is_terminated())
  36. continue;
  37. generator.switch_to_basic_block(*block);
  38. generator.emit<Bytecode::Op::LoadImmediate>(js_undefined());
  39. generator.emit<Bytecode::Op::Yield>(nullptr);
  40. }
  41. }
  42. bool is_strict_mode = false;
  43. if (is<Program>(node))
  44. is_strict_mode = static_cast<Program const&>(node).is_strict_mode();
  45. else if (is<FunctionBody>(node))
  46. is_strict_mode = static_cast<FunctionBody const&>(node).in_strict_mode();
  47. else if (is<FunctionDeclaration>(node))
  48. is_strict_mode = static_cast<FunctionDeclaration const&>(node).is_strict_mode();
  49. else if (is<FunctionExpression>(node))
  50. is_strict_mode = static_cast<FunctionExpression const&>(node).is_strict_mode();
  51. Vector<PropertyLookupCache> property_lookup_caches;
  52. property_lookup_caches.resize(generator.m_next_property_lookup_cache);
  53. return adopt_own(*new Executable {
  54. .name = {},
  55. .property_lookup_caches = move(property_lookup_caches),
  56. .basic_blocks = move(generator.m_root_basic_blocks),
  57. .string_table = move(generator.m_string_table),
  58. .identifier_table = move(generator.m_identifier_table),
  59. .number_of_registers = generator.m_next_register,
  60. .is_strict_mode = is_strict_mode,
  61. });
  62. }
  63. void Generator::grow(size_t additional_size)
  64. {
  65. VERIFY(m_current_basic_block);
  66. m_current_basic_block->grow(additional_size);
  67. }
  68. void* Generator::next_slot()
  69. {
  70. VERIFY(m_current_basic_block);
  71. return m_current_basic_block->next_slot();
  72. }
  73. Register Generator::allocate_register()
  74. {
  75. VERIFY(m_next_register != NumericLimits<u32>::max());
  76. return Register { m_next_register++ };
  77. }
  78. Label Generator::nearest_continuable_scope() const
  79. {
  80. return m_continuable_scopes.last().bytecode_target;
  81. }
  82. void Generator::block_declaration_instantiation(ScopeNode const& scope_node)
  83. {
  84. start_boundary(BlockBoundaryType::LeaveLexicalEnvironment);
  85. emit<Bytecode::Op::BlockDeclarationInstantiation>(scope_node);
  86. }
  87. void Generator::begin_variable_scope()
  88. {
  89. start_boundary(BlockBoundaryType::LeaveLexicalEnvironment);
  90. emit<Bytecode::Op::CreateLexicalEnvironment>();
  91. }
  92. void Generator::end_variable_scope()
  93. {
  94. end_boundary(BlockBoundaryType::LeaveLexicalEnvironment);
  95. if (!m_current_basic_block->is_terminated()) {
  96. emit<Bytecode::Op::LeaveLexicalEnvironment>();
  97. }
  98. }
  99. void Generator::begin_continuable_scope(Label continue_target, Vector<DeprecatedFlyString> const& language_label_set)
  100. {
  101. m_continuable_scopes.append({ continue_target, language_label_set });
  102. start_boundary(BlockBoundaryType::Continue);
  103. }
  104. void Generator::end_continuable_scope()
  105. {
  106. m_continuable_scopes.take_last();
  107. end_boundary(BlockBoundaryType::Continue);
  108. }
  109. Label Generator::nearest_breakable_scope() const
  110. {
  111. return m_breakable_scopes.last().bytecode_target;
  112. }
  113. void Generator::begin_breakable_scope(Label breakable_target, Vector<DeprecatedFlyString> const& language_label_set)
  114. {
  115. m_breakable_scopes.append({ breakable_target, language_label_set });
  116. start_boundary(BlockBoundaryType::Break);
  117. }
  118. void Generator::end_breakable_scope()
  119. {
  120. m_breakable_scopes.take_last();
  121. end_boundary(BlockBoundaryType::Break);
  122. }
  123. CodeGenerationErrorOr<Generator::ReferenceRegisters> Generator::emit_super_reference(MemberExpression const& expression)
  124. {
  125. VERIFY(is<SuperExpression>(expression.object()));
  126. // https://tc39.es/ecma262/#sec-super-keyword-runtime-semantics-evaluation
  127. // 1. Let env be GetThisEnvironment().
  128. // 2. Let actualThis be ? env.GetThisBinding().
  129. auto actual_this_register = allocate_register();
  130. emit<Bytecode::Op::ResolveThisBinding>();
  131. emit<Bytecode::Op::Store>(actual_this_register);
  132. Optional<Bytecode::Register> computed_property_value_register;
  133. if (expression.is_computed()) {
  134. // SuperProperty : super [ Expression ]
  135. // 3. Let propertyNameReference be ? Evaluation of Expression.
  136. // 4. Let propertyNameValue be ? GetValue(propertyNameReference).
  137. TRY(expression.property().generate_bytecode(*this));
  138. computed_property_value_register = allocate_register();
  139. emit<Bytecode::Op::Store>(*computed_property_value_register);
  140. }
  141. // 5/7. Return ? MakeSuperPropertyReference(actualThis, propertyKey, strict).
  142. // https://tc39.es/ecma262/#sec-makesuperpropertyreference
  143. // 1. Let env be GetThisEnvironment().
  144. // 2. Assert: env.HasSuperBinding() is true.
  145. // 3. Let baseValue be ? env.GetSuperBase().
  146. auto super_base_register = allocate_register();
  147. emit<Bytecode::Op::ResolveSuperBase>();
  148. emit<Bytecode::Op::Store>(super_base_register);
  149. // 4. Return the Reference Record { [[Base]]: baseValue, [[ReferencedName]]: propertyKey, [[Strict]]: strict, [[ThisValue]]: actualThis }.
  150. return ReferenceRegisters {
  151. .base = super_base_register,
  152. .referenced_name = move(computed_property_value_register),
  153. .this_value = actual_this_register,
  154. };
  155. }
  156. CodeGenerationErrorOr<void> Generator::emit_load_from_reference(JS::ASTNode const& node)
  157. {
  158. if (is<Identifier>(node)) {
  159. auto& identifier = static_cast<Identifier const&>(node);
  160. TRY(identifier.generate_bytecode(*this));
  161. return {};
  162. }
  163. if (is<MemberExpression>(node)) {
  164. auto& expression = static_cast<MemberExpression const&>(node);
  165. // https://tc39.es/ecma262/#sec-super-keyword-runtime-semantics-evaluation
  166. if (is<SuperExpression>(expression.object())) {
  167. auto super_reference = TRY(emit_super_reference(expression));
  168. if (super_reference.referenced_name.has_value()) {
  169. // 5. Let propertyKey be ? ToPropertyKey(propertyNameValue).
  170. // FIXME: This does ToPropertyKey out of order, which is observable by Symbol.toPrimitive!
  171. emit<Bytecode::Op::Load>(*super_reference.referenced_name);
  172. emit<Bytecode::Op::GetByValueWithThis>(super_reference.base, super_reference.this_value);
  173. } else {
  174. // 3. Let propertyKey be StringValue of IdentifierName.
  175. auto identifier_table_ref = intern_identifier(verify_cast<Identifier>(expression.property()).string());
  176. emit_get_by_id_with_this(identifier_table_ref, super_reference.this_value);
  177. }
  178. } else {
  179. TRY(expression.object().generate_bytecode(*this));
  180. if (expression.is_computed()) {
  181. auto object_reg = allocate_register();
  182. emit<Bytecode::Op::Store>(object_reg);
  183. TRY(expression.property().generate_bytecode(*this));
  184. emit<Bytecode::Op::GetByValue>(object_reg);
  185. } else if (expression.property().is_identifier()) {
  186. auto identifier_table_ref = intern_identifier(verify_cast<Identifier>(expression.property()).string());
  187. emit_get_by_id(identifier_table_ref);
  188. } else if (expression.property().is_private_identifier()) {
  189. auto identifier_table_ref = intern_identifier(verify_cast<PrivateIdentifier>(expression.property()).string());
  190. emit<Bytecode::Op::GetPrivateById>(identifier_table_ref);
  191. } else {
  192. return CodeGenerationError {
  193. &expression,
  194. "Unimplemented non-computed member expression"sv
  195. };
  196. }
  197. }
  198. return {};
  199. }
  200. VERIFY_NOT_REACHED();
  201. }
  202. CodeGenerationErrorOr<void> Generator::emit_store_to_reference(JS::ASTNode const& node)
  203. {
  204. if (is<Identifier>(node)) {
  205. auto& identifier = static_cast<Identifier const&>(node);
  206. emit_set_variable(identifier);
  207. return {};
  208. }
  209. if (is<MemberExpression>(node)) {
  210. // NOTE: The value is in the accumulator, so we have to store that away first.
  211. auto value_reg = allocate_register();
  212. emit<Bytecode::Op::Store>(value_reg);
  213. auto& expression = static_cast<MemberExpression const&>(node);
  214. // https://tc39.es/ecma262/#sec-super-keyword-runtime-semantics-evaluation
  215. if (is<SuperExpression>(expression.object())) {
  216. auto super_reference = TRY(emit_super_reference(expression));
  217. emit<Bytecode::Op::Load>(value_reg);
  218. // 4. Return the Reference Record { [[Base]]: baseValue, [[ReferencedName]]: propertyKey, [[Strict]]: strict, [[ThisValue]]: actualThis }.
  219. if (super_reference.referenced_name.has_value()) {
  220. // 5. Let propertyKey be ? ToPropertyKey(propertyNameValue).
  221. // FIXME: This does ToPropertyKey out of order, which is observable by Symbol.toPrimitive!
  222. emit<Bytecode::Op::PutByValueWithThis>(super_reference.base, *super_reference.referenced_name, super_reference.this_value);
  223. } else {
  224. // 3. Let propertyKey be StringValue of IdentifierName.
  225. auto identifier_table_ref = intern_identifier(verify_cast<Identifier>(expression.property()).string());
  226. emit<Bytecode::Op::PutByIdWithThis>(super_reference.base, super_reference.this_value, identifier_table_ref);
  227. }
  228. } else {
  229. TRY(expression.object().generate_bytecode(*this));
  230. auto object_reg = allocate_register();
  231. emit<Bytecode::Op::Store>(object_reg);
  232. if (expression.is_computed()) {
  233. TRY(expression.property().generate_bytecode(*this));
  234. auto property_reg = allocate_register();
  235. emit<Bytecode::Op::Store>(property_reg);
  236. emit<Bytecode::Op::Load>(value_reg);
  237. emit<Bytecode::Op::PutByValue>(object_reg, property_reg);
  238. } else if (expression.property().is_identifier()) {
  239. emit<Bytecode::Op::Load>(value_reg);
  240. auto identifier_table_ref = intern_identifier(verify_cast<Identifier>(expression.property()).string());
  241. emit<Bytecode::Op::PutById>(object_reg, identifier_table_ref);
  242. } else if (expression.property().is_private_identifier()) {
  243. emit<Bytecode::Op::Load>(value_reg);
  244. auto identifier_table_ref = intern_identifier(verify_cast<PrivateIdentifier>(expression.property()).string());
  245. emit<Bytecode::Op::PutPrivateById>(object_reg, identifier_table_ref);
  246. } else {
  247. return CodeGenerationError {
  248. &expression,
  249. "Unimplemented non-computed member expression"sv
  250. };
  251. }
  252. }
  253. return {};
  254. }
  255. return CodeGenerationError {
  256. &node,
  257. "Unimplemented/invalid node used a reference"sv
  258. };
  259. }
  260. CodeGenerationErrorOr<void> Generator::emit_delete_reference(JS::ASTNode const& node)
  261. {
  262. if (is<Identifier>(node)) {
  263. auto& identifier = static_cast<Identifier const&>(node);
  264. if (identifier.is_local())
  265. emit<Bytecode::Op::LoadImmediate>(Value(false));
  266. else
  267. emit<Bytecode::Op::DeleteVariable>(intern_identifier(identifier.string()));
  268. return {};
  269. }
  270. if (is<MemberExpression>(node)) {
  271. auto& expression = static_cast<MemberExpression const&>(node);
  272. // https://tc39.es/ecma262/#sec-super-keyword-runtime-semantics-evaluation
  273. if (is<SuperExpression>(expression.object())) {
  274. auto super_reference = TRY(emit_super_reference(expression));
  275. if (super_reference.referenced_name.has_value()) {
  276. emit<Bytecode::Op::DeleteByValueWithThis>(super_reference.this_value, *super_reference.referenced_name);
  277. } else {
  278. auto identifier_table_ref = intern_identifier(verify_cast<Identifier>(expression.property()).string());
  279. emit<Bytecode::Op::DeleteByIdWithThis>(super_reference.this_value, identifier_table_ref);
  280. }
  281. return {};
  282. }
  283. TRY(expression.object().generate_bytecode(*this));
  284. if (expression.is_computed()) {
  285. auto object_reg = allocate_register();
  286. emit<Bytecode::Op::Store>(object_reg);
  287. TRY(expression.property().generate_bytecode(*this));
  288. emit<Bytecode::Op::DeleteByValue>(object_reg);
  289. } else if (expression.property().is_identifier()) {
  290. auto identifier_table_ref = intern_identifier(verify_cast<Identifier>(expression.property()).string());
  291. emit<Bytecode::Op::DeleteById>(identifier_table_ref);
  292. } else {
  293. // NOTE: Trying to delete a private field generates a SyntaxError in the parser.
  294. return CodeGenerationError {
  295. &expression,
  296. "Unimplemented non-computed member expression"sv
  297. };
  298. }
  299. return {};
  300. }
  301. // Though this will have no deletion effect, we still have to evaluate the node as it can have side effects.
  302. // For example: delete a(); delete ++c.b; etc.
  303. // 13.5.1.2 Runtime Semantics: Evaluation, https://tc39.es/ecma262/#sec-delete-operator-runtime-semantics-evaluation
  304. // 1. Let ref be the result of evaluating UnaryExpression.
  305. // 2. ReturnIfAbrupt(ref).
  306. TRY(node.generate_bytecode(*this));
  307. // 3. If ref is not a Reference Record, return true.
  308. emit<Bytecode::Op::LoadImmediate>(Value(true));
  309. // NOTE: The rest of the steps are handled by Delete{Variable,ByValue,Id}.
  310. return {};
  311. }
  312. void Generator::emit_set_variable(JS::Identifier const& identifier, Bytecode::Op::SetVariable::InitializationMode initialization_mode, Bytecode::Op::EnvironmentMode mode)
  313. {
  314. if (identifier.is_local()) {
  315. emit<Bytecode::Op::SetLocal>(identifier.local_variable_index());
  316. } else {
  317. emit<Bytecode::Op::SetVariable>(intern_identifier(identifier.string()), initialization_mode, mode);
  318. }
  319. }
  320. void Generator::generate_break()
  321. {
  322. bool last_was_finally = false;
  323. // FIXME: Reduce code duplication
  324. for (size_t i = m_boundaries.size(); i > 0; --i) {
  325. auto boundary = m_boundaries[i - 1];
  326. using enum BlockBoundaryType;
  327. switch (boundary) {
  328. case Break:
  329. emit<Op::Jump>().set_targets(nearest_breakable_scope(), {});
  330. return;
  331. case Unwind:
  332. if (!last_was_finally)
  333. emit<Bytecode::Op::LeaveUnwindContext>();
  334. last_was_finally = false;
  335. break;
  336. case LeaveLexicalEnvironment:
  337. emit<Bytecode::Op::LeaveLexicalEnvironment>();
  338. break;
  339. case Continue:
  340. break;
  341. case ReturnToFinally: {
  342. auto& block = make_block(DeprecatedString::formatted("{}.break", current_block().name()));
  343. emit<Op::ScheduleJump>(Label { block });
  344. switch_to_basic_block(block);
  345. last_was_finally = true;
  346. break;
  347. };
  348. }
  349. }
  350. VERIFY_NOT_REACHED();
  351. }
  352. void Generator::generate_break(DeprecatedFlyString const& break_label)
  353. {
  354. size_t current_boundary = m_boundaries.size();
  355. bool last_was_finally = false;
  356. for (auto const& breakable_scope : m_breakable_scopes.in_reverse()) {
  357. for (; current_boundary > 0; --current_boundary) {
  358. auto boundary = m_boundaries[current_boundary - 1];
  359. if (boundary == BlockBoundaryType::Unwind) {
  360. if (!last_was_finally)
  361. emit<Bytecode::Op::LeaveUnwindContext>();
  362. last_was_finally = false;
  363. } else if (boundary == BlockBoundaryType::LeaveLexicalEnvironment) {
  364. emit<Bytecode::Op::LeaveLexicalEnvironment>();
  365. } else if (boundary == BlockBoundaryType::ReturnToFinally) {
  366. auto& block = make_block(DeprecatedString::formatted("{}.break", current_block().name()));
  367. emit<Op::ScheduleJump>(Label { block });
  368. switch_to_basic_block(block);
  369. last_was_finally = true;
  370. } else if (boundary == BlockBoundaryType::Break) {
  371. // Make sure we don't process this boundary twice if the current breakable scope doesn't contain the target label.
  372. --current_boundary;
  373. break;
  374. }
  375. }
  376. if (breakable_scope.language_label_set.contains_slow(break_label)) {
  377. emit<Op::Jump>().set_targets(breakable_scope.bytecode_target, {});
  378. return;
  379. }
  380. }
  381. // We must have a breakable scope available that contains the label, as this should be enforced by the parser.
  382. VERIFY_NOT_REACHED();
  383. }
  384. void Generator::generate_continue()
  385. {
  386. bool last_was_finally = false;
  387. // FIXME: Reduce code duplication
  388. for (size_t i = m_boundaries.size(); i > 0; --i) {
  389. auto boundary = m_boundaries[i - 1];
  390. using enum BlockBoundaryType;
  391. switch (boundary) {
  392. case Continue:
  393. emit<Op::Jump>().set_targets(nearest_continuable_scope(), {});
  394. return;
  395. case Unwind:
  396. if (!last_was_finally)
  397. emit<Bytecode::Op::LeaveUnwindContext>();
  398. last_was_finally = false;
  399. break;
  400. case LeaveLexicalEnvironment:
  401. emit<Bytecode::Op::LeaveLexicalEnvironment>();
  402. break;
  403. case Break:
  404. break;
  405. case ReturnToFinally: {
  406. auto& block = make_block(DeprecatedString::formatted("{}.continue", current_block().name()));
  407. emit<Op::ScheduleJump>(Label { block });
  408. switch_to_basic_block(block);
  409. last_was_finally = true;
  410. break;
  411. };
  412. }
  413. }
  414. VERIFY_NOT_REACHED();
  415. }
  416. void Generator::generate_continue(DeprecatedFlyString const& continue_label)
  417. {
  418. size_t current_boundary = m_boundaries.size();
  419. bool last_was_finally = false;
  420. for (auto const& continuable_scope : m_continuable_scopes.in_reverse()) {
  421. for (; current_boundary > 0; --current_boundary) {
  422. auto boundary = m_boundaries[current_boundary - 1];
  423. if (boundary == BlockBoundaryType::Unwind) {
  424. if (!last_was_finally)
  425. emit<Bytecode::Op::LeaveUnwindContext>();
  426. last_was_finally = false;
  427. } else if (boundary == BlockBoundaryType::LeaveLexicalEnvironment) {
  428. emit<Bytecode::Op::LeaveLexicalEnvironment>();
  429. } else if (boundary == BlockBoundaryType::ReturnToFinally) {
  430. auto& block = make_block(DeprecatedString::formatted("{}.continue", current_block().name()));
  431. emit<Op::ScheduleJump>(Label { block });
  432. switch_to_basic_block(block);
  433. last_was_finally = true;
  434. } else if (boundary == BlockBoundaryType::Continue) {
  435. // Make sure we don't process this boundary twice if the current continuable scope doesn't contain the target label.
  436. --current_boundary;
  437. break;
  438. }
  439. }
  440. if (continuable_scope.language_label_set.contains_slow(continue_label)) {
  441. emit<Op::Jump>().set_targets(continuable_scope.bytecode_target, {});
  442. return;
  443. }
  444. }
  445. // We must have a continuable scope available that contains the label, as this should be enforced by the parser.
  446. VERIFY_NOT_REACHED();
  447. }
  448. void Generator::push_home_object(Register register_)
  449. {
  450. m_home_objects.append(register_);
  451. }
  452. void Generator::pop_home_object()
  453. {
  454. m_home_objects.take_last();
  455. }
  456. void Generator::emit_new_function(FunctionExpression const& function_node, Optional<IdentifierTableIndex> lhs_name)
  457. {
  458. if (m_home_objects.is_empty())
  459. emit<Op::NewFunction>(function_node, lhs_name);
  460. else
  461. emit<Op::NewFunction>(function_node, lhs_name, m_home_objects.last());
  462. }
  463. CodeGenerationErrorOr<void> Generator::emit_named_evaluation_if_anonymous_function(Expression const& expression, Optional<IdentifierTableIndex> lhs_name)
  464. {
  465. if (is<FunctionExpression>(expression)) {
  466. auto const& function_expression = static_cast<FunctionExpression const&>(expression);
  467. if (!function_expression.has_name()) {
  468. TRY(function_expression.generate_bytecode_with_lhs_name(*this, move(lhs_name)));
  469. return {};
  470. }
  471. }
  472. if (is<ClassExpression>(expression)) {
  473. auto const& class_expression = static_cast<ClassExpression const&>(expression);
  474. if (!class_expression.has_name()) {
  475. TRY(class_expression.generate_bytecode_with_lhs_name(*this, move(lhs_name)));
  476. return {};
  477. }
  478. }
  479. TRY(expression.generate_bytecode(*this));
  480. return {};
  481. }
  482. void Generator::emit_get_by_id(IdentifierTableIndex id)
  483. {
  484. emit<Op::GetById>(id, m_next_property_lookup_cache++);
  485. }
  486. void Generator::emit_get_by_id_with_this(IdentifierTableIndex id, Register this_reg)
  487. {
  488. emit<Op::GetByIdWithThis>(id, this_reg, m_next_property_lookup_cache++);
  489. }
  490. }