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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index 59341c032a65042feca41112fba2fc9ef7afa460..40b5afa65facb4504679511cdf758ddde0f7e27f 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -840,6 +840,39 @@ void HUnaryCall::PrintDataTo(StringStream* stream) {
}
+void HCallJSFunction::PrintDataTo(StringStream* stream) {
+ OperandAt(0)->PrintNameTo(stream);
+ stream->Add(" ");
+ OperandAt(1)->PrintNameTo(stream);
+ stream->Add(" ");
+ stream->Add("#%d", argument_count());
+}
+
+
+HCallJSFunction* HCallJSFunction::New(
+ Zone* zone,
+ HValue* context,
+ HValue* function,
+ int argument_count,
+ bool pass_argument_count) {
+ bool has_stack_check = false;
+ if (function->IsConstant()) {
+ HConstant* fun_const = HConstant::cast(function);
+ Handle<JSFunction> jsfun =
+ Handle<JSFunction>::cast(fun_const->handle(zone->isolate()));
+ has_stack_check = !jsfun.is_null() &&
+ (jsfun->code()->kind() == Code::FUNCTION ||
+ jsfun->code()->kind() == Code::OPTIMIZED_FUNCTION);
+ }
+
+ return new(zone) HCallJSFunction(
+ function, argument_count, pass_argument_count,
+ has_stack_check);
+}
+
+
+
+
void HBinaryCall::PrintDataTo(StringStream* stream) {
first()->PrintNameTo(stream);
stream->Add(" ");
@@ -965,28 +998,15 @@ void HBoundsCheckBaseIndexInformation::PrintDataTo(StringStream* stream) {
}
-void HCallConstantFunction::PrintDataTo(StringStream* stream) {
- if (IsApplyFunction()) {
- stream->Add("optimized apply ");
- } else {
- stream->Add("%o ", function()->shared()->DebugName());
+void HCallWithDescriptor::PrintDataTo(StringStream* stream) {
+ for (int i = 0; i < OperandCount(); i++) {
+ OperandAt(i)->PrintNameTo(stream);
+ stream->Add(" ");
}
stream->Add("#%d", argument_count());
}
-void HCallNamed::PrintDataTo(StringStream* stream) {
- stream->Add("%o ", *name());
- HUnaryCall::PrintDataTo(stream);
-}
-
-
-void HCallKnownGlobal::PrintDataTo(StringStream* stream) {
- stream->Add("%o ", target()->shared()->DebugName());
- stream->Add("#%d", argument_count());
-}
-
-
void HCallNewArray::PrintDataTo(StringStream* stream) {
stream->Add(ElementsKindToString(elements_kind()));
stream->Add(" ");
« 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