Version 3.3.6
Updated MIPS infrastructure files.
Added method IsCallable for Object to the API.
Patch by Peter Varga.
git-svn-id: http://v8.googlecode.com/svn/trunk@7857 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index 5a502e5..85a06fc 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -628,7 +628,9 @@
// Printing support.
virtual void PrintTo(StringStream* stream) = 0;
void PrintNameTo(StringStream* stream);
- static void PrintTypeTo(HType type, StringStream* stream);
+ void PrintTypeTo(StringStream* stream);
+ void PrintRangeTo(StringStream* stream);
+ void PrintChangesTo(StringStream* stream);
const char* Mnemonic() const;
@@ -741,6 +743,8 @@
SetBlock(block);
}
+ void PrintMnemonicTo(StringStream* stream);
+
HInstruction* next_;
HInstruction* previous_;
int position_;
@@ -1757,19 +1761,17 @@
class HCheckInstanceType: public HUnaryOperation {
public:
- // Check that the instance type is in the range [first, last] where
- // both first and last are included.
- HCheckInstanceType(HValue* value, InstanceType first, InstanceType last)
- : HUnaryOperation(value), first_(first), last_(last) {
- ASSERT(first <= last);
- set_representation(Representation::Tagged());
- SetFlag(kUseGVN);
- if ((FIRST_STRING_TYPE < first && last <= LAST_STRING_TYPE) ||
- (FIRST_STRING_TYPE <= first && last < LAST_STRING_TYPE)) {
- // A particular string instance type can change because of GC or
- // externalization, but the value still remains a string.
- SetFlag(kDependsOnMaps);
- }
+ static HCheckInstanceType* NewIsJSObjectOrJSFunction(HValue* value) {
+ return new HCheckInstanceType(value, IS_JS_OBJECT_OR_JS_FUNCTION);
+ }
+ static HCheckInstanceType* NewIsJSArray(HValue* value) {
+ return new HCheckInstanceType(value, IS_JS_ARRAY);
+ }
+ static HCheckInstanceType* NewIsString(HValue* value) {
+ return new HCheckInstanceType(value, IS_STRING);
+ }
+ static HCheckInstanceType* NewIsSymbol(HValue* value) {
+ return new HCheckInstanceType(value, IS_SYMBOL);
}
virtual bool IsCheckInstruction() const { return true; }
@@ -1785,17 +1787,15 @@
virtual HValue* Canonicalize() {
if (!value()->type().IsUninitialized() &&
value()->type().IsString() &&
- first() == FIRST_STRING_TYPE &&
- last() == LAST_STRING_TYPE) {
+ check_ == IS_STRING) {
return NULL;
}
return this;
}
- static HCheckInstanceType* NewIsJSObjectOrJSFunction(HValue* value);
-
- InstanceType first() const { return first_; }
- InstanceType last() const { return last_; }
+ bool is_interval_check() const { return check_ <= LAST_INTERVAL_CHECK; }
+ void GetCheckInterval(InstanceType* first, InstanceType* last);
+ void GetCheckMaskAndTag(uint8_t* mask, uint8_t* tag);
DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType)
@@ -1805,12 +1805,25 @@
// with a larger range.
virtual bool DataEquals(HValue* other) {
HCheckInstanceType* b = HCheckInstanceType::cast(other);
- return (first_ == b->first()) && (last_ == b->last());
+ return check_ == b->check_;
}
private:
- InstanceType first_;
- InstanceType last_;
+ enum Check {
+ IS_JS_OBJECT_OR_JS_FUNCTION,
+ IS_JS_ARRAY,
+ IS_STRING,
+ IS_SYMBOL,
+ LAST_INTERVAL_CHECK = IS_JS_ARRAY
+ };
+
+ HCheckInstanceType(HValue* value, Check check)
+ : HUnaryOperation(value), check_(check) {
+ set_representation(Representation::Tagged());
+ SetFlag(kUseGVN);
+ }
+
+ const Check check_;
};
@@ -3255,6 +3268,8 @@
virtual void PrintDataTo(StringStream* stream);
+ bool RequiresHoleCheck() const;
+
DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement)
protected:
@@ -3311,7 +3326,7 @@
class HLoadKeyedGeneric: public HTemplateInstruction<3> {
public:
- HLoadKeyedGeneric(HContext* context, HValue* obj, HValue* key) {
+ HLoadKeyedGeneric(HValue* context, HValue* obj, HValue* key) {
set_representation(Representation::Tagged());
SetOperandAt(0, obj);
SetOperandAt(1, key);