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

Unified Diff: src/hydrogen.cc

Issue 16957004: Migrate BinaryOpICs and UnaryOpICs to new type rep (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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
« no previous file with comments | « src/ast.cc ('k') | src/ic.h » ('j') | src/ic.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 3d0d5505aea05800177fdce62d85f9cafe7dcaef..91687f5399f8f39e2407eaa535fe0578f8f01923 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -9067,11 +9067,11 @@ void HOptimizedGraphBuilder::VisitSub(UnaryOperation* expr) {
HValue* context = environment()->LookupContext();
HInstruction* instr =
HMul::New(zone(), context, value, graph()->GetConstantMinus1());
- TypeInfo info = expr->type();
- Representation rep = ToRepresentation(info);
- if (info.IsUninitialized()) {
+ Handle<Type> type = expr->type();
+ Representation rep = ToRepresentation(type);
+ if (type->Is(Type::None())) {
AddSoftDeoptimize();
- info = TypeInfo::Unknown();
+ type = handle(Type::Any(), isolate());
}
if (instr->IsBinaryOperation()) {
HBinaryOperation::cast(instr)->set_observed_input_representation(1, rep);
@@ -9084,8 +9084,8 @@ void HOptimizedGraphBuilder::VisitSub(UnaryOperation* expr) {
void HOptimizedGraphBuilder::VisitBitNot(UnaryOperation* expr) {
CHECK_ALIVE(VisitForValue(expr->expression()));
HValue* value = Pop();
- TypeInfo info = expr->type();
- if (info.IsUninitialized()) {
+ Handle<Type> info = expr->type();
+ if (info->Is(Type::None())) {
AddSoftDeoptimize();
}
HInstruction* instr = new(zone()) HBitNot(value);
@@ -9445,24 +9445,24 @@ HInstruction* HOptimizedGraphBuilder::BuildBinaryOperation(
HValue* left,
HValue* right) {
HValue* context = environment()->LookupContext();
- TypeInfo left_info = expr->left_type();
- TypeInfo right_info = expr->right_type();
- TypeInfo result_info = expr->result_type();
+ Handle<Type> left_type = expr->left_type();
+ Handle<Type> right_type = expr->right_type();
+ Handle<Type> result_type = expr->result_type();
bool has_fixed_right_arg = expr->has_fixed_right_arg();
int fixed_right_arg_value = expr->fixed_right_arg_value();
- Representation left_rep = ToRepresentation(left_info);
- Representation right_rep = ToRepresentation(right_info);
- Representation result_rep = ToRepresentation(result_info);
- if (left_info.IsUninitialized()) {
+ Representation left_rep = ToRepresentation(left_type);
+ Representation right_rep = ToRepresentation(right_type);
+ Representation result_rep = ToRepresentation(result_type);
+ if (left_type->Is(Type::None())) {
// Can't have initialized one but not the other.
- ASSERT(right_info.IsUninitialized());
+ ASSERT(right_type->Is(Type::None()));
rossberg 2013/06/13 14:24:30 This might no longer be true in the future. I thin
Jakob Kummerow 2013/06/14 14:26:57 Done.
AddSoftDeoptimize();
- left_info = right_info = TypeInfo::Unknown();
+ left_type = right_type = handle(Type::Any(), isolate());
}
HInstruction* instr = NULL;
switch (expr->op()) {
case Token::ADD:
- if (left_info.IsString() && right_info.IsString()) {
+ if (left_type->Is(Type::String()) && right_type->Is(Type::String())) {
BuildCheckNonSmi(left);
AddInstruction(HCheckInstanceType::NewIsString(left, zone()));
BuildCheckNonSmi(right);
@@ -9495,7 +9495,8 @@ HInstruction* HOptimizedGraphBuilder::BuildBinaryOperation(
break;
case Token::BIT_OR: {
HValue* operand, *shift_amount;
- if (left_info.IsInteger32() && right_info.IsInteger32() &&
+ if (left_type->Is(Type::Integer32()) &&
+ right_type->Is(Type::Integer32()) &&
MatchRotateRight(left, right, &operand, &shift_amount)) {
instr = new(zone()) HRor(context, operand, shift_amount);
} else {
« no previous file with comments | « src/ast.cc ('k') | src/ic.h » ('j') | src/ic.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698