OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1001 int num_parameters = graph()->info()->num_parameters(); | 1001 int num_parameters = graph()->info()->num_parameters(); |
1002 HValue* params = AddInstruction(new(graph()->zone()) | 1002 HValue* params = AddInstruction(new(graph()->zone()) |
1003 HConstant(num_parameters)); | 1003 HConstant(num_parameters)); |
1004 HReturn* return_instruction = new(graph()->zone()) | 1004 HReturn* return_instruction = new(graph()->zone()) |
1005 HReturn(value, context, params); | 1005 HReturn(value, context, params); |
1006 current_block()->FinishExit(return_instruction); | 1006 current_block()->FinishExit(return_instruction); |
1007 return return_instruction; | 1007 return return_instruction; |
1008 } | 1008 } |
1009 | 1009 |
1010 | 1010 |
1011 void HGraphBuilder::AddSoftDeoptimize() { | |
1012 if (FLAG_always_opt) return; | |
1013 if (current_block()->IsDeoptimizing()) return; | |
1014 AddInstruction(new(zone()) HSoftDeoptimize()); | |
1015 current_block()->MarkAsDeoptimizing(); | |
1016 graph()->set_has_soft_deoptimize(true); | |
1017 } | |
1018 | |
1019 | |
1011 HBasicBlock* HGraphBuilder::CreateBasicBlock(HEnvironment* env) { | 1020 HBasicBlock* HGraphBuilder::CreateBasicBlock(HEnvironment* env) { |
1012 HBasicBlock* b = graph()->CreateBasicBlock(); | 1021 HBasicBlock* b = graph()->CreateBasicBlock(); |
1013 b->SetInitialEnvironment(env); | 1022 b->SetInitialEnvironment(env); |
1014 return b; | 1023 return b; |
1015 } | 1024 } |
1016 | 1025 |
1017 | 1026 |
1018 HBasicBlock* HGraphBuilder::CreateLoopHeaderBlock() { | 1027 HBasicBlock* HGraphBuilder::CreateLoopHeaderBlock() { |
1019 HBasicBlock* header = graph()->CreateBasicBlock(); | 1028 HBasicBlock* header = graph()->CreateBasicBlock(); |
1020 HEnvironment* entry_env = environment()->CopyAsLoopHeader(header); | 1029 HEnvironment* entry_env = environment()->CopyAsLoopHeader(header); |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1671 key_constant, | 1680 key_constant, |
1672 value, | 1681 value, |
1673 kind)); | 1682 kind)); |
1674 } | 1683 } |
1675 } | 1684 } |
1676 | 1685 |
1677 return object; | 1686 return object; |
1678 } | 1687 } |
1679 | 1688 |
1680 | 1689 |
1690 HInstruction* HGraphBuilder::BuildUnaryMathOp( | |
1691 HValue* input, Handle<Type> type, Token::Value operation) { | |
1692 // We only handle the numeric cases here | |
1693 type = handle( | |
1694 Type::Intersect(type, handle(Type::Number(), isolate())), isolate()); | |
1695 | |
1696 switch (operation) { | |
1697 default: | |
1698 UNREACHABLE(); | |
1699 case Token::SUB: { | |
1700 HInstruction* instr = | |
1701 HMul::New(zone(), environment()->LookupContext(), | |
1702 input, graph()->GetConstantMinus1()); | |
1703 Representation rep = Representation::FromType(type); | |
1704 if (type->Is(Type::None())) { | |
1705 AddSoftDeoptimize(); | |
1706 type = handle(Type::Any(), isolate()); | |
1707 } | |
1708 if (instr->IsBinaryOperation()) { | |
1709 HBinaryOperation* binop = HBinaryOperation::cast(instr); | |
1710 binop->set_observed_input_representation(1, rep); | |
1711 binop->set_observed_input_representation(2, rep); | |
1712 } | |
1713 return instr; | |
1714 } | |
1715 case Token::BIT_NOT: | |
1716 if (type->Is(Type::None())) { | |
1717 AddSoftDeoptimize(); | |
1718 } | |
1719 return new(zone()) HBitNot(input); | |
1720 } | |
1721 } | |
1722 | |
1723 | |
1681 void HGraphBuilder::BuildCompareNil( | 1724 void HGraphBuilder::BuildCompareNil( |
1682 HValue* value, | 1725 HValue* value, |
1683 Handle<Type> type, | 1726 Handle<Type> type, |
1684 int position, | 1727 int position, |
1685 HIfContinuation* continuation) { | 1728 HIfContinuation* continuation) { |
1686 IfBuilder if_nil(this, position); | 1729 IfBuilder if_nil(this, position); |
1687 bool needs_or = false; | 1730 bool needs_or = false; |
1688 if (type->Maybe(Type::Null())) { | 1731 if (type->Maybe(Type::Null())) { |
1689 if (needs_or) if_nil.Or(); | 1732 if (needs_or) if_nil.Or(); |
1690 if_nil.If<HCompareObjectEqAndBranch>(value, graph()->GetConstantNull()); | 1733 if_nil.If<HCompareObjectEqAndBranch>(value, graph()->GetConstantNull()); |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1933 HStoreNamedField* HGraphBuilder::AddStoreMapConstant(HValue *object, | 1976 HStoreNamedField* HGraphBuilder::AddStoreMapConstant(HValue *object, |
1934 Handle<Map> map) { | 1977 Handle<Map> map) { |
1935 HValue* constant = AddInstruction(new(zone()) HConstant(map)); | 1978 HValue* constant = AddInstruction(new(zone()) HConstant(map)); |
1936 HStoreNamedField *instr = | 1979 HStoreNamedField *instr = |
1937 new(zone()) HStoreNamedField(object, HObjectAccess::ForMap(), constant); | 1980 new(zone()) HStoreNamedField(object, HObjectAccess::ForMap(), constant); |
1938 AddInstruction(instr); | 1981 AddInstruction(instr); |
1939 return instr; | 1982 return instr; |
1940 } | 1983 } |
1941 | 1984 |
1942 | 1985 |
1986 HValue* HGraphBuilder::LoadJSBuiltin(Builtins::JavaScript builtin, | |
danno
2013/07/05 08:25:48
nit: one space after HValue*, and perhaps call thi
| |
1987 HContext* context) { | |
1988 HGlobalObject* global_object = new(zone()) HGlobalObject(context); | |
1989 AddInstruction(global_object); | |
danno
2013/07/05 08:25:48
Instead of
HGlobalObject* global_object = new(zon
| |
1990 HObjectAccess access = HObjectAccess::ForJSObjectOffset( | |
1991 GlobalObject::kBuiltinsOffset); | |
1992 HValue* builtins = AddLoad(global_object, access); | |
1993 HObjectAccess function_access = HObjectAccess::ForJSObjectOffset( | |
1994 JSBuiltinsObject::OffsetOfFunctionWithId(builtin)); | |
1995 return AddLoad(builtins, function_access); | |
1996 } | |
1997 | |
1998 | |
1943 HOptimizedGraphBuilder::HOptimizedGraphBuilder(CompilationInfo* info) | 1999 HOptimizedGraphBuilder::HOptimizedGraphBuilder(CompilationInfo* info) |
1944 : HGraphBuilder(info), | 2000 : HGraphBuilder(info), |
1945 function_state_(NULL), | 2001 function_state_(NULL), |
1946 initial_function_state_(this, info, NORMAL_RETURN), | 2002 initial_function_state_(this, info, NORMAL_RETURN), |
1947 ast_context_(NULL), | 2003 ast_context_(NULL), |
1948 break_scope_(NULL), | 2004 break_scope_(NULL), |
1949 inlined_count_(0), | 2005 inlined_count_(0), |
1950 globals_(10, info->zone()), | 2006 globals_(10, info->zone()), |
1951 inline_bailout_(false) { | 2007 inline_bailout_(false) { |
1952 // This is not initialized in the initializer list because the | 2008 // This is not initialized in the initializer list because the |
(...skipping 2703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4656 current_block()->AddPhi(instr); | 4712 current_block()->AddPhi(instr); |
4657 } | 4713 } |
4658 | 4714 |
4659 | 4715 |
4660 void HOptimizedGraphBuilder::PushAndAdd(HInstruction* instr) { | 4716 void HOptimizedGraphBuilder::PushAndAdd(HInstruction* instr) { |
4661 Push(instr); | 4717 Push(instr); |
4662 AddInstruction(instr); | 4718 AddInstruction(instr); |
4663 } | 4719 } |
4664 | 4720 |
4665 | 4721 |
4666 void HOptimizedGraphBuilder::AddSoftDeoptimize() { | |
4667 if (FLAG_always_opt) return; | |
4668 if (current_block()->IsDeoptimizing()) return; | |
4669 AddInstruction(new(zone()) HSoftDeoptimize()); | |
4670 current_block()->MarkAsDeoptimizing(); | |
4671 graph()->set_has_soft_deoptimize(true); | |
4672 } | |
4673 | |
4674 | |
4675 template <class Instruction> | 4722 template <class Instruction> |
4676 HInstruction* HOptimizedGraphBuilder::PreProcessCall(Instruction* call) { | 4723 HInstruction* HOptimizedGraphBuilder::PreProcessCall(Instruction* call) { |
4677 int count = call->argument_count(); | 4724 int count = call->argument_count(); |
4678 ZoneList<HValue*> arguments(count, zone()); | 4725 ZoneList<HValue*> arguments(count, zone()); |
4679 for (int i = 0; i < count; ++i) { | 4726 for (int i = 0; i < count; ++i) { |
4680 arguments.Add(Pop(), zone()); | 4727 arguments.Add(Pop(), zone()); |
4681 } | 4728 } |
4682 | 4729 |
4683 while (!arguments.is_empty()) { | 4730 while (!arguments.is_empty()) { |
4684 AddInstruction(new(zone()) HPushArgument(arguments.RemoveLast())); | 4731 AddInstruction(new(zone()) HPushArgument(arguments.RemoveLast())); |
(...skipping 4339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9024 HValue* value = Pop(); | 9071 HValue* value = Pop(); |
9025 HValue* context = environment()->LookupContext(); | 9072 HValue* context = environment()->LookupContext(); |
9026 HInstruction* instr = new(zone()) HTypeof(context, value); | 9073 HInstruction* instr = new(zone()) HTypeof(context, value); |
9027 return ast_context()->ReturnInstruction(instr, expr->id()); | 9074 return ast_context()->ReturnInstruction(instr, expr->id()); |
9028 } | 9075 } |
9029 | 9076 |
9030 | 9077 |
9031 void HOptimizedGraphBuilder::VisitSub(UnaryOperation* expr) { | 9078 void HOptimizedGraphBuilder::VisitSub(UnaryOperation* expr) { |
9032 CHECK_ALIVE(VisitForValue(expr->expression())); | 9079 CHECK_ALIVE(VisitForValue(expr->expression())); |
9033 HValue* value = Pop(); | 9080 HValue* value = Pop(); |
9034 HValue* context = environment()->LookupContext(); | |
9035 HInstruction* instr = | |
9036 HMul::New(zone(), context, value, graph()->GetConstantMinus1()); | |
9037 Handle<Type> type = expr->type(); | 9081 Handle<Type> type = expr->type(); |
9038 Representation rep = ToRepresentation(type); | 9082 HInstruction* instr = BuildUnaryMathOp(value, type, Token::SUB); |
9039 if (type->Is(Type::None())) { | |
9040 AddSoftDeoptimize(); | |
9041 type = handle(Type::Any(), isolate()); | |
9042 } | |
9043 if (instr->IsBinaryOperation()) { | |
9044 HBinaryOperation::cast(instr)->set_observed_input_representation(1, rep); | |
9045 HBinaryOperation::cast(instr)->set_observed_input_representation(2, rep); | |
9046 } | |
9047 return ast_context()->ReturnInstruction(instr, expr->id()); | 9083 return ast_context()->ReturnInstruction(instr, expr->id()); |
9048 } | 9084 } |
9049 | 9085 |
9050 | 9086 |
9051 void HOptimizedGraphBuilder::VisitBitNot(UnaryOperation* expr) { | 9087 void HOptimizedGraphBuilder::VisitBitNot(UnaryOperation* expr) { |
9052 CHECK_ALIVE(VisitForValue(expr->expression())); | 9088 CHECK_ALIVE(VisitForValue(expr->expression())); |
9053 HValue* value = Pop(); | 9089 HValue* value = Pop(); |
9054 Handle<Type> info = expr->type(); | 9090 Handle<Type> info = expr->type(); |
9055 if (info->Is(Type::None())) { | 9091 HInstruction* instr = BuildUnaryMathOp(value, info, Token::BIT_NOT); |
9056 AddSoftDeoptimize(); | |
9057 } | |
9058 HInstruction* instr = new(zone()) HBitNot(value); | |
9059 return ast_context()->ReturnInstruction(instr, expr->id()); | 9092 return ast_context()->ReturnInstruction(instr, expr->id()); |
9060 } | 9093 } |
9061 | 9094 |
9062 | 9095 |
9063 void HOptimizedGraphBuilder::VisitNot(UnaryOperation* expr) { | 9096 void HOptimizedGraphBuilder::VisitNot(UnaryOperation* expr) { |
9064 if (ast_context()->IsTest()) { | 9097 if (ast_context()->IsTest()) { |
9065 TestContext* context = TestContext::cast(ast_context()); | 9098 TestContext* context = TestContext::cast(ast_context()); |
9066 VisitForControl(expr->expression(), | 9099 VisitForControl(expr->expression(), |
9067 context->if_false(), | 9100 context->if_false(), |
9068 context->if_true()); | 9101 context->if_true()); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9102 set_current_block(join); | 9135 set_current_block(join); |
9103 if (join != NULL) return ast_context()->ReturnValue(Pop()); | 9136 if (join != NULL) return ast_context()->ReturnValue(Pop()); |
9104 } | 9137 } |
9105 | 9138 |
9106 | 9139 |
9107 HInstruction* HOptimizedGraphBuilder::BuildIncrement( | 9140 HInstruction* HOptimizedGraphBuilder::BuildIncrement( |
9108 bool returns_original_input, | 9141 bool returns_original_input, |
9109 CountOperation* expr) { | 9142 CountOperation* expr) { |
9110 // The input to the count operation is on top of the expression stack. | 9143 // The input to the count operation is on top of the expression stack. |
9111 TypeInfo info = expr->type(); | 9144 TypeInfo info = expr->type(); |
9112 Representation rep = ToRepresentation(info); | 9145 Representation rep = Representation::FromType(info); |
9113 if (rep.IsNone() || rep.IsTagged()) { | 9146 if (rep.IsNone() || rep.IsTagged()) { |
9114 rep = Representation::Smi(); | 9147 rep = Representation::Smi(); |
9115 } | 9148 } |
9116 | 9149 |
9117 if (returns_original_input) { | 9150 if (returns_original_input) { |
9118 // We need an explicit HValue representing ToNumber(input). The | 9151 // We need an explicit HValue representing ToNumber(input). The |
9119 // actual HChange instruction we need is (sometimes) added in a later | 9152 // actual HChange instruction we need is (sometimes) added in a later |
9120 // phase, so it is not available now to be used as an input to HAdd and | 9153 // phase, so it is not available now to be used as an input to HAdd and |
9121 // as the return value. | 9154 // as the return value. |
9122 HInstruction* number_input = new(zone()) HForceRepresentation(Pop(), rep); | 9155 HInstruction* number_input = new(zone()) HForceRepresentation(Pop(), rep); |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9413 HInstruction* HOptimizedGraphBuilder::BuildBinaryOperation( | 9446 HInstruction* HOptimizedGraphBuilder::BuildBinaryOperation( |
9414 BinaryOperation* expr, | 9447 BinaryOperation* expr, |
9415 HValue* left, | 9448 HValue* left, |
9416 HValue* right) { | 9449 HValue* right) { |
9417 HValue* context = environment()->LookupContext(); | 9450 HValue* context = environment()->LookupContext(); |
9418 Handle<Type> left_type = expr->left_type(); | 9451 Handle<Type> left_type = expr->left_type(); |
9419 Handle<Type> right_type = expr->right_type(); | 9452 Handle<Type> right_type = expr->right_type(); |
9420 Handle<Type> result_type = expr->result_type(); | 9453 Handle<Type> result_type = expr->result_type(); |
9421 bool has_fixed_right_arg = expr->has_fixed_right_arg(); | 9454 bool has_fixed_right_arg = expr->has_fixed_right_arg(); |
9422 int fixed_right_arg_value = expr->fixed_right_arg_value(); | 9455 int fixed_right_arg_value = expr->fixed_right_arg_value(); |
9423 Representation left_rep = ToRepresentation(left_type); | 9456 Representation left_rep = Representation::FromType(left_type); |
9424 Representation right_rep = ToRepresentation(right_type); | 9457 Representation right_rep = Representation::FromType(right_type); |
9425 Representation result_rep = ToRepresentation(result_type); | 9458 Representation result_rep = Representation::FromType(result_type); |
9426 if (left_type->Is(Type::None())) { | 9459 if (left_type->Is(Type::None())) { |
9427 AddSoftDeoptimize(); | 9460 AddSoftDeoptimize(); |
9428 left_type = handle(Type::Any(), isolate()); | 9461 left_type = handle(Type::Any(), isolate()); |
9429 } | 9462 } |
9430 if (right_type->Is(Type::None())) { | 9463 if (right_type->Is(Type::None())) { |
9431 AddSoftDeoptimize(); | 9464 AddSoftDeoptimize(); |
9432 right_type = handle(Type::Any(), isolate()); | 9465 right_type = handle(Type::Any(), isolate()); |
9433 } | 9466 } |
9434 HInstruction* instr = NULL; | 9467 HInstruction* instr = NULL; |
9435 switch (expr->op()) { | 9468 switch (expr->op()) { |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9647 CHECK_ALIVE(VisitForValue(expr->left())); | 9680 CHECK_ALIVE(VisitForValue(expr->left())); |
9648 CHECK_ALIVE(VisitForValue(expr->right())); | 9681 CHECK_ALIVE(VisitForValue(expr->right())); |
9649 HValue* right = Pop(); | 9682 HValue* right = Pop(); |
9650 HValue* left = Pop(); | 9683 HValue* left = Pop(); |
9651 HInstruction* instr = BuildBinaryOperation(expr, left, right); | 9684 HInstruction* instr = BuildBinaryOperation(expr, left, right); |
9652 instr->set_position(expr->position()); | 9685 instr->set_position(expr->position()); |
9653 return ast_context()->ReturnInstruction(instr, expr->id()); | 9686 return ast_context()->ReturnInstruction(instr, expr->id()); |
9654 } | 9687 } |
9655 | 9688 |
9656 | 9689 |
9657 // TODO(rossberg): this should die eventually. | |
9658 Representation HOptimizedGraphBuilder::ToRepresentation(TypeInfo info) { | |
9659 if (info.IsUninitialized()) return Representation::None(); | |
9660 // TODO(verwaest): Return Smi rather than Integer32. | |
9661 if (info.IsSmi()) return Representation::Integer32(); | |
9662 if (info.IsInteger32()) return Representation::Integer32(); | |
9663 if (info.IsDouble()) return Representation::Double(); | |
9664 if (info.IsNumber()) return Representation::Double(); | |
9665 return Representation::Tagged(); | |
9666 } | |
9667 | |
9668 | |
9669 Representation HOptimizedGraphBuilder::ToRepresentation(Handle<Type> type) { | |
9670 if (type->Is(Type::None())) return Representation::None(); | |
9671 if (type->Is(Type::Integer32())) return Representation::Integer32(); | |
9672 if (type->Is(Type::Number())) return Representation::Double(); | |
9673 return Representation::Tagged(); | |
9674 } | |
9675 | |
9676 | |
9677 void HOptimizedGraphBuilder::HandleLiteralCompareTypeof(CompareOperation* expr, | 9690 void HOptimizedGraphBuilder::HandleLiteralCompareTypeof(CompareOperation* expr, |
9678 HTypeof* typeof_expr, | 9691 HTypeof* typeof_expr, |
9679 Handle<String> check) { | 9692 Handle<String> check) { |
9680 // Note: The HTypeof itself is removed during canonicalization, if possible. | 9693 // Note: The HTypeof itself is removed during canonicalization, if possible. |
9681 HValue* value = typeof_expr->value(); | 9694 HValue* value = typeof_expr->value(); |
9682 HTypeofIsAndBranch* instr = new(zone()) HTypeofIsAndBranch(value, check); | 9695 HTypeofIsAndBranch* instr = new(zone()) HTypeofIsAndBranch(value, check); |
9683 instr->set_position(expr->position()); | 9696 instr->set_position(expr->position()); |
9684 return ast_context()->ReturnControl(instr, expr->id()); | 9697 return ast_context()->ReturnControl(instr, expr->id()); |
9685 } | 9698 } |
9686 | 9699 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9759 Handle<String> rhs = Handle<String>::cast(literal->handle()); | 9772 Handle<String> rhs = Handle<String>::cast(literal->handle()); |
9760 HClassOfTestAndBranch* instr = | 9773 HClassOfTestAndBranch* instr = |
9761 new(zone()) HClassOfTestAndBranch(value, rhs); | 9774 new(zone()) HClassOfTestAndBranch(value, rhs); |
9762 instr->set_position(expr->position()); | 9775 instr->set_position(expr->position()); |
9763 return ast_context()->ReturnControl(instr, expr->id()); | 9776 return ast_context()->ReturnControl(instr, expr->id()); |
9764 } | 9777 } |
9765 | 9778 |
9766 Handle<Type> left_type = expr->left_type(); | 9779 Handle<Type> left_type = expr->left_type(); |
9767 Handle<Type> right_type = expr->right_type(); | 9780 Handle<Type> right_type = expr->right_type(); |
9768 Handle<Type> overall_type = expr->overall_type(); | 9781 Handle<Type> overall_type = expr->overall_type(); |
9769 Representation combined_rep = ToRepresentation(overall_type); | 9782 Representation combined_rep = Representation::FromType(overall_type); |
9770 Representation left_rep = ToRepresentation(left_type); | 9783 Representation left_rep = Representation::FromType(left_type); |
9771 Representation right_rep = ToRepresentation(right_type); | 9784 Representation right_rep = Representation::FromType(right_type); |
9772 // Check if this expression was ever executed according to type feedback. | 9785 // Check if this expression was ever executed according to type feedback. |
9773 // Note that for the special typeof/null/undefined cases we get unknown here. | 9786 // Note that for the special typeof/null/undefined cases we get unknown here. |
9774 if (overall_type->Is(Type::None())) { | 9787 if (overall_type->Is(Type::None())) { |
9775 AddSoftDeoptimize(); | 9788 AddSoftDeoptimize(); |
9776 overall_type = left_type = right_type = handle(Type::Any(), isolate()); | 9789 overall_type = left_type = right_type = handle(Type::Any(), isolate()); |
9777 } | 9790 } |
9778 | 9791 |
9779 CHECK_ALIVE(VisitForValue(expr->left())); | 9792 CHECK_ALIVE(VisitForValue(expr->left())); |
9780 CHECK_ALIVE(VisitForValue(expr->right())); | 9793 CHECK_ALIVE(VisitForValue(expr->right())); |
9781 | 9794 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9884 return ast_context()->ReturnControl(result, expr->id()); | 9897 return ast_context()->ReturnControl(result, expr->id()); |
9885 } else { | 9898 } else { |
9886 if (combined_rep.IsTagged() || combined_rep.IsNone()) { | 9899 if (combined_rep.IsTagged() || combined_rep.IsNone()) { |
9887 HCompareGeneric* result = | 9900 HCompareGeneric* result = |
9888 new(zone()) HCompareGeneric(context, left, right, op); | 9901 new(zone()) HCompareGeneric(context, left, right, op); |
9889 result->set_observed_input_representation(1, left_rep); | 9902 result->set_observed_input_representation(1, left_rep); |
9890 result->set_observed_input_representation(2, right_rep); | 9903 result->set_observed_input_representation(2, right_rep); |
9891 result->set_position(expr->position()); | 9904 result->set_position(expr->position()); |
9892 return ast_context()->ReturnInstruction(result, expr->id()); | 9905 return ast_context()->ReturnInstruction(result, expr->id()); |
9893 } else { | 9906 } else { |
9894 // TODO(verwaest): Remove once ToRepresentation properly returns Smi when | 9907 // TODO(verwaest): Remove once Representation::FromType properly |
9895 // the IC measures Smi. | 9908 // returns Smi when the IC measures Smi. |
9896 if (left_type->Is(Type::Integer31())) left_rep = Representation::Smi(); | 9909 if (left_type->Is(Type::Integer31())) left_rep = Representation::Smi(); |
9897 if (right_type->Is(Type::Integer31())) right_rep = Representation::Smi(); | 9910 if (right_type->Is(Type::Integer31())) right_rep = Representation::Smi(); |
9898 HCompareIDAndBranch* result = | 9911 HCompareIDAndBranch* result = |
9899 new(zone()) HCompareIDAndBranch(left, right, op); | 9912 new(zone()) HCompareIDAndBranch(left, right, op); |
9900 result->set_observed_input_representation(left_rep, right_rep); | 9913 result->set_observed_input_representation(left_rep, right_rep); |
9901 result->set_position(expr->position()); | 9914 result->set_position(expr->position()); |
9902 return ast_context()->ReturnControl(result, expr->id()); | 9915 return ast_context()->ReturnControl(result, expr->id()); |
9903 } | 9916 } |
9904 } | 9917 } |
9905 } | 9918 } |
(...skipping 1682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
11588 } | 11601 } |
11589 } | 11602 } |
11590 | 11603 |
11591 #ifdef DEBUG | 11604 #ifdef DEBUG |
11592 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 11605 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
11593 if (allocator_ != NULL) allocator_->Verify(); | 11606 if (allocator_ != NULL) allocator_->Verify(); |
11594 #endif | 11607 #endif |
11595 } | 11608 } |
11596 | 11609 |
11597 } } // namespace v8::internal | 11610 } } // namespace v8::internal |
OLD | NEW |