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

Side by Side Diff: src/hydrogen-instructions.cc

Issue 104663004: Preview of a first step towards unification of hydrogen calls (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merge fix Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 } 833 }
834 834
835 835
836 void HUnaryCall::PrintDataTo(StringStream* stream) { 836 void HUnaryCall::PrintDataTo(StringStream* stream) {
837 value()->PrintNameTo(stream); 837 value()->PrintNameTo(stream);
838 stream->Add(" "); 838 stream->Add(" ");
839 stream->Add("#%d", argument_count()); 839 stream->Add("#%d", argument_count());
840 } 840 }
841 841
842 842
843 void HCallJSFunction::PrintDataTo(StringStream* stream) {
844 OperandAt(0)->PrintNameTo(stream);
845 stream->Add(" ");
846 OperandAt(1)->PrintNameTo(stream);
847 stream->Add(" ");
848 stream->Add("#%d", argument_count());
849 }
850
851
852 HCallJSFunction* HCallJSFunction::New(
853 Zone* zone,
854 HValue* context,
855 HValue* function,
856 int argument_count,
857 bool pass_argument_count) {
858 bool has_stack_check = false;
859 if (function->IsConstant()) {
860 HConstant* fun_const = HConstant::cast(function);
861 Handle<JSFunction> jsfun =
862 Handle<JSFunction>::cast(fun_const->handle(zone->isolate()));
863 has_stack_check = !jsfun.is_null() &&
864 (jsfun->code()->kind() == Code::FUNCTION ||
865 jsfun->code()->kind() == Code::OPTIMIZED_FUNCTION);
866 }
867
868 return new(zone) HCallJSFunction(
869 function, argument_count, pass_argument_count,
870 has_stack_check);
871 }
872
873
874
875
843 void HBinaryCall::PrintDataTo(StringStream* stream) { 876 void HBinaryCall::PrintDataTo(StringStream* stream) {
844 first()->PrintNameTo(stream); 877 first()->PrintNameTo(stream);
845 stream->Add(" "); 878 stream->Add(" ");
846 second()->PrintNameTo(stream); 879 second()->PrintNameTo(stream);
847 stream->Add(" "); 880 stream->Add(" ");
848 stream->Add("#%d", argument_count()); 881 stream->Add("#%d", argument_count());
849 } 882 }
850 883
851 884
852 void HBoundsCheck::ApplyIndexChange() { 885 void HBoundsCheck::ApplyIndexChange() {
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 991
959 992
960 void HBoundsCheckBaseIndexInformation::PrintDataTo(StringStream* stream) { 993 void HBoundsCheckBaseIndexInformation::PrintDataTo(StringStream* stream) {
961 stream->Add("base: "); 994 stream->Add("base: ");
962 base_index()->PrintNameTo(stream); 995 base_index()->PrintNameTo(stream);
963 stream->Add(", check: "); 996 stream->Add(", check: ");
964 base_index()->PrintNameTo(stream); 997 base_index()->PrintNameTo(stream);
965 } 998 }
966 999
967 1000
968 void HCallConstantFunction::PrintDataTo(StringStream* stream) { 1001 void HCallWithDescriptor::PrintDataTo(StringStream* stream) {
969 if (IsApplyFunction()) { 1002 for (int i = 0; i < OperandCount(); i++) {
970 stream->Add("optimized apply "); 1003 OperandAt(i)->PrintNameTo(stream);
971 } else { 1004 stream->Add(" ");
972 stream->Add("%o ", function()->shared()->DebugName());
973 } 1005 }
974 stream->Add("#%d", argument_count()); 1006 stream->Add("#%d", argument_count());
975 } 1007 }
976 1008
977 1009
978 void HCallNamed::PrintDataTo(StringStream* stream) {
979 stream->Add("%o ", *name());
980 HUnaryCall::PrintDataTo(stream);
981 }
982
983
984 void HCallKnownGlobal::PrintDataTo(StringStream* stream) {
985 stream->Add("%o ", target()->shared()->DebugName());
986 stream->Add("#%d", argument_count());
987 }
988
989
990 void HCallNewArray::PrintDataTo(StringStream* stream) { 1010 void HCallNewArray::PrintDataTo(StringStream* stream) {
991 stream->Add(ElementsKindToString(elements_kind())); 1011 stream->Add(ElementsKindToString(elements_kind()));
992 stream->Add(" "); 1012 stream->Add(" ");
993 HBinaryCall::PrintDataTo(stream); 1013 HBinaryCall::PrintDataTo(stream);
994 } 1014 }
995 1015
996 1016
997 void HCallRuntime::PrintDataTo(StringStream* stream) { 1017 void HCallRuntime::PrintDataTo(StringStream* stream) {
998 stream->Add("%o ", *name()); 1018 stream->Add("%o ", *name());
999 if (save_doubles() == kSaveFPRegs) { 1019 if (save_doubles() == kSaveFPRegs) {
(...skipping 3430 matching lines...) Expand 10 before | Expand all | Expand 10 after
4430 break; 4450 break;
4431 case kExternalMemory: 4451 case kExternalMemory:
4432 stream->Add("[external-memory]"); 4452 stream->Add("[external-memory]");
4433 break; 4453 break;
4434 } 4454 }
4435 4455
4436 stream->Add("@%d", offset()); 4456 stream->Add("@%d", offset());
4437 } 4457 }
4438 4458
4439 } } // namespace v8::internal 4459 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698