23 if (FLAG_trace_representation) PrintF x
65 count_(jsgraph->graph()->NodeCount()),
78 TRACE((
"--{Propagation phase}--\n"));
83 Node* node =
queue_.front();
87 TRACE((
" visit #%d: %s\n", node->id(), node->op()->mnemonic()));
89 TRACE((
" ==> output "));
95 TRACE((
"--{Simplified lowering phase}--\n"));
100 TRACE((
" visit #%d: %s\n", node->id(), node->op()->mnemonic()));
109 Node* replacement = *(++
i);
110 node->ReplaceUses(replacement);
125 TRACE((
" initial: "));
130 TRACE((
" queue?: "));
139 TRACE((
" inqueue: "));
168 Node* input = node->InputAt(index);
178 TRACE((
" change: #%d:%s(@%d #%d:%s) ", node->id(),
179 node->op()->mnemonic(), index, input->id(),
180 input->op()->mnemonic()));
187 node->ReplaceInput(index, n);
277 Node::Inputs inputs = node->inputs();
278 for (Node::Inputs::iterator iter(inputs.begin()); iter != inputs.end();
299 }
else if (use_rep &
kRepBit) {
328 if (type != OpParameter<MachineType>(node)) {
329 node->set_op(lowering->
common()->Phi(type, values));
333 Node::Inputs inputs = node->inputs();
334 for (Node::Inputs::iterator iter(inputs.begin()); iter != inputs.end();
337 ProcessInput(node, iter.index(), values > 0 ? output_type : 0);
358 switch (node->opcode()) {
362 case IrOpcode::kStart:
363 case IrOpcode::kDead:
365 case IrOpcode::kParameter: {
372 case IrOpcode::kInt32Constant:
374 case IrOpcode::kInt64Constant:
376 case IrOpcode::kFloat64Constant:
378 case IrOpcode::kExternalConstant:
380 case IrOpcode::kNumberConstant:
382 case IrOpcode::kHeapConstant:
386 case IrOpcode::kIfTrue:
387 case IrOpcode::kIfFalse:
388 case IrOpcode::kReturn:
389 case IrOpcode::kMerge:
390 case IrOpcode::kThrow:
393 case IrOpcode::kBranch:
408 #define DEFINE_JS_CASE(x) case IrOpcode::k##x:
410 #undef DEFINE_JS_CASE
418 case IrOpcode::kBooleanNot: {
423 node->set_op(lowering->
machine()->WordEqual());
427 node->set_op(lowering->
machine()->WordEqual());
437 case IrOpcode::kBooleanToNumber: {
445 node->set_op(lowering->
machine()->WordEqual());
455 case IrOpcode::kNumberEqual:
456 case IrOpcode::kNumberLessThan:
457 case IrOpcode::kNumberLessThanOrEqual: {
474 case IrOpcode::kNumberAdd:
475 case IrOpcode::kNumberSubtract: {
495 case IrOpcode::kNumberMultiply:
496 case IrOpcode::kNumberDivide:
497 case IrOpcode::kNumberModulus: {
503 case IrOpcode::kNumberToInt32: {
516 node->set_op(lowering->
machine()->TruncateFloat64ToInt32());
524 case IrOpcode::kNumberToUint32: {
538 node->set_op(lowering->
machine()->TruncateFloat64ToInt32());
546 case IrOpcode::kReferenceEqual: {
548 if (
lower()) node->set_op(lowering->
machine()->WordEqual());
551 case IrOpcode::kStringEqual: {
556 case IrOpcode::kStringLessThan: {
561 case IrOpcode::kStringLessThanOrEqual: {
566 case IrOpcode::kStringAdd: {
571 case IrOpcode::kLoadField: {
579 case IrOpcode::kStoreField: {
588 case IrOpcode::kLoadElement: {
598 case IrOpcode::kStoreElement: {
613 case IrOpcode::kLoad: {
623 case IrOpcode::kStore: {
626 StoreRepresentation rep = OpParameter<StoreRepresentation>(node);
634 case IrOpcode::kWord32Shr:
637 case IrOpcode::kWord32And:
638 case IrOpcode::kWord32Or:
639 case IrOpcode::kWord32Xor:
640 case IrOpcode::kWord32Shl:
641 case IrOpcode::kWord32Sar:
646 case IrOpcode::kWord32Equal:
649 case IrOpcode::kInt32Add:
650 case IrOpcode::kInt32Sub:
651 case IrOpcode::kInt32Mul:
652 case IrOpcode::kInt32Div:
653 case IrOpcode::kInt32Mod:
655 case IrOpcode::kInt32UDiv:
656 case IrOpcode::kInt32UMod:
658 case IrOpcode::kInt32LessThan:
659 case IrOpcode::kInt32LessThanOrEqual:
662 case IrOpcode::kUint32LessThan:
663 case IrOpcode::kUint32LessThanOrEqual:
666 case IrOpcode::kInt64Add:
667 case IrOpcode::kInt64Sub:
668 case IrOpcode::kInt64Mul:
669 case IrOpcode::kInt64Div:
670 case IrOpcode::kInt64Mod:
672 case IrOpcode::kInt64LessThan:
673 case IrOpcode::kInt64LessThanOrEqual:
676 case IrOpcode::kInt64UDiv:
677 case IrOpcode::kInt64UMod:
680 case IrOpcode::kWord64And:
681 case IrOpcode::kWord64Or:
682 case IrOpcode::kWord64Xor:
683 case IrOpcode::kWord64Shl:
684 case IrOpcode::kWord64Shr:
685 case IrOpcode::kWord64Sar:
687 case IrOpcode::kWord64Equal:
690 case IrOpcode::kChangeInt32ToInt64:
693 case IrOpcode::kChangeUint32ToUint64:
696 case IrOpcode::kTruncateFloat64ToFloat32:
699 case IrOpcode::kTruncateInt64ToInt32:
704 case IrOpcode::kChangeFloat32ToFloat64:
707 case IrOpcode::kChangeInt32ToFloat64:
710 case IrOpcode::kChangeUint32ToFloat64:
713 case IrOpcode::kChangeFloat64ToInt32:
716 case IrOpcode::kChangeFloat64ToUint32:
720 case IrOpcode::kFloat64Add:
721 case IrOpcode::kFloat64Sub:
722 case IrOpcode::kFloat64Mul:
723 case IrOpcode::kFloat64Div:
724 case IrOpcode::kFloat64Mod:
726 case IrOpcode::kFloat64Sqrt:
728 case IrOpcode::kFloat64Equal:
729 case IrOpcode::kFloat64LessThan:
730 case IrOpcode::kFloat64LessThanOrEqual:
739 if (replacement->id() <
count_) {
741 node->ReplaceUses(replacement);
754 TRACE((
"#%d:%-20s ", node->id(), node->op()->mnemonic()));
760 if (FLAG_trace_representation) {
762 os << static_cast<MachineType>(info);
780 return &
info_[node->id()];
796 SimplifiedOperatorBuilder simplified(
graph()->
zone());
840 node->InsertInput(
zone(), 1, offset);
851 node->InsertInput(
zone(), 1, offset);
858 if (element_size != 1) {
860 jsgraph()->Int32Constant(element_size), index);
863 if (fixed_offset == 0)
return index;
865 jsgraph()->Int32Constant(fixed_offset));
872 node->ReplaceInput(1,
ComputeIndex(access, node->InputAt(1)));
873 node->RemoveInput(2);
883 node->ReplaceInput(1,
ComputeIndex(access, node->InputAt(1)));
884 node->RemoveInput(2);
889 Callable callable = CodeFactory::StringAdd(
891 CallDescriptor::Flags
flags = CallDescriptor::kNoFlags;
892 CallDescriptor* desc =
894 node->set_op(
common()->Call(desc));
895 node->InsertInput(
zone(), 0,
jsgraph()->HeapConstant(callable.code()));
896 node->AppendInput(
zone(),
jsgraph()->UndefinedConstant());
897 node->AppendInput(
zone(),
graph()->start());
898 node->AppendInput(
zone(),
graph()->start());
905 requires_ordering ? Runtime::kStringCompare : Runtime::kStringEquals;
906 ExternalReference ref(f,
zone()->isolate());
912 jsgraph()->HeapConstant(stub.GetCode()),
915 jsgraph()->ExternalConstant(ref),
917 jsgraph()->UndefinedConstant());
922 node->set_op(
machine()->WordEqual());
929 node->set_op(
machine()->IntLessThan());
936 node->set_op(
machine()->IntLessThanOrEqual());
Node * NewNode(const Operator *op, int input_count, Node **inputs)
Node * Int32Constant(int32_t value)
CallDescriptor * GetStubCallDescriptor(CallInterfaceDescriptor descriptor, int stack_parameter_count=0, CallDescriptor::Flags flags=CallDescriptor::kNoFlags)
CallDescriptor * GetRuntimeCallDescriptor(Runtime::FunctionId function, int parameter_count, Operator::Properties properties)
static int FirstEffectIndex(Node *node)
static int PastControlIndex(Node *node)
static Node * GetValueInput(Node *node, int index)
static int PastEffectIndex(Node *node)
static Bounds GetBounds(Node *node)
static int FirstControlIndex(Node *node)
static int PastValueIndex(Node *node)
static int PastContextIndex(Node *node)
static Node * GetControlInput(Node *node, int index=0)
static int GetEffectInputCount(const Operator *op)
static int GetContextInputCount(const Operator *op)
static int GetValueInputCount(const Operator *op)
static int GetControlInputCount(const Operator *op)
base::Flags< Property, uint8_t > Properties
const Operator * Float64OperatorFor(IrOpcode::Value opcode)
Node * GetRepresentationFor(Node *node, MachineTypeUnion output_type, MachineTypeUnion use_type)
const Operator * Int32OperatorFor(IrOpcode::Value opcode)
MachineType TypeForBasePointer(const FieldAccess &access)
const Operator * Uint32OperatorFor(IrOpcode::Value opcode)
MachineType TypeFromUpperBound(Type *type)
const Operator * Uint32Op(Node *node)
MachineTypeUnion GetUseInfo(Node *node)
void ProcessRemainingInputs(Node *node, int index)
void VisitNode(Node *node, MachineTypeUnion use, SimplifiedLowering *lowering)
void VisitFloat64Binop(Node *node)
void VisitInt32Cmp(Node *node)
bool BothInputsAre(Node *node, Type *type)
void VisitInt64Cmp(Node *node)
void VisitUnop(Node *node, MachineTypeUnion input_use, MachineTypeUnion output)
void VisitLeaf(Node *node, MachineTypeUnion output)
RepresentationChanger * changer_
void VisitUint64Cmp(Node *node)
RepresentationSelector(JSGraph *jsgraph, Zone *zone, RepresentationChanger *changer)
void DeferReplacement(Node *node, Node *replacement)
void VisitInt32Binop(Node *node)
void VisitUint32Cmp(Node *node)
void VisitFloat64Cmp(Node *node)
void VisitPhi(Node *node, MachineTypeUnion use, SimplifiedLowering *lowering)
const Operator * Int32Op(Node *node)
void VisitInputs(Node *node)
void PrintUseInfo(Node *node)
void Run(SimplifiedLowering *lowering)
void PrintInfo(MachineTypeUnion info)
void ProcessInput(Node *node, int index, MachineTypeUnion use)
NodeInfo * GetInfo(Node *node)
void VisitBinop(Node *node, MachineTypeUnion input_use, MachineTypeUnion output)
void SetOutput(Node *node, MachineTypeUnion output)
ZoneQueue< Node * > queue_
void VisitUint64Binop(Node *node)
void Enqueue(Node *node, MachineTypeUnion use=0)
void VisitUint32Binop(Node *node)
void VisitInt64Binop(Node *node)
const Operator * Float64Op(Node *node)
void Enqueue(Node *node, MachineType use)
void DoStringLessThanOrEqual(Node *node)
Node * ComputeIndex(const ElementAccess &access, Node *index)
void DoLoadField(Node *node)
void DoStringAdd(Node *node)
void DoStringLessThan(Node *node)
Node * StringComparison(Node *node, bool requires_ordering)
Node * OffsetMinusTagConstant(int32_t offset)
Node * IsTagged(Node *node)
void DoLoadElement(Node *node)
Node * SmiTag(Node *node)
CommonOperatorBuilder * common()
MachineOperatorBuilder * machine()
void DoStoreField(Node *node)
void DoStringEqual(Node *node)
void DoStoreElement(Node *node)
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to use(in kBytes)") DEFINE_INT(max_stack_trace_source_length
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL
#define DCHECK_GE(v1, v2)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)
bool IsPowerOfTwo32(uint32_t value)
const MachineTypeUnion kRepMask
const ElementAccess & ElementAccessOf(const Operator *op)
uint16_t MachineTypeUnion
STATIC_ASSERT(DoubleRegister::kMaxNumAllocatableRegisters >=Register::kMaxNumAllocatableRegisters)
MachineType RepresentationOf(MachineType machine_type)
static WriteBarrierKind ComputeWriteBarrierKind(BaseTaggedness base_is_tagged, MachineType representation, Type *type)
Node::Inputs::iterator InputIter
const MachineTypeUnion kTypeMask
const FieldAccess & FieldAccessOf(const Operator *op)
int ElementSizeOf(MachineType machine_type)
T * NewArray(size_t size)
const intptr_t kSmiTagMask
Debugger support for the V8 JavaScript engine.
#define DEFINE_JS_CASE(x)
BaseTaggedness base_is_tagged
BaseTaggedness base_is_tagged