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

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: Addressed code review comments Created 6 years, 12 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
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index 6e1739716a14f877e5d1c109b1e0de2de42f651a..02f88b3498a539fa4fa5d557e0e9b0af867d42a8 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -849,6 +849,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,
Toon Verwaest 2014/01/14 15:33:50 Either align HValue* context with Zone* zone, or m
Jarin 2014/01/14 19:08:08 Done.
+ HValue* function,
+ HValue* call_kind_value,
+ 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()));
Toon Verwaest 2014/01/14 15:33:50 4-space indent.
Jarin 2014/01/14 19:08:08 Done.
+ has_stack_check = !jsfun.is_null() &&
+ (jsfun->code()->kind() == Code::FUNCTION ||
+ jsfun->code()->kind() == Code::OPTIMIZED_FUNCTION);
+ }
+
+ return new(zone) HCallJSFunction(
+ function, call_kind_value, argument_count, pass_argument_count,
+ has_stack_check);
+}
+
+
+
+
void HBinaryCall::PrintDataTo(StringStream* stream) {
first()->PrintNameTo(stream);
stream->Add(" ");
@@ -974,34 +1007,21 @@ 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 HCallGlobal::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(" ");

Powered by Google App Engine
This is Rietveld 408576698