| Index: src/code-stubs.h
|
| ===================================================================
|
| --- src/code-stubs.h (revision 6800)
|
| +++ src/code-stubs.h (working copy)
|
| @@ -1,4 +1,4 @@
|
| -// Copyright 2006-2008 the V8 project authors. All rights reserved.
|
| +// Copyright 2011 the V8 project authors. All rights reserved.
|
| // Redistribution and use in source and binary forms, with or without
|
| // modification, are permitted provided that the following conditions are
|
| // met:
|
| @@ -34,7 +34,7 @@
|
| namespace internal {
|
|
|
| // List of code stubs used on all platforms. The order in this list is important
|
| -// as only the stubs up to and including RecordWrite allows nested stub calls.
|
| +// as only the stubs up to and including Instanceof allows nested stub calls.
|
| #define CODE_STUB_LIST_ALL_PLATFORMS(V) \
|
| V(CallFunction) \
|
| V(GenericBinaryOp) \
|
| @@ -49,7 +49,7 @@
|
| V(MathPow) \
|
| V(StoreBufferOverflow) \
|
| V(TranscendentalCache) \
|
| - V(RecordWrite) \
|
| + V(Instanceof) \
|
| V(ConvertToDouble) \
|
| V(WriteInt32ToHeapNumber) \
|
| V(IntegerMod) \
|
| @@ -60,7 +60,7 @@
|
| V(GenericUnaryOp) \
|
| V(RevertToNumber) \
|
| V(ToBoolean) \
|
| - V(Instanceof) \
|
| + V(ToNumber) \
|
| V(CounterOp) \
|
| V(ArgumentsAccess) \
|
| V(RegExpExec) \
|
| @@ -76,7 +76,8 @@
|
| V(GetProperty) \
|
| V(SetProperty) \
|
| V(InvokeBuiltin) \
|
| - V(RegExpCEntry)
|
| + V(RegExpCEntry) \
|
| + V(DirectCEntry)
|
| #else
|
| #define CODE_STUB_LIST_ARM(V)
|
| #endif
|
| @@ -86,9 +87,6 @@
|
| CODE_STUB_LIST_ALL_PLATFORMS(V) \
|
| CODE_STUB_LIST_ARM(V)
|
|
|
| -// Types of uncatchable exceptions.
|
| -enum UncatchableExceptionType { OUT_OF_MEMORY, TERMINATION };
|
| -
|
| // Mode to overwrite BinaryExpression values.
|
| enum OverwriteMode { NO_OVERWRITE, OVERWRITE_LEFT, OVERWRITE_RIGHT };
|
| enum UnaryOverwriteMode { UNARY_OVERWRITE, UNARY_NO_OVERWRITE };
|
| @@ -181,7 +179,7 @@
|
| MajorKeyBits::encode(MajorKey());
|
| }
|
|
|
| - bool AllowsStubCalls() { return MajorKey() <= RecordWrite; }
|
| + bool AllowsStubCalls() { return MajorKey() <= Instanceof; }
|
|
|
| class MajorKeyBits: public BitField<uint32_t, 0, kMajorBits> {};
|
| class MinorKeyBits: public BitField<uint32_t, kMajorBits, kMinorBits> {};
|
| @@ -262,6 +260,19 @@
|
| };
|
|
|
|
|
| +class ToNumberStub: public CodeStub {
|
| + public:
|
| + ToNumberStub() { }
|
| +
|
| + void Generate(MacroAssembler* masm);
|
| +
|
| + private:
|
| + Major MajorKey() { return ToNumber; }
|
| + int MinorKey() { return 0; }
|
| + const char* GetName() { return "ToNumberStub"; }
|
| +};
|
| +
|
| +
|
| class FastNewClosureStub : public CodeStub {
|
| public:
|
| void Generate(MacroAssembler* masm);
|
| @@ -328,22 +339,38 @@
|
| public:
|
| enum Flags {
|
| kNoFlags = 0,
|
| - kArgsInRegisters = 1 << 0
|
| + kArgsInRegisters = 1 << 0,
|
| + kCallSiteInlineCheck = 1 << 1,
|
| + kReturnTrueFalseObject = 1 << 2
|
| };
|
|
|
| - explicit InstanceofStub(Flags flags) : flags_(flags) { }
|
| + explicit InstanceofStub(Flags flags) : flags_(flags), name_(NULL) { }
|
|
|
| + static Register left();
|
| + static Register right();
|
| +
|
| void Generate(MacroAssembler* masm);
|
|
|
| private:
|
| Major MajorKey() { return Instanceof; }
|
| - int MinorKey() { return args_in_registers() ? 1 : 0; }
|
| + int MinorKey() { return static_cast<int>(flags_); }
|
|
|
| - bool args_in_registers() {
|
| + bool HasArgsInRegisters() const {
|
| return (flags_ & kArgsInRegisters) != 0;
|
| }
|
|
|
| + bool HasCallSiteInlineCheck() const {
|
| + return (flags_ & kCallSiteInlineCheck) != 0;
|
| + }
|
| +
|
| + bool ReturnTrueFalseObject() const {
|
| + return (flags_ & kReturnTrueFalseObject) != 0;
|
| + }
|
| +
|
| + const char* GetName();
|
| +
|
| Flags flags_;
|
| + char* name_;
|
| };
|
|
|
|
|
| @@ -585,8 +612,7 @@
|
| Label* throw_termination_exception,
|
| Label* throw_out_of_memory_exception,
|
| bool do_gc,
|
| - bool always_allocate_scope,
|
| - int alignment_skew = 0);
|
| + bool always_allocate_scope);
|
| void GenerateThrowTOS(MacroAssembler* masm);
|
| void GenerateThrowUncatchable(MacroAssembler* masm,
|
| UncatchableExceptionType type);
|
| @@ -708,6 +734,10 @@
|
|
|
| void Generate(MacroAssembler* masm);
|
|
|
| + static int ExtractArgcFromMinorKey(int minor_key) {
|
| + return ArgcBits::decode(minor_key);
|
| + }
|
| +
|
| private:
|
| int argc_;
|
| InLoopFlag in_loop_;
|
| @@ -739,11 +769,6 @@
|
| bool ReceiverMightBeValue() {
|
| return (flags_ & RECEIVER_MIGHT_BE_VALUE) != 0;
|
| }
|
| -
|
| - public:
|
| - static int ExtractArgcFromMinorKey(int minor_key) {
|
| - return ArgcBits::decode(minor_key);
|
| - }
|
| };
|
|
|
|
|
| @@ -903,6 +928,24 @@
|
| DISALLOW_COPY_AND_ASSIGN(StringCharAtGenerator);
|
| };
|
|
|
| +
|
| +class AllowStubCallsScope {
|
| + public:
|
| + AllowStubCallsScope(MacroAssembler* masm, bool allow)
|
| + : masm_(masm), previous_allow_(masm->allow_stub_calls()) {
|
| + masm_->set_allow_stub_calls(allow);
|
| + }
|
| + ~AllowStubCallsScope() {
|
| + masm_->set_allow_stub_calls(previous_allow_);
|
| + }
|
| +
|
| + private:
|
| + MacroAssembler* masm_;
|
| + bool previous_allow_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(AllowStubCallsScope);
|
| +};
|
| +
|
| } } // namespace v8::internal
|
|
|
| #endif // V8_CODE_STUBS_H_
|
|
|