33 #if V8_TARGET_ARCH_IA32
35 #elif V8_TARGET_ARCH_X64
37 #elif V8_TARGET_ARCH_ARM
39 #elif V8_TARGET_ARCH_MIPS
42 #error Unsupported target architecture.
48 #define DEFINE_COMPILE(type) \
49 LInstruction* H##type::CompileToLithium(LChunkBuilder* builder) { \
50 return builder->Do##type(this); \
58 case kNone:
return "v";
71 const int w = FLAG_loop_weight;
72 static const int weights[] = { 1, w, w*w, w*w*w, w*w*w*w };
73 return weights[
Min(
block()->LoopNestingDepth(),
97 return static_cast<int32_t>(result);
102 int64_t result =
static_cast<int64_t
>(a) + static_cast<int64_t>(b);
103 return ConvertAndSetOverflow(result, overflow);
108 int64_t result =
static_cast<int64_t
>(a) - static_cast<int64_t>(b);
109 return ConvertAndSetOverflow(result, overflow);
114 int64_t result =
static_cast<int64_t
>(a) * static_cast<int64_t>(b);
115 return ConvertAndSetOverflow(result, overflow);
120 if (lower_ == upper_)
return lower_;
123 while (res < upper_) {
124 res = (res << 1) | 1;
133 if (value == 0)
return;
134 bool may_overflow =
false;
135 lower_ = AddWithoutOverflow(lower_, value, &may_overflow);
136 upper_ = AddWithoutOverflow(upper_, value, &may_overflow);
144 upper_ =
Min(upper_, other->upper_);
145 lower_ =
Max(lower_, other->lower_);
152 upper_ =
Max(upper_, other->upper_);
153 lower_ =
Min(lower_, other->lower_);
160 upper_ =
Max(upper_, other->upper_);
161 lower_ =
Max(lower_, other->lower_);
167 upper_ =
Min(upper_, other->upper_);
168 lower_ =
Min(lower_, other->lower_);
175 lower_ = lower_ >> bits;
176 upper_ = upper_ >> bits;
183 int old_lower = lower_;
184 int old_upper = upper_;
185 lower_ = lower_ << bits;
186 upper_ = upper_ << bits;
187 if (old_lower != lower_ >> bits || old_upper != upper_ >> bits) {
196 bool may_overflow =
false;
197 lower_ = AddWithoutOverflow(lower_, other->
lower(), &may_overflow);
198 upper_ = AddWithoutOverflow(upper_, other->
upper(), &may_overflow);
208 bool may_overflow =
false;
209 lower_ = SubWithoutOverflow(lower_, other->
upper(), &may_overflow);
210 upper_ = SubWithoutOverflow(upper_, other->
lower(), &may_overflow);
220 if (lower_ > upper_) {
229 void Range::Verify()
const {
236 bool may_overflow =
false;
237 int v1 = MulWithoutOverflow(lower_, other->
lower(), &may_overflow);
238 int v2 = MulWithoutOverflow(lower_, other->
upper(), &may_overflow);
239 int v3 = MulWithoutOverflow(upper_, other->
lower(), &may_overflow);
240 int v4 = MulWithoutOverflow(upper_, other->
upper(), &may_overflow);
252 case kTagged:
return "tagged";
253 case kTaggedPrimitive:
return "primitive";
254 case kTaggedNumber:
return "number";
255 case kSmi:
return "smi";
256 case kHeapNumber:
return "heap-number";
257 case kString:
return "string";
258 case kBoolean:
return "boolean";
259 case kNonPrimitive:
return "non-primitive";
260 case kJSArray:
return "array";
261 case kJSObject:
return "object";
262 case kUninitialized:
return "uninitialized";
265 return "Unreachable code";
271 if (value->IsSmi()) {
273 }
else if (value->IsHeapNumber()) {
275 }
else if (value->IsString()) {
277 }
else if (value->IsBoolean()) {
279 }
else if (value->IsJSObject()) {
281 }
else if (value->IsJSArray()) {
296 tail_ = tail_->tail_;
303 for (HUseIterator it(
uses()); !it.Done(); it.Advance()) {
304 if (!it.value()->CheckFlag(f))
return false;
310 HUseIterator::HUseIterator(
HUseListNode* head) : next_(head) {
315 void HUseIterator::Advance() {
327 for (HUseIterator it(
uses()); !it.Done(); it.Advance()) ++count;
335 while (current !=
NULL) {
336 if (current->
value() == value && current->
index() == index) {
337 if (previous ==
NULL) {
346 current = current->
tail();
351 if (current !=
NULL) {
379 intptr_t result =
opcode();
381 for (
int i = 0; i < count; ++i) {
382 result = result * 19 +
OperandAt(i)->
id() + (result >> 7);
390 #define MAKE_CASE(type) case k##type: return #type;
393 case kPhi:
return "Phi";
434 if (operand ==
NULL)
continue;
436 if (first !=
NULL && first->
value() ==
this && first->
index() == i) {
454 stream->
Add(
" type[%s]",
type().ToString());
460 stream->
Add(
" range[%d,%d,m0=%d]",
463 static_cast<int>(
range()->CanBeMinusZero()));
469 if (changes_flags.
IsEmpty())
return;
470 stream->
Add(
" changes[");
474 bool add_comma =
false;
475 #define PRINT_DO(type) \
476 if (changes_flags.Contains(kChanges##type)) { \
477 if (add_comma) stream->Add(","); \
479 stream->Add(#type); \
504 if (old_value == new_value)
return;
507 if (old_value !=
NULL) {
508 removed = old_value->
RemoveUse(
this, index);
511 if (new_value !=
NULL) {
512 if (removed ==
NULL) {
547 PrintMnemonicTo(stream);
555 void HInstruction::PrintMnemonicTo(
StringStream* stream) {
562 ASSERT(!IsControlInstruction());
565 previous_->next_ = next_;
570 next_->previous_ = previous_;
578 ASSERT(!next->IsBlockEntry());
579 ASSERT(!IsControlInstruction());
584 next->previous_ =
this;
593 ASSERT(!previous->IsControlInstruction());
594 ASSERT(!IsControlInstruction() || previous->next_ ==
NULL);
609 ASSERT(next->IsSimulate());
611 next = previous->next_;
617 previous->next_ =
this;
618 if (next !=
NULL) next->previous_ =
this;
626 void HInstruction::Verify() {
631 if (other_operand ==
NULL)
continue;
633 if (cur_block == other_block) {
634 if (!other_operand->
IsPhi()) {
636 while (cur !=
NULL) {
637 if (cur == other_operand)
break;
641 ASSERT(cur == other_operand);
689 stream->
Add(
"optimized apply ");
691 stream->
Add(
"%o ",
function()->shared()->DebugName());
710 stream->
Add(
"%o ",
target()->shared()->DebugName());
722 stream->
Add(
"class_of_test(");
732 stream->
Add(
"], length ");
738 stream->
Add(
" goto (");
739 bool first_block =
true;
740 for (HSuccessorIterator it(
this); !it.Done(); it.Advance()) {
741 stream->
Add(first_block ?
"B%d" :
", B%d", it.Current()->block_id());
769 stream->
Add(
" (%p)", *
map());
776 case kMathFloor:
return "floor";
777 case kMathRound:
return "round";
778 case kMathCeil:
return "ceil";
779 case kMathAbs:
return "abs";
780 case kMathLog:
return "log";
781 case kMathSin:
return "sin";
782 case kMathCos:
return "cos";
783 case kMathTan:
return "tan";
784 case kMathASin:
return "asin";
785 case kMathACos:
return "acos";
786 case kMathATan:
return "atan";
787 case kMathExp:
return "exp";
788 case kMathSqrt:
return "sqrt";
791 return "(unknown operation)";
796 const char* name =
OpName();
797 stream->
Add(
"%s ", name);
830 stream->
Add(
" == %o", *type_literal_);
851 stream->
Add(
"[%d]", idx_);
875 int32_t nop_constant = (
op() == Token::BIT_AND) ? -1 : 0;
876 if (
left()->IsConstant() &&
882 if (
right()->IsConstant() &&
894 if (
value()->IsBitNot()) {
956 if (
op() == kMathFloor) {
962 #if defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_IA32) || \
963 defined(V8_TARGET_ARCH_X64)
971 LChunkBuilder::SimplifiedDividendForMathFloorOfDiv(left);
973 LChunkBuilder::SimplifiedDivisorForMathFloorOfDiv(right);
976 if ((new_left ==
NULL) || (new_right ==
NULL))
return this;
979 if (new_left->IsInstruction() &&
983 if (new_right->IsInstruction() &&
998 ASSERT(left->IsChange() || left->IsConstant());
999 ASSERT(right->IsChange() || right->IsConstant());
1006 #endif // V8_TARGET_ARCH_ARM
1013 if (check_ == IS_STRING &&
1018 if (check_ == IS_SYMBOL &&
1019 value()->IsConstant() &&
1031 case IS_SPEC_OBJECT:
1084 const char* HCheckInstanceType::GetCheckName() {
1086 case IS_SPEC_OBJECT:
return "object";
1087 case IS_JS_ARRAY:
return "array";
1088 case IS_STRING:
return "string";
1089 case IS_SYMBOL:
return "symbol";
1096 stream->
Add(
"%s ", GetCheckName());
1108 CodeStub::MajorName(major_key_,
false));
1132 if (
from().IsInteger32() &&
1139 ? input_range->
Copy(zone)
1147 if (has_int32_value_) {
1148 Range* result =
new(zone)
Range(int32_value_, int32_value_);
1158 if (
block()->IsLoopHeader()) {
1293 stream->
Add(
" uses%d_%di_%dd_%dt",
1298 stream->
Add(
"%s%s]",
1315 for (HUseIterator it(
uses()); !it.Done(); it.Advance()) {
1316 if (!it.value()->IsPhi())
return true;
1326 while (position < count && candidate ==
NULL) {
1328 if (current !=
this) candidate = current;
1330 while (position < count) {
1332 if (current !=
this && current != candidate)
return NULL;
1334 ASSERT(candidate !=
this);
1349 for (HUseIterator it(
uses()); !it.Done(); it.Advance()) {
1350 HValue* value = it.value();
1351 if (!value->
IsPhi()) {
1354 if (FLAG_trace_representation) {
1355 PrintF(
"%d %s is used by %d %s as %s\n",
1368 if (FLAG_trace_representation) {
1369 PrintF(
"adding to %d %s uses of %d %s: i%d d%d t%d\n",
1380 indirect_uses_[i] += other->non_phi_uses_[i];
1387 dest[i] += indirect_uses_[i];
1400 if (pop_count_ > 0) stream->
Add(
" pop %d", pop_count_);
1401 if (values_.length() > 0) {
1402 if (pop_count_ > 0) stream->
Add(
" /");
1403 for (
int i = 0; i < values_.length(); ++i) {
1404 if (i > 0) stream->
Add(
",");
1408 stream->
Add(
" push ");
1410 values_[i]->PrintNameTo(stream);
1428 stream->
Add(
"%s, id=%d", *name,
function()->
id().ToInt());
1432 static bool IsInteger32(
double value) {
1433 double roundtrip_value =
static_cast<double>(
static_cast<int32_t>(value));
1434 return BitCast<int64_t>(roundtrip_value) == BitCast<int64_t>(value);
1440 has_int32_value_(
false),
1441 has_double_value_(
false) {
1444 if (handle_->IsNumber()) {
1445 double n = handle_->Number();
1446 has_int32_value_ = IsInteger32(n);
1449 has_double_value_ =
true;
1455 : has_int32_value_(
true),
1456 has_double_value_(
true),
1457 int32_value_(integer_value),
1458 double_value_(
FastI2D(integer_value)) {
1465 : has_int32_value_(IsInteger32(double_value)),
1466 has_double_value_(
true),
1468 double_value_(double_value) {
1478 ASSERT(has_int32_value_ || has_double_value_);
1479 if (has_int32_value_)
return new(zone)
HConstant(int32_value_, r);
1480 return new(zone)
HConstant(double_value_, r);
1487 if (has_int32_value_) {
1494 }
else if (has_double_value_) {
1509 return v != 0 && !
isnan(v);
1512 if (literal->IsTrue())
return true;
1513 if (literal->IsFalse())
return false;
1514 if (literal->IsUndefined())
return false;
1515 if (literal->IsNull())
return false;
1523 if (has_int32_value_) {
1524 stream->
Add(
"%d ", int32_value_);
1525 }
else if (has_double_value_) {
1526 stream->
Add(
"%f ",
FmtElm(double_value_));
1528 handle()->ShortPrint(stream);
1534 if (!boilerplate_object_->IsJSObject())
return false;
1536 HEAP->fixed_cow_array_map();
1558 int32_t result_mask = (
op() == Token::BIT_AND)
1559 ? left_mask & right_mask
1560 : left_mask | right_mask;
1561 return (result_mask >= 0)
1562 ?
new(zone)
Range(0, result_mask)
1568 if (
right()->IsConstant()) {
1573 :
new(zone)
Range();
1584 if (
right()->IsConstant()) {
1590 return (shift_count >= 1)
1591 ?
new(zone)
Range(0,
1592 static_cast<uint32_t>(0xffffffff) >> shift_count)
1593 :
new(zone)
Range();
1598 :
new(zone)
Range();
1610 if (
right()->IsConstant()) {
1615 :
new(zone)
Range();
1628 return new(zone)
Range(0, 255);
1630 return new(zone)
Range(-128, 127);
1632 return new(zone)
Range(0, 255);
1634 return new(zone)
Range(-32768, 32767);
1636 return new(zone)
Range(0, 65535);
1681 input_representation_ = r;
1721 static bool PrototypeChainCanNeverResolve(
1723 Isolate* isolate = map->GetIsolate();
1724 Object* current = map->prototype();
1725 while (current != isolate->
heap()->null_value()) {
1726 if (current->IsJSGlobalProxy() ||
1727 current->IsGlobalObject() ||
1728 !current->IsJSObject() ||
1735 LookupResult lookup(isolate);
1738 if (lookup.IsFound())
return false;
1739 if (!lookup.IsCacheable())
return false;
1751 : types_(
Min(types->length(), kMaxLoadPolymorphism), zone),
1753 need_generic_(
false) {
1763 LookupResult lookup(map->GetIsolate());
1764 map->LookupDescriptor(
NULL, *name, &lookup);
1765 if (lookup.IsFound()) {
1766 switch (lookup.type()) {
1768 int index = lookup.GetLocalFieldIndexFromMap(*map);
1774 types_.
Add(types->
at(i), zone);
1778 types_.
Add(types->
at(i), zone);
1790 }
else if (lookup.IsCacheable() &&
1794 !map->is_dictionary_map() &&
1795 !map->has_named_interceptor() &&
1796 PrototypeChainCanNeverResolve(map, name)) {
1797 negative_lookups.
Add(types->
at(i), zone);
1803 if (!need_generic && FLAG_deoptimize_uncommon_cases) {
1805 for (
int i = 0; i < negative_lookups.
length(); i++) {
1806 types_.
Add(negative_lookups.
at(i), zone);
1814 need_generic_ =
true;
1823 if (need_generic_ != other->need_generic_)
return false;
1824 for (
int i = 0; i < types_.
length(); i++) {
1826 for (
int j = 0; j < types_.
length(); j++) {
1827 if (types_.
at(j).is_identical_to(other->
types()->
at(i))) {
1832 if (!found)
return false;
1859 stream->
Add(
" check_hole");
1869 for (HUseIterator it(
uses()); !it.Done(); it.Advance()) {
1870 HValue* use = it.value();
1871 if (!use->IsChange())
return true;
1899 if (
key()->IsLoadKeyedFastElement()) {
1901 if (key_load->
object()->IsForInCacheArray()) {
1934 stream->
Add(
"byte");
1937 stream->
Add(
"u_byte");
1940 stream->
Add(
"short");
1943 stream->
Add(
"u_short");
1949 stream->
Add(
"u_int");
1952 stream->
Add(
"float");
1955 stream->
Add(
"double");
1958 stream->
Add(
"pixel");
1996 stream->
Add(
" (write-barrier)");
2008 stream->
Add(
"] = ");
2017 stream->
Add(
"] = ");
2026 stream->
Add(
"] = ");
2037 stream->
Add(
"byte");
2040 stream->
Add(
"u_byte");
2043 stream->
Add(
"short");
2046 stream->
Add(
"u_short");
2052 stream->
Add(
"u_int");
2055 stream->
Add(
"float");
2058 stream->
Add(
"double");
2061 stream->
Add(
"pixel");
2076 stream->
Add(
"] = ");
2085 stream->
Add(
" %p [%s] -> %p [%s]",
2095 if (!details_.IsDontDelete()) stream->
Add(
" (deleteable)");
2096 if (details_.IsReadOnly()) stream->
Add(
" (read-only)");
2101 if (details_.IsDontDelete() && !details_.IsReadOnly())
return false;
2102 for (HUseIterator it(
uses()); !it.Done(); it.Advance()) {
2103 HValue* use = it.value();
2104 if (!use->IsChange())
return true;
2116 stream->
Add(
"[%p] = ", *
cell());
2118 if (!details_.IsDontDelete()) stream->
Add(
" (deleteable)");
2119 if (details_.IsReadOnly()) stream->
Add(
" (read-only)");
2124 stream->
Add(
"%o = ", *
name());
2175 result = result.
Combine(current);
2182 if (has_int32_value_) {
2297 if (
from().IsInteger32())
return NULL;
2374 if (
value()->IsLoadKeyedFastDoubleElement() ||
2382 #define H_CONSTANT_INT32(val) \
2383 new(zone) HConstant(FACTORY->NewNumberFromInt(val, TENURED), \
2384 Representation::Integer32())
2385 #define H_CONSTANT_DOUBLE(val) \
2386 new(zone) HConstant(FACTORY->NewNumber(val, TENURED), \
2387 Representation::Double())
2389 #define DEFINE_NEW_H_SIMPLE_ARITHMETIC_INSTR(HInstr, op) \
2390 HInstruction* HInstr::New##HInstr(Zone* zone, \
2394 if (left->IsConstant() && right->IsConstant()) { \
2395 HConstant* c_left = HConstant::cast(left); \
2396 HConstant* c_right = HConstant::cast(right); \
2397 if ((c_left->HasNumberValue() && c_right->HasNumberValue())) { \
2398 double double_res = c_left->DoubleValue() op c_right->DoubleValue(); \
2399 if (TypeInfo::IsInt32Double(double_res)) { \
2400 return H_CONSTANT_INT32(static_cast<int32_t>(double_res)); \
2402 return H_CONSTANT_DOUBLE(double_res); \
2405 return new(zone) HInstr(context, left, right); \
2413 #undef DEFINE_NEW_H_SIMPLE_ARITHMETIC_INSTR
2420 if (left->IsConstant() && right->IsConstant()) {
2427 int32_t res = dividend % divisor;
2428 if ((res == 0) && (dividend < 0)) {
2435 return new(zone)
HMod(context, left, right);
2444 if (left->IsConstant() && right->IsConstant()) {
2457 return new(zone)
HDiv(context, left, right);
2466 if (left->IsConstant() && right->IsConstant()) {
2474 case Token::BIT_XOR:
2475 result = v_left ^ v_right;
2477 case Token::BIT_AND:
2478 result = v_left & v_right;
2481 result = v_left | v_right;
2490 return new(zone)
HBitwise(op, context, left, right);
2494 #define DEFINE_NEW_H_BITWISE_INSTR(HInstr, result) \
2495 HInstruction* HInstr::New##HInstr(Zone* zone, \
2499 if (left->IsConstant() && right->IsConstant()) { \
2500 HConstant* c_left = HConstant::cast(left); \
2501 HConstant* c_right = HConstant::cast(right); \
2502 if ((c_left->HasNumberValue() && c_right->HasNumberValue())) { \
2503 return H_CONSTANT_INT32(result); \
2506 return new(zone) HInstr(context, left, right); \
2511 c_left->NumberValueAsInteger32() >> (c_right->NumberValueAsInteger32() & 0x1f))
2515 #undef DEFINE_NEW_H_BITWISE_INSTR
2522 if (left->IsConstant() && right->IsConstant()) {
2528 if ((right_val == 0) && (left_val < 0)) {
2530 static_cast<double>(static_cast<uint32_t>(left_val)));
2535 return new(zone)
HShr(context, left, right);
2539 #undef H_CONSTANT_INT32
2540 #undef H_CONSTANT_DOUBLE
2558 bool double_occurred =
false;
2559 bool int32_occurred =
false;
2562 if (value->IsUnknownOSRValue()) {
2564 if (hint_value !=
NULL) {
2566 if (hint.
IsDouble()) double_occurred =
true;
2574 if (value->IsConstant()) {
2577 int32_occurred =
true;
2579 double_occurred =
true;
2600 void HPhi::Verify() {
2606 ASSERT(defining_block == predecessor_block ||
2607 defining_block->
Dominates(predecessor_block));
2612 void HSimulate::Verify() {
2613 HInstruction::Verify();
2618 void HCheckSmi::Verify() {
2619 HInstruction::Verify();
2624 void HCheckNonSmi::Verify() {
2625 HInstruction::Verify();
2630 void HCheckFunction::Verify() {
2631 HInstruction::Verify();
2636 void HCheckPrototypeMaps::Verify() {
2637 HInstruction::Verify();
static HType HeapNumber()
virtual HType CalculateInferredType()
virtual void PrintDataTo(StringStream *stream)
bool HasObservableSideEffects() const
void set_can_be_minus_zero(bool b)
bool UpdateInferredType()
void CombinedMin(Range *other)
bool CanTruncateToInt32() const
virtual HValue * EnsureAndPropagateNotMinusZero(BitVector *visited)
Handle< Map > transitioned_map()
virtual HType CalculateInferredType()
virtual bool IsConvertibleToInteger() const
Handle< String > name() const
int tagged_indirect_uses() const
virtual void PrintDataTo(StringStream *stream)
Handle< Map > at(int i) const
virtual HValue * EnsureAndPropagateNotMinusZero(BitVector *visited)
static bool IsInt32Double(double value)
HType Combine(HType other)
const char * ToCString(const v8::String::Utf8Value &value)
virtual HValue * EnsureAndPropagateNotMinusZero(BitVector *visited)
virtual void PrintDataTo(StringStream *stream)
virtual void PrintDataTo(StringStream *stream)
virtual HType CalculateInferredType()
virtual void PrintDataTo(StringStream *stream)
virtual HType CalculateInferredType()
void PrintF(const char *format,...)
bool IsCopyOnWrite() const
HDiv(HValue *context, HValue *left, HValue *right)
virtual bool DataEquals(HValue *other)
static String * cast(Object *obj)
virtual HType CalculateInferredType()
bool Equals(const HType &other)
virtual void PrintDataTo(StringStream *stream)
HConstant * CopyToRepresentation(Representation r, Zone *zone) const
virtual void PrintDataTo(StringStream *stream)
HUseListNode * RemoveUse(HValue *value, int index)
HInstruction * previous() const
static const char * Name(Value tok)
Representation from() const
Handle< Object > handle()
bool CheckUsesForFlag(Flag f)
virtual HType CalculateInferredType()
HLoadNamedFieldPolymorphic(HValue *context, HValue *object, SmallMapList *types, Handle< String > name, Zone *zone)
virtual void DeleteFromGraph()
virtual void PrintDataTo(StringStream *stream)
void CombinedMax(Range *other)
bool Dominates(HBasicBlock *other) const
virtual void PrintDataTo(StringStream *stream)
void Intersect(Range *other)
virtual void PrintDataTo(StringStream *stream)
virtual HType CalculateInferredType()
HBitwise(Token::Value op, HValue *context, HValue *left, HValue *right)
HBasicBlock * block() const
static Handle< T > cast(Handle< S > that)
static Representation Integer32()
Handle< JSGlobalPropertyCell > cell() const
virtual void PrintDataTo(StringStream *stream)
virtual void PrintDataTo(StringStream *stream)
bool is_identical_to(const Handle< T > other) const
virtual void PrintDataTo(StringStream *stream)
virtual void PrintDataTo(StringStream *stream)
Handle< String > name() const
bool RequiresHoleCheck() const
virtual void PrintDataTo(StringStream *stream)
HInstruction * first() const
Representation representation_
Handle< Map > transition() const
void AssumeRepresentation(Representation r)
bool HasNumberValue() const
HValue * GetRedundantReplacement()
HBasicBlock * FirstSuccessor()
virtual HValue * Canonicalize()
virtual int OperandCount()
bool NeedsCanonicalization()
virtual HValue * Canonicalize()
Handle< Object > name() const
virtual void PrintDataTo(StringStream *stream)
void AddConstant(int32_t value)
#define ASSERT(condition)
Handle< JSObject > prototype() const
virtual Range * InferRange(Zone *zone)
virtual HType CalculateInferredType()
static HInstruction * NewHMod(Zone *zone, HValue *context, HValue *left, HValue *right)
static const int kMaxLoadPolymorphism
const ZoneList< HBasicBlock * > * predecessors() const
virtual void PrintDataTo(StringStream *stream)
HControlInstruction * end() const
virtual Representation InferredRepresentation()
virtual HValue * OperandAt(int index) const
static Representation Double()
bool IsInSmiRange() const
virtual HType CalculateInferredType()
bool Equals(const Representation &other)
virtual HType CalculateInferredType()
virtual void PrintDataTo(StringStream *stream)
virtual void PrintDataTo(StringStream *stream)
HValue * external_pointer()
bool HasDoubleValue() const
bool is_in_object() const
ElementsKind elements_kind() const
Representation representation() const
virtual void PrintDataTo(StringStream *stream)
DEFINE_NEW_H_BITWISE_INSTR(HSar, c_left->NumberValueAsInteger32() >>(c_right->NumberValueAsInteger32()&0x1f)) DEFINE_NEW_H_BITWISE_INSTR(HShl
virtual void PrintDataTo(StringStream *stream)
void set_representation(Representation r)
virtual void PrintDataTo(StringStream *stream)
virtual int argument_count() const
virtual HValue * Canonicalize()
virtual Range * InferRange(Zone *zone)
ElementsKind elements_kind() const
virtual void PrintDataTo(StringStream *stream)
void Add(Vector< const char > format, Vector< FmtElm > elms)
bool is_in_object() const
void LookupDescriptor(JSObject *holder, String *name, LookupResult *result)
virtual void PrintDataTo(StringStream *stream)
Handle< JSFunction > target() const
virtual HType CalculateInferredType()
virtual void PrintDataTo(StringStream *stream)
virtual void PrintDataTo(StringStream *stream)
Handle< JSFunction > target() const
Token::Value token() const
#define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V)
virtual HType CalculateInferredType()
int int32_indirect_uses() const
static HType TaggedNumber()
virtual HType CalculateInferredType()
void AddNewRange(Range *r, Zone *zone)
virtual HType CalculateInferredType()
void RemovePhi(HPhi *phi)
virtual int OperandCount()=0
virtual int OperandCount()
bool Equals(HValue *other)
ElementsKind elements_kind() const
int double_non_phi_uses() const
void PrintRangeTo(StringStream *stream)
int tagged_non_phi_uses() const
const uint32_t kIsSymbolMask
const char * Mnemonic() const
void InitRealUses(int id)
virtual HType CalculateInferredType()
virtual void PrintDataTo(StringStream *stream)
static GVNFlagSet AllSideEffectsFlagSet()
HMod(HValue *context, HValue *left, HValue *right)
bool IsFastPackedElementsKind(ElementsKind kind)
void PrintChangesTo(StringStream *stream)
#define DEFINE_COMPILE(type)
virtual HType CalculateInferredType()
BuiltinFunctionId op() const
static HUnaryOperation * cast(HValue *value)
virtual void PrintDataTo(StringStream *stream)
virtual Range * InferRange(Zone *zone)
void SetInputRepresentation(Representation r)
virtual void PrintDataTo(StringStream *stream)
virtual Range * InferRange(Zone *zone)
Handle< String > name() const
static bool IsValid(intptr_t value)
Range * Copy(Zone *zone) const
virtual HValue * Canonicalize()
int int32_non_phi_uses() const
HForInCacheArray * index_cache()
virtual HValue * OperandAt(int index) const
virtual void PrintDataTo(StringStream *stream)
virtual void PrintDataTo(StringStream *stream)
bool IsDefinedAfter(HBasicBlock *other) const
int GetAssignedIndexAt(int index) const
double DoubleValue() const
virtual void PrintDataTo(StringStream *stream)
void ComputeInitialRange(Zone *zone)
#define GVN_TRACKED_FLAG_LIST(V)
virtual HValue * Canonicalize()
void RemoveLastAddedRange()
virtual void PrintDataTo(StringStream *stream)
void AddInput(HValue *value)
virtual Range * InferRange(Zone *zone)
bool is_interval_check() const
GVNFlagSet ChangesFlags() const
virtual HValue * Canonicalize()
virtual Range * InferRange(Zone *zone)
void ResetInteger32Uses()
virtual Range * InferRange(Zone *zone)
HInstruction * next() const
virtual bool IsConvertibleToInteger() const
virtual HType CalculateInferredType()
virtual HValue * Canonicalize()
int32_t Integer32Value() const
virtual HValue * EnsureAndPropagateNotMinusZero(BitVector *visited)
virtual void PrintDataTo(StringStream *stream)
virtual void PrintDataTo(StringStream *stream)
void set_type(HType new_type)
virtual void PrintDataTo(StringStream *stream)
virtual Range * InferRange(Zone *zone)
virtual void PrintDataTo(StringStream *stream)
static HInstruction * NewHShr(Zone *zone, HValue *context, HValue *left, HValue *right)
static HInstruction * NewHBitwise(Zone *zone, Token::Value op, HValue *context, HValue *left, HValue *right)
const uint32_t kStringTag
virtual void PrintDataTo(StringStream *stream)
HInstruction * last() const
virtual void PrintDataTo(StringStream *stream)
Handle< Map > map() const
virtual void PrintDataTo(StringStream *stream)
virtual void PrintTo(StringStream *stream)
activate correct semantics for inheriting readonliness false
virtual HValue * Canonicalize()
void AddNonPhiUsesFrom(HPhi *other)
void DeleteAndReplaceWith(HValue *other)
virtual void PrintDataTo(StringStream *stream)
virtual void PrintDataTo(StringStream *stream)
static HInstruction * NewHDiv(Zone *zone, HValue *context, HValue *left, HValue *right)
virtual void PrintDataTo(StringStream *stream)
virtual HType CalculateInferredType()
Handle< String > class_name() const
#define GVN_UNTRACKED_FLAG_LIST(V)
virtual void PrintDataTo(StringStream *stream)
Handle< Object > name() const
void set_last(HInstruction *instr)
virtual intptr_t Hashcode()
virtual bool DataEquals(HValue *value)
bool RequiresHoleCheck() const
bool SubAndCheckOverflow(Range *other)
virtual void PrintDataTo(StringStream *stream)
virtual void PrintDataTo(StringStream *stream)
static ElementsAccessor * ForKind(ElementsKind elements_kind)
virtual Representation ObservedInputRepresentation(int index)
void PrintNameTo(StringStream *stream)
HConstant(Handle< Object > handle, Representation r)
void InsertAfter(HInstruction *previous)
virtual Opcode opcode() const =0
virtual void DeleteFromGraph()=0
virtual void PrintTo(StringStream *stream)
bool has_named_interceptor()
virtual void PrintDataTo(StringStream *stream)
Representation to() const
int32_t DoubleToInt32(double x)
const uint32_t kIsNotStringMask
virtual void PrintDataTo(StringStream *stream)
void ChangeRepresentation(Representation r)
virtual HValue * EnsureAndPropagateNotMinusZero(BitVector *visited)
const char * OpName() const
HShr(HValue *context, HValue *left, HValue *right)
virtual HType CalculateInferredType()
EqualityKind kind() const
void SetOperandAt(int index, HValue *value)
virtual void PrintDataTo(StringStream *stream)
HBasicBlock * SecondSuccessor()
virtual void PrintDataTo(StringStream *stream)
virtual void PrintDataTo(StringStream *stream)
virtual Range * InferRange(Zone *zone)
bool IsApplyFunction() const
bool CheckFlag(Flag f) const
virtual void PrintDataTo(StringStream *stream)
virtual HValue * Canonicalize()
virtual HType CalculateInferredType()
int double_indirect_uses() const
#define DEFINE_NEW_H_SIMPLE_ARITHMETIC_INSTR(HInstr, op)
int32_t NumberValueAsInteger32() const
virtual void PrintDataTo(StringStream *stream)
void InsertBefore(HInstruction *next)
static HType TypeFromValue(Handle< Object > value)
virtual Range * InferRange(Zone *zone)
#define H_CONSTANT_DOUBLE(val)
static HType Uninitialized()
virtual HValue * EnsureAndPropagateNotMinusZero(BitVector *visited)
bool IsStartBlock() const
virtual HType CalculateInferredType()
Handle< Object > name() const
virtual void PrintDataTo(StringStream *stream)
void SetBlock(HBasicBlock *block)
virtual void PrintDataTo(StringStream *stream)
Token::Value token() const
virtual HValue * EnsureAndPropagateNotMinusZero(BitVector *visited)
virtual HValue * OperandAt(int index) const =0
virtual Range * InferRange(Zone *zone)
virtual void PrintDataTo(StringStream *stream)
virtual void PrintDataTo(StringStream *stream)
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of MIPS FPU instructions if NULL
virtual Range * InferRange(Zone *zone)
virtual HType CalculateInferredType()
int GetNextValueID(HValue *value)
virtual void PrintDataTo(StringStream *stream)
HValue * external_pointer()
void SetGVNFlag(GVNFlag f)
virtual HValue * EnsureAndPropagateNotMinusZero(BitVector *visited)
HConstant * CopyToTruncatedInt32(Zone *zone) const
virtual void PrintDataTo(StringStream *stream)
const char * Mnemonic() const
Handle< JSObject > holder() const
void AddIndirectUsesTo(int *use_count)
virtual void PrintDataTo(StringStream *stream)
virtual HType CalculateInferredType()
bool HasInteger32Value() const
static Representation None()
virtual Range * InferRange(Zone *zone)
virtual void InternalSetOperandAt(int index, HValue *value)=0
virtual void PrintDataTo(StringStream *stream)
const uint32_t kSymbolTag
virtual void PrintDataTo(StringStream *stream)
void set_tail(HUseListNode *list)
virtual Range * InferRange(Zone *zone)
Handle< String > name() const
static Representation Tagged()
void GetCheckMaskAndTag(uint8_t *mask, uint8_t *tag)
void PrintTypeTo(StringStream *stream)
Handle< JSGlobalPropertyCell > cell() const
void StackUpon(Range *other)
virtual void PrintDataTo(StringStream *stream)
void Add(Handle< Map > handle, Zone *zone)
HBasicBlock * SuccessorAt(int i)
#define H_CONSTANT_INT32(val)
static const int kNoNumber
void RegisterUse(int index, HValue *new_value)
bool HasAssignedIndexAt(int index) const
virtual Representation RequiredInputRepresentation(int index)
virtual HType CalculateInferredType()
bool CanBeNegative() const
void GetCheckInterval(InstanceType *first, InstanceType *last)
virtual void PrintDataTo(StringStream *stream)
static HValue * cast(HValue *value)
void ReplaceAllUsesWith(HValue *other)
Token::Value token() const
bool AddAndCheckOverflow(Range *other)
virtual void PrintDataTo(StringStream *stream)
Handle< Map > original_map()
static JSObject * cast(Object *obj)
c_left NumberValueAsInteger32()<< (c_right-> NumberValueAsInteger32()&0x1f)) HInstruction *HShr::NewHShr(Zone *zone, HValue *context, HValue *left, HValue *right)
virtual HValue * Canonicalize()
virtual HValue * EnsureAndPropagateNotMinusZero(BitVector *visited)
bool MulAndCheckOverflow(Range *other)
static bool IsOrderedRelationalCompareOp(Value op)
virtual void PrintDataTo(StringStream *stream)
bool CanBeMinusZero() const
HUseIterator uses() const
virtual Range * InferRange(Zone *zone)
virtual void PrintDataTo(StringStream *stream)
virtual HValue * Canonicalize()