| Index: src/ic.h
|
| diff --git a/src/ic.h b/src/ic.h
|
| index 00470770ff479110cbcb8c201ffb4621927384ef..a6d8068b3011c495d18076fcedeee2d35e1a94e8 100644
|
| --- a/src/ic.h
|
| +++ b/src/ic.h
|
| @@ -28,7 +28,7 @@
|
| #ifndef V8_IC_H_
|
| #define V8_IC_H_
|
|
|
| -#include "assembler.h"
|
| +#include "macro-assembler.h"
|
|
|
| namespace v8 {
|
| namespace internal {
|
| @@ -53,8 +53,9 @@ namespace internal {
|
| ICU(LoadPropertyWithInterceptorForCall) \
|
| ICU(KeyedLoadPropertyWithInterceptor) \
|
| ICU(StoreInterceptorProperty) \
|
| - ICU(BinaryOp_Patch)
|
| -
|
| + ICU(BinaryOp_Patch) \
|
| + ICU(TypeRecordingBinaryOp_Patch) \
|
| + ICU(CompareIC_Miss)
|
| //
|
| // IC is the base class for LoadIC, StoreIC, CallIC, KeyedLoadIC,
|
| // and KeyedStoreIC.
|
| @@ -425,6 +426,7 @@ class StoreIC: public IC {
|
| static void GenerateMegamorphic(MacroAssembler* masm);
|
| static void GenerateArrayLength(MacroAssembler* masm);
|
| static void GenerateNormal(MacroAssembler* masm);
|
| + static void GenerateGlobalProxy(MacroAssembler* masm);
|
|
|
| // Clear the use of an inlined version.
|
| static void ClearInlinedVersion(Address address);
|
| @@ -450,6 +452,10 @@ class StoreIC: public IC {
|
| return Isolate::Current()->builtins()->builtin(
|
| Builtins::StoreIC_Initialize);
|
| }
|
| + static Code* global_proxy_stub() {
|
| + return Isolate::Current()->builtins()->builtin(
|
| + Builtins::StoreIC_GlobalProxy);
|
| + }
|
|
|
| static void Clear(Address address, Code* target);
|
|
|
| @@ -530,6 +536,7 @@ class BinaryOpIC: public IC {
|
| public:
|
|
|
| enum TypeInfo {
|
| + UNINIT_OR_SMI,
|
| DEFAULT, // Initial state. When first executed, patches to one
|
| // of the following states depending on the operands types.
|
| HEAP_NUMBERS, // Both arguments are HeapNumbers.
|
| @@ -541,8 +548,6 @@ class BinaryOpIC: public IC {
|
|
|
| void patch(Code* code);
|
|
|
| - static void Clear(Address address, Code* target);
|
| -
|
| static const char* GetName(TypeInfo type_info);
|
|
|
| static State ToState(TypeInfo type_info);
|
| @@ -550,6 +555,72 @@ class BinaryOpIC: public IC {
|
| static TypeInfo GetTypeInfo(Object* left, Object* right);
|
| };
|
|
|
| +
|
| +// Type Recording BinaryOpIC, that records the types of the inputs and outputs.
|
| +class TRBinaryOpIC: public IC {
|
| + public:
|
| +
|
| + enum TypeInfo {
|
| + UNINITIALIZED,
|
| + SMI,
|
| + INT32,
|
| + HEAP_NUMBER,
|
| + STRING, // Only used for addition operation. At least one string operand.
|
| + GENERIC
|
| + };
|
| +
|
| + explicit TRBinaryOpIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { }
|
| +
|
| + void patch(Code* code);
|
| +
|
| + static const char* GetName(TypeInfo type_info);
|
| +
|
| + static State ToState(TypeInfo type_info);
|
| +
|
| + static TypeInfo GetTypeInfo(Handle<Object> left, Handle<Object> right);
|
| +
|
| + static TypeInfo JoinTypes(TypeInfo x, TypeInfo y);
|
| +};
|
| +
|
| +
|
| +class CompareIC: public IC {
|
| + public:
|
| + enum State {
|
| + UNINITIALIZED,
|
| + SMIS,
|
| + HEAP_NUMBERS,
|
| + OBJECTS,
|
| + GENERIC
|
| + };
|
| +
|
| + CompareIC(Isolate* isolate, Token::Value op)
|
| + : IC(EXTRA_CALL_FRAME, isolate), op_(op) { }
|
| +
|
| + // Update the inline cache for the given operands.
|
| + void UpdateCaches(Handle<Object> x, Handle<Object> y);
|
| +
|
| + // Factory method for getting an uninitialized compare stub.
|
| + static Handle<Code> GetUninitialized(Token::Value op);
|
| +
|
| + // Helper function for computing the condition for a compare operation.
|
| + static Condition ComputeCondition(Token::Value op);
|
| +
|
| + // Helper function for determining the state of a compare IC.
|
| + static State ComputeState(Code* target);
|
| +
|
| + static const char* GetStateName(State state);
|
| +
|
| + private:
|
| + State TargetState(Handle<Object> x, Handle<Object> y);
|
| +
|
| + bool strict() const { return op_ == Token::EQ_STRICT; }
|
| + Condition GetCondition() const { return ComputeCondition(op_); }
|
| + State GetState() { return ComputeState(target()); }
|
| +
|
| + Token::Value op_;
|
| +};
|
| +
|
| +
|
| } } // namespace v8::internal
|
|
|
| #endif // V8_IC_H_
|
|
|