зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1740737 - Part 3: Transpile ArrayFromArgumentsObjectResult. r=iain
The transpiled code simply calls a VM function and performs no further optimisations. Differential Revision: https://phabricator.services.mozilla.com/D130988
This commit is contained in:
Родитель
109673303b
Коммит
4a701b65c8
|
@ -2782,7 +2782,7 @@
|
|||
|
||||
- name: ArrayFromArgumentsObjectResult
|
||||
shared: true
|
||||
transpile: false
|
||||
transpile: true
|
||||
cost_estimate: 5
|
||||
args:
|
||||
obj: ObjId
|
||||
|
|
|
@ -64,6 +64,7 @@
|
|||
#include "vm/AsyncIteration.h"
|
||||
#include "vm/BuiltinObjectKind.h"
|
||||
#include "vm/FunctionFlags.h" // js::FunctionFlags
|
||||
#include "vm/Interpreter.h"
|
||||
#include "vm/JSAtom.h"
|
||||
#include "vm/MatchPairs.h"
|
||||
#include "vm/RegExpObject.h"
|
||||
|
@ -7575,6 +7576,14 @@ void CodeGenerator::visitArgumentsObjectLength(LArgumentsObjectLength* lir) {
|
|||
bailoutFrom(&bail, lir->snapshot());
|
||||
}
|
||||
|
||||
void CodeGenerator::visitArrayFromArgumentsObject(
|
||||
LArrayFromArgumentsObject* lir) {
|
||||
pushArg(ToRegister(lir->argsObject()));
|
||||
|
||||
using Fn = ArrayObject* (*)(JSContext*, Handle<ArgumentsObject*>);
|
||||
callVM<Fn, js::ArrayFromArgumentsObject>(lir);
|
||||
}
|
||||
|
||||
void CodeGenerator::visitGuardArgumentsObjectFlags(
|
||||
LGuardArgumentsObjectFlags* lir) {
|
||||
Register argsObj = ToRegister(lir->argsObject());
|
||||
|
|
|
@ -424,6 +424,14 @@
|
|||
operands:
|
||||
argsObject: WordSized
|
||||
|
||||
# Create an array from an arguments object.
|
||||
- name: ArrayFromArgumentsObject
|
||||
result_type: WordSized
|
||||
operands:
|
||||
argsObject: WordSized
|
||||
call_instruction: true
|
||||
mir_op: true
|
||||
|
||||
# Guard that the given flags are not set on the arguments object.
|
||||
- name: GuardArgumentsObjectFlags
|
||||
operands:
|
||||
|
|
|
@ -423,6 +423,17 @@ void LIRGenerator::visitArgumentsObjectLength(MArgumentsObjectLength* ins) {
|
|||
define(lir, ins);
|
||||
}
|
||||
|
||||
void LIRGenerator::visitArrayFromArgumentsObject(
|
||||
MArrayFromArgumentsObject* ins) {
|
||||
MDefinition* argsObj = ins->argsObject();
|
||||
MOZ_ASSERT(argsObj->type() == MIRType::Object);
|
||||
|
||||
auto* lir =
|
||||
new (alloc()) LArrayFromArgumentsObject(useRegisterAtStart(argsObj));
|
||||
defineReturn(lir, ins);
|
||||
assignSafepoint(lir, ins);
|
||||
}
|
||||
|
||||
void LIRGenerator::visitGuardArgumentsObjectFlags(
|
||||
MGuardArgumentsObjectFlags* ins) {
|
||||
MDefinition* argsObj = ins->argsObject();
|
||||
|
|
|
@ -459,6 +459,13 @@
|
|||
# property read.
|
||||
alias_set: custom
|
||||
|
||||
# Create an array from an arguments object.
|
||||
- name: ArrayFromArgumentsObject
|
||||
operands:
|
||||
argsObject: Object
|
||||
result_type: Object
|
||||
possibly_calls: true
|
||||
|
||||
# Guard that the given flags are not set on the arguments object.
|
||||
- name: GuardArgumentsObjectFlags
|
||||
operands:
|
||||
|
|
|
@ -1602,6 +1602,17 @@ bool WarpCacheIRTranspiler::emitLoadArgumentsObjectLengthResult(
|
|||
return true;
|
||||
}
|
||||
|
||||
bool WarpCacheIRTranspiler::emitArrayFromArgumentsObjectResult(
|
||||
ObjOperandId objId) {
|
||||
MDefinition* obj = getOperand(objId);
|
||||
|
||||
auto* array = MArrayFromArgumentsObject::New(alloc(), obj);
|
||||
addEffectful(array);
|
||||
|
||||
pushResult(array);
|
||||
return resumeAfter(array);
|
||||
}
|
||||
|
||||
bool WarpCacheIRTranspiler::emitLoadFunctionLengthResult(ObjOperandId objId) {
|
||||
MDefinition* obj = getOperand(objId);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче