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

Unified Diff: src/code-stubs.h

Issue 1304633002: Correctify instanceof and make it optimizable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Add MIPS/MIPS64 ports. Created 5 years, 4 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-factory.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.h
diff --git a/src/code-stubs.h b/src/code-stubs.h
index 2e8f1076be10c3e25ca73ff011174be1f94e932d..ed4dec9ecabdad1eed8f6cd6195278003cd9b0ad 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -34,7 +34,7 @@ namespace internal {
V(CompareIC) \
V(DoubleToI) \
V(FunctionPrototype) \
- V(Instanceof) \
+ V(InstanceOf) \
V(InternalArrayConstructor) \
V(JSEntry) \
V(KeyedLoadICTrampoline) \
@@ -876,47 +876,14 @@ class GrowArrayElementsStub : public HydrogenCodeStub {
DEFINE_HYDROGEN_CODE_STUB(GrowArrayElements, HydrogenCodeStub);
};
-class InstanceofStub: public PlatformCodeStub {
- public:
- enum Flags {
- kNoFlags = 0,
- kArgsInRegisters = 1 << 0,
- kCallSiteInlineCheck = 1 << 1,
- kReturnTrueFalseObject = 1 << 2
- };
-
- InstanceofStub(Isolate* isolate, Flags flags) : PlatformCodeStub(isolate) {
- minor_key_ = FlagBits::encode(flags);
- }
- static Register left() { return InstanceofDescriptor::left(); }
- static Register right() { return InstanceofDescriptor::right(); }
-
- CallInterfaceDescriptor GetCallInterfaceDescriptor() const override {
- if (HasArgsInRegisters()) {
- return InstanceofDescriptor(isolate());
- }
- return ContextOnlyDescriptor(isolate());
- }
+class InstanceOfStub final : public PlatformCodeStub {
+ public:
+ explicit InstanceOfStub(Isolate* isolate) : PlatformCodeStub(isolate) {}
private:
- Flags flags() const { return FlagBits::decode(minor_key_); }
-
- bool HasArgsInRegisters() const { return (flags() & kArgsInRegisters) != 0; }
-
- bool HasCallSiteInlineCheck() const {
- return (flags() & kCallSiteInlineCheck) != 0;
- }
-
- bool ReturnTrueFalseObject() const {
- return (flags() & kReturnTrueFalseObject) != 0;
- }
-
- void PrintName(std::ostream& os) const override; // NOLINT
-
- class FlagBits : public BitField<Flags, 0, 3> {};
-
- DEFINE_PLATFORM_CODE_STUB(Instanceof, PlatformCodeStub);
+ DEFINE_CALL_INTERFACE_DESCRIPTOR(InstanceOf);
+ DEFINE_PLATFORM_CODE_STUB(InstanceOf, PlatformCodeStub);
};
« no previous file with comments | « src/code-factory.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698