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

Unified Diff: src/hydrogen.cc

Issue 651223002: Implement inline %_IsJSProxy() for full codegen and Hydrogen (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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/arm64/full-codegen-arm64.cc ('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 e956947495ebdebb7da03741ce57dc1d97f31173..cb8ade3d97edb42874e8ccde792e84643869dd93 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -11459,6 +11459,29 @@ void HOptimizedGraphBuilder::GenerateIsObject(CallRuntime* call) {
}
+void HOptimizedGraphBuilder::GenerateIsJSProxy(CallRuntime* call) {
+ DCHECK(call->arguments()->length() == 1);
+ CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
+ HValue* value = Pop();
+ HIfContinuation continuation;
+ IfBuilder if_proxy(this);
+
+ HValue* smicheck = if_proxy.IfNot<HIsSmiAndBranch>(value);
+ if_proxy.And();
+ HValue* map = Add<HLoadNamedField>(value, smicheck, HObjectAccess::ForMap());
+ HValue* instance_type = Add<HLoadNamedField>(
+ map, static_cast<HValue*>(NULL), HObjectAccess::ForMapInstanceType());
+ if_proxy.If<HCompareNumericAndBranch>(
+ instance_type, Add<HConstant>(FIRST_JS_PROXY_TYPE), Token::GTE);
+ if_proxy.And();
+ if_proxy.If<HCompareNumericAndBranch>(
+ instance_type, Add<HConstant>(LAST_JS_PROXY_TYPE), Token::LTE);
+
+ if_proxy.CaptureContinuation(&continuation);
+ return ast_context()->ReturnContinuation(&continuation, call->id());
+}
+
+
void HOptimizedGraphBuilder::GenerateIsNonNegativeSmi(CallRuntime* call) {
return Bailout(kInlinedRuntimeFunctionIsNonNegativeSmi);
}
« no previous file with comments | « src/arm64/full-codegen-arm64.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698