OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/interpreter/interpreter.h" | 5 #include "src/interpreter/interpreter.h" |
6 | 6 |
7 #include <fstream> | 7 #include <fstream> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
(...skipping 1576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1587 Node* index = __ BytecodeOperandIdx(0); | 1587 Node* index = __ BytecodeOperandIdx(0); |
1588 Node* relative_jump = __ LoadAndUntagConstantPoolEntry(index); | 1588 Node* relative_jump = __ LoadAndUntagConstantPoolEntry(index); |
1589 __ JumpIfWordNotEqual(accumulator, the_hole_value, relative_jump); | 1589 __ JumpIfWordNotEqual(accumulator, the_hole_value, relative_jump); |
1590 } | 1590 } |
1591 | 1591 |
1592 // CreateRegExpLiteral <pattern_idx> <literal_idx> <flags> | 1592 // CreateRegExpLiteral <pattern_idx> <literal_idx> <flags> |
1593 // | 1593 // |
1594 // Creates a regular expression literal for literal index <literal_idx> with | 1594 // Creates a regular expression literal for literal index <literal_idx> with |
1595 // <flags> and the pattern in <pattern_idx>. | 1595 // <flags> and the pattern in <pattern_idx>. |
1596 void Interpreter::DoCreateRegExpLiteral(InterpreterAssembler* assembler) { | 1596 void Interpreter::DoCreateRegExpLiteral(InterpreterAssembler* assembler) { |
1597 Callable callable = CodeFactory::FastCloneRegExp(isolate_); | |
1598 Node* target = __ HeapConstant(callable.code()); | |
1599 Node* index = __ BytecodeOperandIdx(0); | 1597 Node* index = __ BytecodeOperandIdx(0); |
1600 Node* pattern = __ LoadConstantPoolEntry(index); | 1598 Node* pattern = __ LoadConstantPoolEntry(index); |
1601 Node* literal_index_raw = __ BytecodeOperandIdx(1); | 1599 Node* literal_index_raw = __ BytecodeOperandIdx(1); |
1602 Node* literal_index = __ SmiTag(literal_index_raw); | 1600 Node* literal_index = __ SmiTag(literal_index_raw); |
1603 Node* flags_raw = __ BytecodeOperandFlag(2); | 1601 Node* flags_raw = __ BytecodeOperandFlag(2); |
1604 Node* flags = __ SmiTag(flags_raw); | 1602 Node* flags = __ SmiTag(flags_raw); |
1605 Node* closure = __ LoadRegister(Register::function_closure()); | 1603 Node* closure = __ LoadRegister(Register::function_closure()); |
1606 Node* context = __ GetContext(); | 1604 Node* context = __ GetContext(); |
1607 Node* result = __ CallStub(callable.descriptor(), target, context, closure, | 1605 Node* result = FastCloneRegExpStub::Generate( |
1608 literal_index, pattern, flags); | 1606 assembler, closure, literal_index, pattern, flags, context); |
1609 __ SetAccumulator(result); | 1607 __ SetAccumulator(result); |
1610 __ Dispatch(); | 1608 __ Dispatch(); |
1611 } | 1609 } |
1612 | 1610 |
1613 // CreateArrayLiteral <element_idx> <literal_idx> <flags> | 1611 // CreateArrayLiteral <element_idx> <literal_idx> <flags> |
1614 // | 1612 // |
1615 // Creates an array literal for literal index <literal_idx> with flags <flags> | 1613 // Creates an array literal for literal index <literal_idx> with flags <flags> |
1616 // and constant elements in <element_idx>. | 1614 // and constant elements in <element_idx>. |
1617 void Interpreter::DoCreateArrayLiteral(InterpreterAssembler* assembler) { | 1615 void Interpreter::DoCreateArrayLiteral(InterpreterAssembler* assembler) { |
1618 Node* index = __ BytecodeOperandIdx(0); | 1616 Node* index = __ BytecodeOperandIdx(0); |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2172 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 2170 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
2173 __ SmiTag(new_state)); | 2171 __ SmiTag(new_state)); |
2174 __ SetAccumulator(old_state); | 2172 __ SetAccumulator(old_state); |
2175 | 2173 |
2176 __ Dispatch(); | 2174 __ Dispatch(); |
2177 } | 2175 } |
2178 | 2176 |
2179 } // namespace interpreter | 2177 } // namespace interpreter |
2180 } // namespace internal | 2178 } // namespace internal |
2181 } // namespace v8 | 2179 } // namespace v8 |
OLD | NEW |