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

Unified Diff: src/code-stubs.cc

Issue 14367018: Add monomorphic CompareNilICs and Crankshaft support (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 7 years, 8 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/code-stubs.h ('k') | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.cc
diff --git a/src/code-stubs.cc b/src/code-stubs.cc
index 3a4243dc5b853a8ade75d315d346634fe4af9dab..1a2716360e543f645176b4ef7da97af0afc20770 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -407,6 +407,42 @@ void ICCompareStub::Generate(MacroAssembler* masm) {
}
+CompareNilICStub::Types CompareNilICStub::GetPatchedICFlags(
+ Code::ExtraICState extra_ic_state,
+ Handle<Object> object,
+ bool* already_monomorphic) {
+ Types types = TypesField::decode(extra_ic_state);
+ NilValue nil = NilValueField::decode(extra_ic_state);
+ EqualityKind kind = EqualityKindField::decode(extra_ic_state);
+ ASSERT(types != CompareNilICStub::kFullCompare);
+ *already_monomorphic =
+ (types & CompareNilICStub::kCompareAgainstMonomorphicMap) != 0;
+ if (kind == kStrictEquality) {
+ if (nil == kNullValue) {
+ return CompareNilICStub::kCompareAgainstNull;
+ } else {
+ return CompareNilICStub::kCompareAgainstUndefined;
+ }
+ } else {
+ if (object->IsNull()) {
+ types = static_cast<CompareNilICStub::Types>(
+ types | CompareNilICStub::kCompareAgainstNull);
+ } else if (object->IsUndefined()) {
+ types = static_cast<CompareNilICStub::Types>(
+ types | CompareNilICStub::kCompareAgainstUndefined);
+ } else if (object->IsUndetectableObject() || !object->IsHeapObject()) {
+ types = CompareNilICStub::kFullCompare;
+ } else if ((types & CompareNilICStub::kCompareAgainstMonomorphicMap) != 0) {
+ types = CompareNilICStub::kFullCompare;
+ } else {
+ types = static_cast<CompareNilICStub::Types>(
+ types | CompareNilICStub::kCompareAgainstMonomorphicMap);
+ }
+ }
+ return types;
+}
+
+
void InstanceofStub::PrintName(StringStream* stream) {
const char* args = "";
if (HasArgsInRegisters()) {
« no previous file with comments | « src/code-stubs.h ('k') | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698