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 1635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1646 __ BitFieldDecode<CreateObjectLiteralFlags::FastClonePropertiesCountBits>( | 1646 __ BitFieldDecode<CreateObjectLiteralFlags::FastClonePropertiesCountBits>( |
1647 bytecode_flags); | 1647 bytecode_flags); |
1648 __ BranchIf(fast_clone_properties_count, &if_fast_clone, &if_not_fast_clone); | 1648 __ BranchIf(fast_clone_properties_count, &if_fast_clone, &if_not_fast_clone); |
1649 | 1649 |
1650 __ Bind(&if_fast_clone); | 1650 __ Bind(&if_fast_clone); |
1651 { | 1651 { |
1652 // If we can do a fast clone do the fast-path in FastCloneShallowObjectStub. | 1652 // If we can do a fast clone do the fast-path in FastCloneShallowObjectStub. |
1653 Node* result = FastCloneShallowObjectStub::GenerateFastPath( | 1653 Node* result = FastCloneShallowObjectStub::GenerateFastPath( |
1654 assembler, &if_not_fast_clone, closure, literal_index, | 1654 assembler, &if_not_fast_clone, closure, literal_index, |
1655 fast_clone_properties_count); | 1655 fast_clone_properties_count); |
1656 __ SetAccumulator(result); | 1656 __ StoreRegister(result, __ BytecodeOperandReg(3)); |
1657 __ Dispatch(); | 1657 __ Dispatch(); |
1658 } | 1658 } |
1659 | 1659 |
1660 __ Bind(&if_not_fast_clone); | 1660 __ Bind(&if_not_fast_clone); |
1661 { | 1661 { |
1662 // If we can't do a fast clone, call into the runtime. | 1662 // If we can't do a fast clone, call into the runtime. |
1663 Node* index = __ BytecodeOperandIdx(0); | 1663 Node* index = __ BytecodeOperandIdx(0); |
1664 Node* constant_elements = __ LoadConstantPoolEntry(index); | 1664 Node* constant_elements = __ LoadConstantPoolEntry(index); |
1665 Node* context = __ GetContext(); | 1665 Node* context = __ GetContext(); |
1666 | 1666 |
1667 STATIC_ASSERT(CreateObjectLiteralFlags::FlagsBits::kShift == 0); | 1667 STATIC_ASSERT(CreateObjectLiteralFlags::FlagsBits::kShift == 0); |
1668 Node* flags_raw = __ Word32And( | 1668 Node* flags_raw = __ Word32And( |
1669 bytecode_flags, | 1669 bytecode_flags, |
1670 __ Int32Constant(CreateObjectLiteralFlags::FlagsBits::kMask)); | 1670 __ Int32Constant(CreateObjectLiteralFlags::FlagsBits::kMask)); |
1671 Node* flags = __ SmiTag(flags_raw); | 1671 Node* flags = __ SmiTag(flags_raw); |
1672 | 1672 |
1673 Node* result = | 1673 Node* result = |
1674 __ CallRuntime(Runtime::kCreateObjectLiteral, context, closure, | 1674 __ CallRuntime(Runtime::kCreateObjectLiteral, context, closure, |
1675 literal_index, constant_elements, flags); | 1675 literal_index, constant_elements, flags); |
1676 __ SetAccumulator(result); | 1676 __ StoreRegister(result, __ BytecodeOperandReg(3)); |
1677 // TODO(klaasb) build a single dispatch once the call is inlined | 1677 // TODO(klaasb) build a single dispatch once the call is inlined |
1678 __ Dispatch(); | 1678 __ Dispatch(); |
1679 } | 1679 } |
1680 } | 1680 } |
1681 | 1681 |
1682 // CreateClosure <index> <tenured> | 1682 // CreateClosure <index> <tenured> |
1683 // | 1683 // |
1684 // Creates a new closure for SharedFunctionInfo at position |index| in the | 1684 // Creates a new closure for SharedFunctionInfo at position |index| in the |
1685 // constant pool and with the PretenureFlag <tenured>. | 1685 // constant pool and with the PretenureFlag <tenured>. |
1686 void Interpreter::DoCreateClosure(InterpreterAssembler* assembler) { | 1686 void Interpreter::DoCreateClosure(InterpreterAssembler* assembler) { |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2150 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 2150 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
2151 __ SmiTag(new_state)); | 2151 __ SmiTag(new_state)); |
2152 __ SetAccumulator(old_state); | 2152 __ SetAccumulator(old_state); |
2153 | 2153 |
2154 __ Dispatch(); | 2154 __ Dispatch(); |
2155 } | 2155 } |
2156 | 2156 |
2157 } // namespace interpreter | 2157 } // namespace interpreter |
2158 } // namespace internal | 2158 } // namespace internal |
2159 } // namespace v8 | 2159 } // namespace v8 |
OLD | NEW |