diff options
Diffstat (limited to 'V8Binding/v8/src/codegen.h')
-rw-r--r-- | V8Binding/v8/src/codegen.h | 56 |
1 files changed, 48 insertions, 8 deletions
diff --git a/V8Binding/v8/src/codegen.h b/V8Binding/v8/src/codegen.h index e1758e1..243d87c 100644 --- a/V8Binding/v8/src/codegen.h +++ b/V8Binding/v8/src/codegen.h @@ -61,12 +61,6 @@ // FindInlineRuntimeLUT // CheckForInlineRuntimeCall // PatchInlineRuntimeEntry -// GenerateFastCaseSwitchStatement -// GenerateFastCaseSwitchCases -// TryGenerateFastCaseSwitchStatement -// GenerateFastCaseSwitchJumpTable -// FastCaseSwitchMinCaseCount -// FastCaseSwitchMaxOverheadFactor // CodeForFunctionPosition // CodeForReturnPosition // CodeForStatementPosition @@ -83,6 +77,8 @@ enum OverwriteMode { NO_OVERWRITE, OVERWRITE_LEFT, OVERWRITE_RIGHT }; #include "x64/codegen-x64.h" #elif V8_TARGET_ARCH_ARM #include "arm/codegen-arm.h" +#else +#error Unsupported target architecture. #endif #include "register-allocator.h" @@ -228,19 +224,63 @@ class StackCheckStub : public CodeStub { }; +class InstanceofStub: public CodeStub { + public: + InstanceofStub() { } + + void Generate(MacroAssembler* masm); + + private: + Major MajorKey() { return Instanceof; } + int MinorKey() { return 0; } +}; + + class UnarySubStub : public CodeStub { public: - UnarySubStub() { } + explicit UnarySubStub(bool overwrite) + : overwrite_(overwrite) { } private: + bool overwrite_; Major MajorKey() { return UnarySub; } - int MinorKey() { return 0; } + int MinorKey() { return overwrite_ ? 1 : 0; } void Generate(MacroAssembler* masm); const char* GetName() { return "UnarySubStub"; } }; +class CompareStub: public CodeStub { + public: + CompareStub(Condition cc, bool strict) : cc_(cc), strict_(strict) { } + + void Generate(MacroAssembler* masm); + + private: + Condition cc_; + bool strict_; + + Major MajorKey() { return Compare; } + + int MinorKey(); + + // Branch to the label if the given object isn't a symbol. + void BranchIfNonSymbol(MacroAssembler* masm, + Label* label, + Register object, + Register scratch); + +#ifdef DEBUG + void Print() { + PrintF("CompareStub (cc %d), (strict %s)\n", + static_cast<int>(cc_), + strict_ ? "true" : "false"); + } +#endif +}; + + class CEntryStub : public CodeStub { public: CEntryStub() { } |