Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(406)

Unified Diff: src/hydrogen.cc

Issue 6964011: Refactor HCheckInstanceType to allow mask/tag tests. (Closed)
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index a0d783791260f3a96d9d411057548ac471b690b6..8a05ea9acca1d5176e90379fb45cfe65e0c23b74 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -3796,17 +3796,13 @@ void HGraphBuilder::VisitProperty(Property* expr) {
if (expr->IsArrayLength()) {
HValue* array = Pop();
AddInstruction(new(zone()) HCheckNonSmi(array));
- AddInstruction(new(zone()) HCheckInstanceType(array,
- JS_ARRAY_TYPE,
- JS_ARRAY_TYPE));
+ AddInstruction(HCheckInstanceType::NewIsJSArray(array));
instr = new(zone()) HJSArrayLength(array);
} else if (expr->IsStringLength()) {
HValue* string = Pop();
AddInstruction(new(zone()) HCheckNonSmi(string));
- AddInstruction(new(zone()) HCheckInstanceType(string,
- FIRST_STRING_TYPE,
- LAST_STRING_TYPE));
+ AddInstruction(HCheckInstanceType::NewIsString(string));
instr = new(zone()) HStringLength(string);
} else if (expr->IsStringAccess()) {
CHECK_ALIVE(VisitForValue(expr->key()));
@@ -4821,8 +4817,7 @@ void HGraphBuilder::VisitCountOperation(CountOperation* expr) {
HStringCharCodeAt* HGraphBuilder::BuildStringCharCodeAt(HValue* string,
HValue* index) {
AddInstruction(new(zone()) HCheckNonSmi(string));
- AddInstruction(new(zone()) HCheckInstanceType(
- string, FIRST_STRING_TYPE, LAST_STRING_TYPE));
+ AddInstruction(HCheckInstanceType::NewIsString(string));
HStringLength* length = new(zone()) HStringLength(string);
AddInstruction(length);
AddInstruction(new(zone()) HBoundsCheck(index, length));
@@ -4839,11 +4834,9 @@ HInstruction* HGraphBuilder::BuildBinaryOperation(BinaryOperation* expr,
case Token::ADD:
if (info.IsString()) {
AddInstruction(new(zone()) HCheckNonSmi(left));
- AddInstruction(new(zone()) HCheckInstanceType(
- left, FIRST_STRING_TYPE, LAST_STRING_TYPE));
+ AddInstruction(HCheckInstanceType::NewIsString(left));
AddInstruction(new(zone()) HCheckNonSmi(right));
- AddInstruction(new(zone()) HCheckInstanceType(
- right, FIRST_STRING_TYPE, LAST_STRING_TYPE));
+ AddInstruction(HCheckInstanceType::NewIsString(right));
instr = new(zone()) HStringAdd(left, right);
} else {
instr = new(zone()) HAdd(left, right);

Powered by Google App Engine
This is Rietveld 408576698