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

Unified Diff: src/hydrogen.cc

Issue 1191283003: [date] Use explicit control flow to replace %_ThrowIfNotADate. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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.h ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 5bf3dc090712985bbd973ccee6e3548ed47dc2b3..0019b6d578c803af9f19376d253cfc8945165ef6 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -11958,14 +11958,21 @@ void HOptimizedGraphBuilder::GenerateJSValueGetValue(CallRuntime* call) {
}
-void HOptimizedGraphBuilder::GenerateThrowIfNotADate(CallRuntime* call) {
+void HOptimizedGraphBuilder::GenerateIsDate(CallRuntime* call) {
DCHECK_EQ(1, call->arguments()->length());
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
- HValue* obj = Pop();
- BuildCheckHeapObject(obj);
- HCheckInstanceType* check =
- New<HCheckInstanceType>(obj, HCheckInstanceType::IS_JS_DATE);
- return ast_context()->ReturnInstruction(check, call->id());
+ HValue* value = Pop();
+ HHasInstanceTypeAndBranch* result =
+ New<HHasInstanceTypeAndBranch>(value, JS_DATE_TYPE);
+ return ast_context()->ReturnControl(result, call->id());
+}
+
+
+void HOptimizedGraphBuilder::GenerateThrowNotDateError(CallRuntime* call) {
+ DCHECK_EQ(0, call->arguments()->length());
+ Add<HDeoptimize>(Deoptimizer::kNotADateObject, Deoptimizer::EAGER);
+ Add<HSimulate>(call->id(), FIXED_SIMULATE);
+ return ast_context()->ReturnValue(graph()->GetConstantUndefined());
}
« no previous file with comments | « src/hydrogen.h ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698