Revision: 14606
Author: [email protected]
Date: Fri May 10 01:58:58 2013
Log: Always use BuildCheckNonSmi, and don't emit check if HeapObject.
[email protected]
Review URL: https://chromiumcodereview.appspot.com/14731016
http://code.google.com/p/v8/source/detail?r=14606
Modified:
/branches/bleeding_edge/src/hydrogen.cc
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc Fri May 10 01:39:37 2013
+++ /branches/bleeding_edge/src/hydrogen.cc Fri May 10 01:58:58 2013
@@ -1048,6 +1048,7 @@
HValue* HGraphBuilder::BuildCheckNonSmi(HValue* obj) {
+ if (obj->type().IsHeapObject()) return obj;
HCheckNonSmi* check = new(zone()) HCheckNonSmi(obj);
AddInstruction(check);
return check;
@@ -7015,14 +7016,14 @@
void HOptimizedGraphBuilder::AddCheckMap(HValue* object, Handle<Map> map) {
- AddInstruction(new(zone()) HCheckNonSmi(object));
+ BuildCheckNonSmi(object);
AddInstruction(HCheckMaps::New(object, map, zone()));
}
void HOptimizedGraphBuilder::AddCheckMapsWithTransitions(HValue* object,
Handle<Map> map) {
- AddInstruction(new(zone()) HCheckNonSmi(object));
+ BuildCheckNonSmi(object);
AddInstruction(HCheckMaps::NewWithTransitions(object, map, zone()));
}
@@ -7167,7 +7168,7 @@
if (types->at(i)->instance_type() != JS_ARRAY_TYPE) return false;
}
- AddInstruction(new(zone()) HCheckNonSmi(object));
+ BuildCheckNonSmi(object);
HInstruction* typecheck =
AddInstruction(HCheckMaps::New(object, types, zone()));
@@ -7187,7 +7188,7 @@
if (HandlePolymorphicArrayLengthLoad(expr, object, types, name))
return;
- AddInstruction(new(zone()) HCheckNonSmi(object));
+ BuildCheckNonSmi(object);
// Use monomorphic load if property lookup results in the same field
index
// for all maps. Requires special map check on the set of all handled
maps.
@@ -7265,7 +7266,7 @@
LookupResult lookup(isolate());
if (ComputeLoadStoreField(map, name, &lookup, true)) {
if (count == 0) {
- AddInstruction(new(zone()) HCheckNonSmi(object)); // Only needed
once.
+ BuildCheckNonSmi(object);
join = graph()->CreateBasicBlock();
}
++count;
@@ -8011,7 +8012,7 @@
KeyedAccessStoreMode store_mode,
bool* has_side_effects) {
*has_side_effects = false;
- AddInstruction(new(zone()) HCheckNonSmi(object));
+ BuildCheckNonSmi(object);
SmallMapList* maps = prop->GetReceiverTypes();
bool todo_external_array = false;
@@ -8235,7 +8236,7 @@
: BuildLoadKeyedGeneric(obj, key);
AddInstruction(instr);
} else {
- AddInstruction(new(zone()) HCheckNonSmi(obj));
+ BuildCheckNonSmi(obj);
instr = BuildMonomorphicElementAccess(
obj, key, val, NULL, map, is_store, expr->GetStoreMode());
}
@@ -8370,7 +8371,7 @@
HInstruction* instr = NULL;
if (expr->IsStringLength()) {
HValue* string = Pop();
- AddInstruction(new(zone()) HCheckNonSmi(string));
+ BuildCheckNonSmi(string);
AddInstruction(HCheckInstanceType::NewIsString(string, zone()));
instr = HStringLength::New(zone(), string);
} else if (expr->IsStringAccess()) {
@@ -8385,7 +8386,7 @@
} else if (expr->IsFunctionPrototype()) {
HValue* function = Pop();
- AddInstruction(new(zone()) HCheckNonSmi(function));
+ BuildCheckNonSmi(function);
instr = new(zone()) HLoadFunctionPrototype(function);
} else if (expr->key()->IsPropertyName()) {
@@ -8559,7 +8560,7 @@
empty_smi_block->Goto(number_block);
set_current_block(not_smi_block);
} else {
- AddInstruction(new(zone()) HCheckNonSmi(receiver));
+ BuildCheckNonSmi(receiver);
}
}
HBasicBlock* if_true = graph()->CreateBasicBlock();
@@ -10186,7 +10187,7 @@
return new(zone()) HConstant(s->Get(i), Representation::Integer32());
}
}
- AddInstruction(new(zone()) HCheckNonSmi(string));
+ BuildCheckNonSmi(string);
AddInstruction(HCheckInstanceType::NewIsString(string, zone()));
HInstruction* length = HStringLength::New(zone(), string);
AddInstruction(length);
@@ -10272,9 +10273,9 @@
switch (expr->op()) {
case Token::ADD:
if (left_info.IsString() && right_info.IsString()) {
- AddInstruction(new(zone()) HCheckNonSmi(left));
+ BuildCheckNonSmi(left);
AddInstruction(HCheckInstanceType::NewIsString(left, zone()));
- AddInstruction(new(zone()) HCheckNonSmi(right));
+ BuildCheckNonSmi(right);
AddInstruction(HCheckInstanceType::NewIsString(right, zone()));
instr = HStringAdd::New(zone(), context, left, right);
} else {
@@ -10680,9 +10681,9 @@
result->set_position(expr->position());
return ast_context()->ReturnControl(result, expr->id());
} else {
- AddInstruction(new(zone()) HCheckNonSmi(left));
+ BuildCheckNonSmi(left);
AddInstruction(HCheckInstanceType::NewIsSpecObject(left,
zone()));
- AddInstruction(new(zone()) HCheckNonSmi(right));
+ BuildCheckNonSmi(right);
AddInstruction(HCheckInstanceType::NewIsSpecObject(right,
zone()));
HCompareObjectEqAndBranch* result =
new(zone()) HCompareObjectEqAndBranch(left, right);
@@ -10695,9 +10696,9 @@
}
} else if (overall_type_info.IsInternalizedString() &&
Token::IsEqualityOp(op)) {
- AddInstruction(new(zone()) HCheckNonSmi(left));
+ BuildCheckNonSmi(left);
AddInstruction(HCheckInstanceType::NewIsInternalizedString(left,
zone()));
- AddInstruction(new(zone()) HCheckNonSmi(right));
+ BuildCheckNonSmi(right);
AddInstruction(HCheckInstanceType::NewIsInternalizedString(right,
zone()));
HCompareObjectEqAndBranch* result =
new(zone()) HCompareObjectEqAndBranch(left, right);
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.