| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 7641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7652 AddElementAccess( | 7652 AddElementAccess( |
| 7653 elements, reduced_length, hole, bounds_check, elements_kind, true); | 7653 elements, reduced_length, hole, bounds_check, elements_kind, true); |
| 7654 } | 7654 } |
| 7655 Add<HStoreNamedField>( | 7655 Add<HStoreNamedField>( |
| 7656 checked_object, HObjectAccess::ForArrayLength(elements_kind), | 7656 checked_object, HObjectAccess::ForArrayLength(elements_kind), |
| 7657 reduced_length); | 7657 reduced_length); |
| 7658 ast_context()->ReturnValue(result); | 7658 ast_context()->ReturnValue(result); |
| 7659 Add<HSimulate>(expr->id(), REMOVABLE_SIMULATE); | 7659 Add<HSimulate>(expr->id(), REMOVABLE_SIMULATE); |
| 7660 return true; | 7660 return true; |
| 7661 } | 7661 } |
| 7662 case kArrayPush: { |
| 7663 if (!expr->IsMonomorphic() || expr->check_type() != RECEIVER_MAP_CHECK) { |
| 7664 return false; |
| 7665 } |
| 7666 if (receiver_map->instance_type() != JS_ARRAY_TYPE) return false; |
| 7667 ElementsKind elements_kind = receiver_map->elements_kind(); |
| 7668 if (!IsFastElementsKind(elements_kind)) return false; |
| 7669 AddCheckConstantFunction(expr->holder(), receiver, receiver_map); |
| 7670 |
| 7671 HValue* op_vals[] = { |
| 7672 context(), |
| 7673 // Receiver. |
| 7674 environment()->ExpressionStackAt(expr->arguments()->length()) |
| 7675 }; |
| 7676 |
| 7677 const int argc = expr->arguments()->length(); |
| 7678 // Includes receiver. |
| 7679 PushArgumentsFromEnvironment(argc + 1); |
| 7680 |
| 7681 CallInterfaceDescriptor* descriptor = |
| 7682 isolate()->call_descriptor(Isolate::CallHandler); |
| 7683 |
| 7684 ArrayPushStub stub(receiver_map->elements_kind(), argc); |
| 7685 Handle<Code> code = stub.GetCode(isolate()); |
| 7686 HConstant* code_value = Add<HConstant>(code); |
| 7687 |
| 7688 ASSERT((sizeof(op_vals) / kPointerSize) == |
| 7689 descriptor->environment_length()); |
| 7690 |
| 7691 HInstruction* call = New<HCallWithDescriptor>( |
| 7692 code_value, argc + 1, descriptor, |
| 7693 Vector<HValue*>(op_vals, descriptor->environment_length())); |
| 7694 ast_context()->ReturnInstruction(call, expr->id()); |
| 7695 return true; |
| 7696 } |
| 7662 default: | 7697 default: |
| 7663 // Not yet supported for inlining. | 7698 // Not yet supported for inlining. |
| 7664 break; | 7699 break; |
| 7665 } | 7700 } |
| 7666 return false; | 7701 return false; |
| 7667 } | 7702 } |
| 7668 | 7703 |
| 7669 | 7704 |
| 7670 bool HOptimizedGraphBuilder::TryCallApply(Call* expr) { | 7705 bool HOptimizedGraphBuilder::TryCallApply(Call* expr) { |
| 7671 Expression* callee = expr->expression(); | 7706 Expression* callee = expr->expression(); |
| (...skipping 3374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11046 if (ShouldProduceTraceOutput()) { | 11081 if (ShouldProduceTraceOutput()) { |
| 11047 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 11082 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 11048 } | 11083 } |
| 11049 | 11084 |
| 11050 #ifdef DEBUG | 11085 #ifdef DEBUG |
| 11051 graph_->Verify(false); // No full verify. | 11086 graph_->Verify(false); // No full verify. |
| 11052 #endif | 11087 #endif |
| 11053 } | 11088 } |
| 11054 | 11089 |
| 11055 } } // namespace v8::internal | 11090 } } // namespace v8::internal |
| OLD | NEW |