}
+void HValue::AssumeRepresentation(Representation r) {
+ if (CheckFlag(kFlexibleRepresentation)) {
+ ChangeRepresentation(r);
+ // The representation of the value is dictated by type feedback and
+ // will not be changed later.
+ ClearFlag(kFlexibleRepresentation);
+ }
+}
+
+
static int32_t ConvertAndSetOverflow(int64_t result, bool* overflow) {
if (result > kMaxInt) {
*overflow = true;
TypeInfo info = oracle()->UnaryType(expr);
Representation rep = ToRepresentation(info);
TraceRepresentation(expr->op(), info, instr, rep);
- AssumeRepresentation(instr, rep);
+ instr->AssumeRepresentation(rep);
ast_context()->ReturnInstruction(instr, expr->id());
}
rep = Representation::Integer32();
}
TraceRepresentation(expr->op(), info, instr, rep);
- AssumeRepresentation(instr, rep);
+ instr->AssumeRepresentation(rep);
return instr;
}
rep = Representation::Integer32();
}
TraceRepresentation(expr->op(), info, instr, rep);
- AssumeRepresentation(instr, rep);
+ instr->AssumeRepresentation(rep);
return instr;
}
}
-void HGraphBuilder::AssumeRepresentation(HValue* value, Representation rep) {
- if (value->CheckFlag(HValue::kFlexibleRepresentation)) {
- value->ChangeRepresentation(rep);
- // The representation of the value is dictated by type feedback and
- // will not be changed later.
- value->ClearFlag(HValue::kFlexibleRepresentation);
- }
-}
-
-
Representation HGraphBuilder::ToRepresentation(TypeInfo info) {
if (info.IsSmi()) return Representation::Integer32();
if (info.IsInteger32()) return Representation::Integer32();