diff options
Diffstat (limited to 'deps/v8/src/interpreter/interpreter-generator.cc')
-rw-r--r-- | deps/v8/src/interpreter/interpreter-generator.cc | 61 |
1 files changed, 42 insertions, 19 deletions
diff --git a/deps/v8/src/interpreter/interpreter-generator.cc b/deps/v8/src/interpreter/interpreter-generator.cc index 74ebaabcc7e..afca2a8a324 100644 --- a/deps/v8/src/interpreter/interpreter-generator.cc +++ b/deps/v8/src/interpreter/interpreter-generator.cc @@ -19,6 +19,7 @@ #include "src/interpreter/interpreter-assembler.h" #include "src/interpreter/interpreter-intrinsics-generator.h" #include "src/objects-inl.h" +#include "src/objects/js-generator.h" #include "src/objects/module.h" namespace v8 { @@ -680,8 +681,8 @@ IGNITION_HANDLER(LdaModuleVariable, InterpreterAssembler) { BIND(&if_export); { - Node* regular_exports = - LoadObjectField(module, Module::kRegularExportsOffset); + TNode<FixedArray> regular_exports = + CAST(LoadObjectField(module, Module::kRegularExportsOffset)); // The actual array index is (cell_index - 1). Node* export_index = IntPtrSub(cell_index, IntPtrConstant(1)); Node* cell = LoadFixedArrayElement(regular_exports, export_index); @@ -691,8 +692,8 @@ IGNITION_HANDLER(LdaModuleVariable, InterpreterAssembler) { BIND(&if_import); { - Node* regular_imports = - LoadObjectField(module, Module::kRegularImportsOffset); + TNode<FixedArray> regular_imports = + CAST(LoadObjectField(module, Module::kRegularImportsOffset)); // The actual array index is (-cell_index - 1). Node* import_index = IntPtrSub(IntPtrConstant(-1), cell_index); Node* cell = LoadFixedArrayElement(regular_imports, import_index); @@ -722,8 +723,8 @@ IGNITION_HANDLER(StaModuleVariable, InterpreterAssembler) { BIND(&if_export); { - Node* regular_exports = - LoadObjectField(module, Module::kRegularExportsOffset); + TNode<FixedArray> regular_exports = + CAST(LoadObjectField(module, Module::kRegularExportsOffset)); // The actual array index is (cell_index - 1). Node* export_index = IntPtrSub(cell_index, IntPtrConstant(1)); Node* cell = LoadFixedArrayElement(regular_exports, export_index); @@ -1069,7 +1070,7 @@ IGNITION_HANDLER(BitwiseNot, InterpreterAssembler) { // Number case. BIND(&if_number); TNode<Number> result = - ChangeInt32ToTagged(Signed(Word32Not(var_word32.value()))); + ChangeInt32ToTagged(Signed(Word32BitwiseNot(var_word32.value()))); TNode<Smi> result_type = SelectSmiConstant( TaggedIsSmi(result), BinaryOperationFeedback::kSignedSmall, BinaryOperationFeedback::kNumber); @@ -1814,7 +1815,7 @@ IGNITION_HANDLER(TestIn, InterpreterAssembler) { Node* object = GetAccumulator(); Node* context = GetContext(); - SetAccumulator(HasProperty(object, property, context, kHasProperty)); + SetAccumulator(HasProperty(context, object, property, kHasProperty)); Dispatch(); } @@ -2436,6 +2437,26 @@ IGNITION_HANDLER(CreateEmptyObjectLiteral, InterpreterAssembler) { Dispatch(); } +// CloneObject <source_idx> <flags> <feedback_slot> +// +// Allocates a new JSObject with each enumerable own property copied from +// {source}, converting getters into data properties. +IGNITION_HANDLER(CloneObject, InterpreterAssembler) { + Node* source = LoadRegisterAtOperandIndex(0); + Node* bytecode_flags = BytecodeOperandFlag(1); + Node* raw_flags = + DecodeWordFromWord32<CreateObjectLiteralFlags::FlagsBits>(bytecode_flags); + Node* smi_flags = SmiTag(raw_flags); + Node* raw_slot = BytecodeOperandIdx(2); + Node* smi_slot = SmiTag(raw_slot); + Node* feedback_vector = LoadFeedbackVector(); + Node* context = GetContext(); + Node* result = CallBuiltin(Builtins::kCloneObjectIC, context, source, + smi_flags, smi_slot, feedback_vector); + SetAccumulator(result); + Dispatch(); +} + // GetTemplateObject <descriptor_idx> <literal_idx> // // Creates the template to pass for tagged templates and returns it in the @@ -2911,7 +2932,7 @@ IGNITION_HANDLER(ForInNext, InterpreterAssembler) { Node* feedback_vector = LoadFeedbackVector(); // Load the next key from the enumeration array. - Node* key = LoadFixedArrayElement(cache_array, index, 0, + Node* key = LoadFixedArrayElement(CAST(cache_array), index, 0, CodeStubAssembler::SMI_PARAMETERS); // Check if we can use the for-in fast path potentially using the enum cache. @@ -3004,8 +3025,8 @@ IGNITION_HANDLER(Illegal, InterpreterAssembler) { // in the accumulator. IGNITION_HANDLER(SuspendGenerator, InterpreterAssembler) { Node* generator = LoadRegisterAtOperandIndex(0); - Node* array = LoadObjectField( - generator, JSGeneratorObject::kParametersAndRegistersOffset); + TNode<FixedArray> array = CAST(LoadObjectField( + generator, JSGeneratorObject::kParametersAndRegistersOffset)); Node* closure = LoadRegister(Register::function_closure()); Node* context = GetContext(); RegListNodePair registers = GetRegisterListAtOperandIndex(1); @@ -3013,9 +3034,9 @@ IGNITION_HANDLER(SuspendGenerator, InterpreterAssembler) { Node* shared = LoadObjectField(closure, JSFunction::kSharedFunctionInfoOffset); - Node* formal_parameter_count = + TNode<Int32T> formal_parameter_count = UncheckedCast<Int32T>( LoadObjectField(shared, SharedFunctionInfo::kFormalParameterCountOffset, - MachineType::Uint16()); + MachineType::Uint16())); ExportParametersAndRegisterFile(array, registers, formal_parameter_count); StoreObjectField(generator, JSGeneratorObject::kContextOffset, context); @@ -3087,13 +3108,13 @@ IGNITION_HANDLER(ResumeGenerator, InterpreterAssembler) { Node* shared = LoadObjectField(closure, JSFunction::kSharedFunctionInfoOffset); - Node* formal_parameter_count = + TNode<Int32T> formal_parameter_count = UncheckedCast<Int32T>( LoadObjectField(shared, SharedFunctionInfo::kFormalParameterCountOffset, - MachineType::Uint16()); + MachineType::Uint16())); ImportRegisterFile( - LoadObjectField(generator, - JSGeneratorObject::kParametersAndRegistersOffset), + CAST(LoadObjectField(generator, + JSGeneratorObject::kParametersAndRegistersOffset)), registers, formal_parameter_count); // Return the generator's input_or_debug_pos in the accumulator. @@ -3106,14 +3127,16 @@ IGNITION_HANDLER(ResumeGenerator, InterpreterAssembler) { } // namespace Handle<Code> GenerateBytecodeHandler(Isolate* isolate, Bytecode bytecode, - OperandScale operand_scale) { + OperandScale operand_scale, + int builtin_index) { Zone zone(isolate->allocator(), ZONE_NAME); compiler::CodeAssemblerState state( isolate, &zone, InterpreterDispatchDescriptor{}, Code::BYTECODE_HANDLER, Bytecodes::ToString(bytecode), FLAG_untrusted_code_mitigations ? PoisoningMitigationLevel::kPoisonCriticalOnly - : PoisoningMitigationLevel::kDontPoison); + : PoisoningMitigationLevel::kDontPoison, + 0, builtin_index); switch (bytecode) { #define CALL_GENERATOR(Name, ...) \ |