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

Unified Diff: src/ic.cc

Issue 15302004: Convert ToBooleanStub to a HydrogenStub. Currently just using HBranch, which is still fully impleme… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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/ic.cc
diff --git a/src/ic.cc b/src/ic.cc
index e81ea10d9314f0d37d05db996efef1fb93cefecd..6029180a39c95ab0a5838ff8c013fcd4801c29b4 100644
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -2972,23 +2972,23 @@ RUNTIME_FUNCTION(MaybeObject*, Unreachable) {
}
-RUNTIME_FUNCTION(MaybeObject*, ToBoolean_Patch) {
- ASSERT(args.length() == 3);
+MaybeObject* ToBooleanIC::ToBoolean(Handle<Object> object,
+ Code::ExtraICState extra_ic_state) {
+ ToBooleanStub stub(extra_ic_state);
+ bool to_boolean_value = stub.Record(object);
+ Handle<Code> code = stub.GetCode(isolate());
+ patch(*code);
Toon Verwaest 2013/05/28 09:33:32 Just directly use set_target and remove patch.
+ return Smi::FromInt(to_boolean_value ? 1 : 0);
+}
+
+RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss) {
+ ASSERT(args.length() == 1);
HandleScope scope(isolate);
Handle<Object> object = args.at<Object>(0);
- Register tos = Register::from_code(args.smi_at(1));
- ToBooleanStub::Types old_types(args.smi_at(2));
-
- ToBooleanStub::Types new_types(old_types);
- bool to_boolean_value = new_types.Record(object);
- old_types.TraceTransition(new_types);
-
- ToBooleanStub stub(tos, new_types);
- Handle<Code> code = stub.GetCode(isolate);
ToBooleanIC ic(isolate);
- ic.patch(*code);
- return Smi::FromInt(to_boolean_value ? 1 : 0);
+ Code::ExtraICState ic_state = ic.target()->extended_extra_ic_state();
+ return ic.ToBoolean(object, ic_state);
}
« src/ia32/lithium-codegen-ia32.cc ('K') | « src/ic.h ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698