// Copyright 2012 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:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
#ifndef V8_IC_H_
#define V8_IC_H_
ICU(LoadIC_Miss) \
ICU(KeyedLoadIC_Miss) \
ICU(CallIC_Miss) \
- ICU(KeyedCallIC_Miss) \
ICU(StoreIC_Miss) \
ICU(StoreIC_ArrayLength) \
ICU(StoreIC_Slow) \
ICU(Unreachable) \
ICU(ToBooleanIC_Miss)
//
-// IC is the base class for LoadIC, StoreIC, CallIC, KeyedLoadIC,
-// and KeyedStoreIC.
+// IC is the base class for LoadIC, StoreIC, KeyedLoadIC, and KeyedStoreIC.
//
class IC {
public:
// Compute the current IC state based on the target stub, receiver and name.
void UpdateState(Handle<Object> receiver, Handle<Object> name);
- void MarkMonomorphicPrototypeFailure() {
- state_ = MONOMORPHIC_PROTOTYPE_FAILURE;
+
+ bool IsNameCompatibleWithMonomorphicPrototypeFailure(Handle<Object> name);
+ bool TryMarkMonomorphicPrototypeFailure(Handle<Object> name) {
+ if (IsNameCompatibleWithMonomorphicPrototypeFailure(name)) {
+ state_ = MONOMORPHIC_PROTOTYPE_FAILURE;
+ return true;
+ }
+ return false;
}
+ // If the stub contains weak maps then this function adds the stub to
+ // the dependent code array of each weak map.
+ static void RegisterWeakMapDependency(Handle<Code> stub);
+
+ // This function is called when a weak map in the stub is dying,
+ // invalidates the stub by setting maps in it to undefined.
+ static void InvalidateMaps(Code* stub);
+
// Clear the inline cache to initial state.
- static void Clear(Isolate* isolate, Address address);
+ static void Clear(Isolate* isolate,
+ Address address,
+ ConstantPoolArray* constant_pool);
#ifdef DEBUG
bool IsLoadStub() const {
}
bool IsCallStub() const {
- return target()->is_call_stub() || target()->is_keyed_call_stub();
+ return target()->is_call_stub();
}
#endif
// well as smis.
// - The oddball map is only used for booleans.
static Handle<Map> TypeToMap(HeapType* type, Isolate* isolate);
- static Handle<HeapType> MapToType(Handle<Map> map);
- static Handle<HeapType> CurrentTypeOf(
- Handle<Object> object, Isolate* isolate);
+ template <class T>
+ static typename T::TypeHandle MapToType(Handle<Map> map,
+ typename T::Region* region);
+
+ static Handle<HeapType> CurrentTypeOf(Handle<Object> object,
+ Isolate* isolate);
protected:
// Get the call-site target; used for determining the state.
Address pc() const { return *pc_address_; }
Isolate* isolate() const { return isolate_; }
-#ifdef ENABLE_DEBUGGER_SUPPORT
- // Computes the address in the original code when the code running is
- // containing break points (calls to DebugBreakXXX builtins).
- Address OriginalCodeAddress() const;
-#endif
+ // Get the shared function info of the caller.
+ SharedFunctionInfo* GetSharedFunctionInfo() const;
+ // Get the code object of the caller.
+ Code* GetCode() const;
+ // Get the original (non-breakpointed) code object of the caller.
+ Code* GetOriginalCode() const;
// Set the call-site target.
void set_target(Code* code) {
- SetTargetAtAddress(address(), code);
+#ifdef VERIFY_HEAP
+ code->VerifyEmbeddedObjectsDependency();
+#endif
+ SetTargetAtAddress(address(), code, constant_pool());
target_set_ = true;
}
void TraceIC(const char* type, Handle<Object> name);
#endif
- Failure* TypeError(const char* type,
- Handle<Object> object,
- Handle<Object> key);
- Failure* ReferenceError(const char* type, Handle<String> name);
+ MaybeHandle<Object> TypeError(const char* type,
+ Handle<Object> object,
+ Handle<Object> key);
+ MaybeHandle<Object> ReferenceError(const char* type, Handle<String> name);
// Access the target code for the given IC address.
- static inline Code* GetTargetAtAddress(Address address);
- static inline void SetTargetAtAddress(Address address, Code* target);
+ static inline Code* GetTargetAtAddress(Address address,
+ ConstantPoolArray* constant_pool);
+ static inline void SetTargetAtAddress(Address address,
+ Code* target,
+ ConstantPoolArray* constant_pool);
static void PostPatching(Address address, Code* target, Code* old_target);
// Compute the handler either by compiling or by retrieving a cached version.
virtual void UpdateMegamorphicCache(HeapType* type, Name* name, Code* code);
void CopyICToMegamorphicCache(Handle<String> name);
- bool IsTransitionOfMonomorphicTarget(Handle<HeapType> type);
+ bool IsTransitionOfMonomorphicTarget(Map* source_map, Map* target_map);
void PatchCache(Handle<HeapType> type,
Handle<String> name,
Handle<Code> code);
extra_ic_state_ = state;
}
+ void TargetMaps(MapHandleList* list) {
+ FindTargetMaps();
+ for (int i = 0; i < target_maps_.length(); i++) {
+ list->Add(target_maps_.at(i));
+ }
+ }
+
+ void TargetTypes(TypeHandleList* list) {
+ FindTargetMaps();
+ for (int i = 0; i < target_maps_.length(); i++) {
+ list->Add(IC::MapToType<HeapType>(target_maps_.at(i), isolate_));
+ }
+ }
+
+ Map* FirstTargetMap() {
+ FindTargetMaps();
+ return target_maps_.length() > 0 ? *target_maps_.at(0) : NULL;
+ }
+
+ protected:
+ void UpdateTarget() {
+ target_ = handle(raw_target(), isolate_);
+ }
+
private:
- Code* raw_target() const { return GetTargetAtAddress(address()); }
+ Code* raw_target() const {
+ return GetTargetAtAddress(address(), constant_pool());
+ }
+ inline ConstantPoolArray* constant_pool() const;
+ inline ConstantPoolArray* raw_constant_pool() const;
+
+ void FindTargetMaps() {
+ if (target_maps_set_) return;
+ target_maps_set_ = true;
+ if (state_ == MONOMORPHIC) {
+ Map* map = target_->FindFirstMap();
+ if (map != NULL) target_maps_.Add(handle(map));
+ } else if (state_ != UNINITIALIZED && state_ != PREMONOMORPHIC) {
+ target_->FindAllMaps(&target_maps_);
+ }
+ }
// Frame pointer for the frame that uses (calls) the IC.
Address fp_;
Isolate* isolate_;
+ // The constant pool of the code which originally called the IC (which might
+ // be for the breakpointed copy of the original code).
+ Handle<ConstantPoolArray> raw_constant_pool_;
+
// The original code target that missed.
Handle<Code> target_;
State state_;
bool target_set_;
ExtraICState extra_ic_state_;
+ MapHandleList target_maps_;
+ bool target_maps_set_;
DISALLOW_IMPLICIT_CONSTRUCTORS(IC);
};
};
-class CallICBase: public IC {
+class CallIC: public IC {
public:
- // Returns a JSFunction or a Failure.
- MUST_USE_RESULT MaybeObject* LoadFunction(Handle<Object> object,
- Handle<String> name);
-
- protected:
- CallICBase(Code::Kind kind, Isolate* isolate)
- : IC(EXTRA_CALL_FRAME, isolate), kind_(kind) {}
+ enum CallType { METHOD, FUNCTION };
- // Compute a monomorphic stub if possible, otherwise return a null handle.
- Handle<Code> ComputeMonomorphicStub(LookupResult* lookup,
- Handle<Object> object,
- Handle<String> name);
-
- // Update the inline cache and the global stub cache based on the lookup
- // result.
- void UpdateCaches(LookupResult* lookup,
- Handle<Object> object,
- Handle<String> name);
-
- // Returns a JSFunction if the object can be called as a function, and
- // patches the stack to be ready for the call. Otherwise, it returns the
- // undefined value.
- Handle<Object> TryCallAsFunction(Handle<Object> object);
-
- void ReceiverToObjectIfRequired(Handle<Object> callee, Handle<Object> object);
-
- static void Clear(Address address, Code* target);
+ class State V8_FINAL BASE_EMBEDDED {
+ public:
+ explicit State(ExtraICState extra_ic_state);
- // Platform-specific code generation functions used by both call and
- // keyed call.
- static void GenerateMiss(MacroAssembler* masm,
- int argc,
- IC::UtilityId id,
- ExtraICState extra_state);
+ static State DefaultCallState(int argc, CallType call_type) {
+ return State(argc, call_type);
+ }
- static void GenerateNormal(MacroAssembler* masm, int argc);
+ static State MegamorphicCallState(int argc, CallType call_type) {
+ return State(argc, call_type);
+ }
- static void GenerateMonomorphicCacheProbe(MacroAssembler* masm,
- int argc,
- Code::Kind kind,
- ExtraICState extra_state);
+ InlineCacheState GetICState() const { return ::v8::internal::GENERIC; }
- virtual Handle<Code> megamorphic_stub();
- virtual Handle<Code> pre_monomorphic_stub();
+ ExtraICState GetExtraICState() const;
- Code::Kind kind_;
+ static void GenerateAheadOfTime(
+ Isolate*, void (*Generate)(Isolate*, const State&));
- friend class IC;
-};
+ int arg_count() const { return argc_; }
+ CallType call_type() const { return call_type_; }
+ bool CallAsMethod() const { return call_type_ == METHOD; }
-class CallIC: public CallICBase {
- public:
- explicit CallIC(Isolate* isolate)
- : CallICBase(Code::CALL_IC, isolate) {
- ASSERT(target()->is_call_stub());
- }
+ void Print(StringStream* stream) const;
- // Code generator routines.
- static void GenerateInitialize(MacroAssembler* masm,
- int argc,
- ExtraICState extra_state) {
- GenerateMiss(masm, argc, extra_state);
- }
+ bool operator==(const State& other_state) const {
+ return (argc_ == other_state.argc_ &&
+ call_type_ == other_state.call_type_);
+ }
- static void GenerateMiss(MacroAssembler* masm,
- int argc,
- ExtraICState extra_state) {
- CallICBase::GenerateMiss(masm, argc, IC::kCallIC_Miss, extra_state);
- }
+ bool operator!=(const State& other_state) const {
+ return !(*this == other_state);
+ }
- static void GenerateMegamorphic(MacroAssembler* masm,
- int argc,
- ExtraICState extra_ic_state);
+ private:
+ State(int argc,
+ CallType call_type)
+ : argc_(argc),
+ call_type_(call_type) {
+ }
- static void GenerateNormal(MacroAssembler* masm, int argc) {
- CallICBase::GenerateNormal(masm, argc);
- GenerateMiss(masm, argc, kNoExtraICState);
- }
- bool TryUpdateExtraICState(LookupResult* lookup, Handle<Object> object);
-};
+ class ArgcBits: public BitField<int, 0, Code::kArgumentsBits> {};
+ class CallTypeBits: public BitField<CallType, Code::kArgumentsBits, 1> {};
+ const int argc_;
+ const CallType call_type_;
+ };
-class KeyedCallIC: public CallICBase {
- public:
- explicit KeyedCallIC(Isolate* isolate)
- : CallICBase(Code::KEYED_CALL_IC, isolate) {
- ASSERT(target()->is_keyed_call_stub());
+ explicit CallIC(Isolate* isolate)
+ : IC(EXTRA_CALL_FRAME, isolate) {
}
- MUST_USE_RESULT MaybeObject* LoadFunction(Handle<Object> object,
- Handle<Object> key);
+ void HandleMiss(Handle<Object> receiver,
+ Handle<Object> function,
+ Handle<FixedArray> vector,
+ Handle<Smi> slot);
// Code generator routines.
- static void GenerateInitialize(MacroAssembler* masm, int argc) {
- GenerateMiss(masm, argc);
- }
-
- static void GenerateMiss(MacroAssembler* masm, int argc) {
- CallICBase::GenerateMiss(masm, argc, IC::kKeyedCallIC_Miss,
- kNoExtraICState);
- }
+ static Handle<Code> initialize_stub(Isolate* isolate,
+ int argc,
+ CallType call_type);
- static void GenerateMegamorphic(MacroAssembler* masm, int argc);
- static void GenerateNormal(MacroAssembler* masm, int argc);
- static void GenerateNonStrictArguments(MacroAssembler* masm, int argc);
+ static void Clear(Isolate* isolate, Address address, Code* target,
+ ConstantPoolArray* constant_pool);
};
class LoadIC: public IC {
public:
// ExtraICState bits
- class Contextual: public BitField<ContextualMode, 0, 1> {};
+ class ContextualModeBits: public BitField<ContextualMode, 0, 1> {};
STATIC_ASSERT(static_cast<int>(NOT_CONTEXTUAL) == 0);
- static ExtraICState ComputeExtraICState(ContextualMode mode) {
- return Contextual::encode(mode);
+ static ExtraICState ComputeExtraICState(ContextualMode contextual_mode) {
+ return ContextualModeBits::encode(contextual_mode);
}
static ContextualMode GetContextualMode(ExtraICState state) {
- return Contextual::decode(state);
+ return ContextualModeBits::decode(state);
}
ContextualMode contextual_mode() const {
- return Contextual::decode(extra_ic_state());
+ return ContextualModeBits::decode(extra_ic_state());
}
explicit LoadIC(FrameDepth depth, Isolate* isolate)
GenerateMiss(masm);
}
static void GenerateMiss(MacroAssembler* masm);
- static void GenerateMegamorphic(MacroAssembler* masm, ContextualMode mode);
+ static void GenerateMegamorphic(MacroAssembler* masm);
static void GenerateNormal(MacroAssembler* masm);
static void GenerateRuntimeGetProperty(MacroAssembler* masm);
- static Handle<Code> initialize_stub(Isolate* isolate, ContextualMode mode);
+ static Handle<Code> initialize_stub(Isolate* isolate,
+ ExtraICState extra_state);
- MUST_USE_RESULT MaybeObject* Load(Handle<Object> object,
- Handle<String> name);
+ MUST_USE_RESULT MaybeHandle<Object> Load(Handle<Object> object,
+ Handle<String> name);
protected:
virtual Code::Kind kind() const { return Code::LOAD_IC; }
private:
// Stub accessors.
static Handle<Code> pre_monomorphic_stub(Isolate* isolate,
- ContextualMode mode);
+ ExtraICState exstra_state);
virtual Handle<Code> pre_monomorphic_stub() {
- return pre_monomorphic_stub(isolate(), contextual_mode());
+ return pre_monomorphic_stub(isolate(), extra_ic_state());
}
Handle<Code> SimpleFieldLoad(int offset,
Representation representation =
Representation::Tagged());
- static void Clear(Isolate* isolate, Address address, Code* target);
+ static void Clear(Isolate* isolate,
+ Address address,
+ Code* target,
+ ConstantPoolArray* constant_pool);
friend class IC;
};
ASSERT(target()->is_keyed_load_stub());
}
- MUST_USE_RESULT MaybeObject* Load(Handle<Object> object,
- Handle<Object> key);
+ MUST_USE_RESULT MaybeHandle<Object> Load(Handle<Object> object,
+ Handle<Object> key);
// Code generator routines.
static void GenerateMiss(MacroAssembler* masm);
static void GenerateGeneric(MacroAssembler* masm);
static void GenerateString(MacroAssembler* masm);
static void GenerateIndexedInterceptor(MacroAssembler* masm);
- static void GenerateNonStrictArguments(MacroAssembler* masm);
+ static void GenerateSloppyArguments(MacroAssembler* masm);
// Bit mask to be tested against bit field for the cases when
// generic stub should go into slow case.
Handle<Code> indexed_interceptor_stub() {
return isolate()->builtins()->KeyedLoadIC_IndexedInterceptor();
}
- Handle<Code> non_strict_arguments_stub() {
- return isolate()->builtins()->KeyedLoadIC_NonStrictArguments();
+ Handle<Code> sloppy_arguments_stub() {
+ return isolate()->builtins()->KeyedLoadIC_SloppyArguments();
}
Handle<Code> string_stub() {
return isolate()->builtins()->KeyedLoadIC_String();
}
- static void Clear(Isolate* isolate, Address address, Code* target);
+ static void Clear(Isolate* isolate,
+ Address address,
+ Code* target,
+ ConstantPoolArray* constant_pool);
friend class IC;
};
class StoreIC: public IC {
public:
- class StrictModeState: public BitField<StrictModeFlag, 1, 1> {};
- static ExtraICState ComputeExtraICState(StrictModeFlag flag) {
+ class StrictModeState: public BitField<StrictMode, 1, 1> {};
+ static ExtraICState ComputeExtraICState(StrictMode flag) {
return StrictModeState::encode(flag);
}
-
- static StrictModeFlag GetStrictMode(ExtraICState state) {
+ static StrictMode GetStrictMode(ExtraICState state) {
return StrictModeState::decode(state);
}
ASSERT(IsStoreStub());
}
- StrictModeFlag strict_mode() const {
+ StrictMode strict_mode() const {
return StrictModeState::decode(extra_ic_state());
}
GenerateMiss(masm);
}
static void GenerateMiss(MacroAssembler* masm);
- static void GenerateMegamorphic(MacroAssembler* masm,
- ExtraICState extra_ic_state);
+ static void GenerateMegamorphic(MacroAssembler* masm);
static void GenerateNormal(MacroAssembler* masm);
static void GenerateRuntimeSetProperty(MacroAssembler* masm,
- StrictModeFlag strict_mode);
+ StrictMode strict_mode);
static Handle<Code> initialize_stub(Isolate* isolate,
- StrictModeFlag strict_mode);
+ StrictMode strict_mode);
- MUST_USE_RESULT MaybeObject* Store(
+ MUST_USE_RESULT MaybeHandle<Object> Store(
Handle<Object> object,
Handle<String> name,
Handle<Object> value,
}
static Handle<Code> pre_monomorphic_stub(Isolate* isolate,
- StrictModeFlag strict_mode);
+ StrictMode strict_mode);
// Update the inline cache and the global stub cache based on the
// lookup result.
IC::set_target(code);
}
- static void Clear(Isolate* isolate, Address address, Code* target);
+ static void Clear(Isolate* isolate,
+ Address address,
+ Code* target,
+ ConstantPoolArray* constant_pool);
friend class IC;
};
class ExtraICStateKeyedAccessStoreMode:
public BitField<KeyedAccessStoreMode, 2, 4> {}; // NOLINT
- static ExtraICState ComputeExtraICState(StrictModeFlag flag,
+ static ExtraICState ComputeExtraICState(StrictMode flag,
KeyedAccessStoreMode mode) {
return StrictModeState::encode(flag) |
ExtraICStateKeyedAccessStoreMode::encode(mode);
ASSERT(target()->is_keyed_store_stub());
}
- MUST_USE_RESULT MaybeObject* Store(Handle<Object> object,
- Handle<Object> name,
- Handle<Object> value);
+ MUST_USE_RESULT MaybeHandle<Object> Store(Handle<Object> object,
+ Handle<Object> name,
+ Handle<Object> value);
// Code generators for stub routines. Only called once at startup.
static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); }
static void GenerateMiss(MacroAssembler* masm);
static void GenerateSlow(MacroAssembler* masm);
static void GenerateRuntimeSetProperty(MacroAssembler* masm,
- StrictModeFlag strict_mode);
- static void GenerateGeneric(MacroAssembler* masm, StrictModeFlag strict_mode);
- static void GenerateNonStrictArguments(MacroAssembler* masm);
+ StrictMode strict_mode);
+ static void GenerateGeneric(MacroAssembler* masm, StrictMode strict_mode);
+ static void GenerateSloppyArguments(MacroAssembler* masm);
protected:
virtual Code::Kind kind() const { return Code::KEYED_STORE_IC; }
return pre_monomorphic_stub(isolate(), strict_mode());
}
static Handle<Code> pre_monomorphic_stub(Isolate* isolate,
- StrictModeFlag strict_mode) {
- if (strict_mode == kStrictMode) {
+ StrictMode strict_mode) {
+ if (strict_mode == STRICT) {
return isolate->builtins()->KeyedStoreIC_PreMonomorphic_Strict();
} else {
return isolate->builtins()->KeyedStoreIC_PreMonomorphic();
return isolate()->builtins()->KeyedStoreIC_Slow();
}
virtual Handle<Code> megamorphic_stub() {
- if (strict_mode() == kStrictMode) {
+ if (strict_mode() == STRICT) {
return isolate()->builtins()->KeyedStoreIC_Generic_Strict();
} else {
return isolate()->builtins()->KeyedStoreIC_Generic();
// Stub accessors.
virtual Handle<Code> generic_stub() const {
- if (strict_mode() == kStrictMode) {
+ if (strict_mode() == STRICT) {
return isolate()->builtins()->KeyedStoreIC_Generic_Strict();
} else {
return isolate()->builtins()->KeyedStoreIC_Generic();
}
}
- Handle<Code> non_strict_arguments_stub() {
- return isolate()->builtins()->KeyedStoreIC_NonStrictArguments();
+ Handle<Code> sloppy_arguments_stub() {
+ return isolate()->builtins()->KeyedStoreIC_SloppyArguments();
}
- static void Clear(Isolate* isolate, Address address, Code* target);
+ static void Clear(Isolate* isolate,
+ Address address,
+ Code* target,
+ ConstantPoolArray* constant_pool);
KeyedAccessStoreMode GetStoreMode(Handle<JSObject> receiver,
Handle<Object> key,
Handle<Object> value);
- Handle<Map> ComputeTransitionedMap(Handle<JSObject> receiver,
+ Handle<Map> ComputeTransitionedMap(Handle<Map> map,
KeyedAccessStoreMode store_mode);
friend class IC;
public:
class State V8_FINAL BASE_EMBEDDED {
public:
- explicit State(ExtraICState extra_ic_state);
+ State(Isolate* isolate, ExtraICState extra_ic_state);
- State(Token::Value op, OverwriteMode mode)
+ State(Isolate* isolate, Token::Value op, OverwriteMode mode)
: op_(op), mode_(mode), left_kind_(NONE), right_kind_(NONE),
- result_kind_(NONE) {
+ result_kind_(NONE), isolate_(isolate) {
ASSERT_LE(FIRST_TOKEN, op);
ASSERT_LE(op, LAST_TOKEN);
}
Handle<Object> right,
Handle<Object> result);
+ Isolate* isolate() const { return isolate_; }
+
private:
enum Kind { NONE, SMI, INT32, NUMBER, STRING, GENERIC };
Kind right_kind_;
Kind result_kind_;
Maybe<int> fixed_right_arg_;
+ Isolate* isolate_;
};
explicit BinaryOpIC(Isolate* isolate) : IC(EXTRA_CALL_FRAME, isolate) { }
static Builtins::JavaScript TokenToJSBuiltin(Token::Value op);
- MaybeObject* Transition(Handle<AllocationSite> allocation_site,
- Handle<Object> left,
- Handle<Object> right) V8_WARN_UNUSED_RESULT;
+ MaybeHandle<Object> Transition(Handle<AllocationSite> allocation_site,
+ Handle<Object> left,
+ Handle<Object> right) V8_WARN_UNUSED_RESULT;
};
static Code* GetRawUninitialized(Isolate* isolate, Token::Value op);
- static void Clear(Isolate* isolate, Address address, Code* target);
+ static void Clear(Isolate* isolate,
+ Address address,
+ Code* target,
+ ConstantPoolArray* constant_pool);
Token::Value op_;
public:
explicit CompareNilIC(Isolate* isolate) : IC(EXTRA_CALL_FRAME, isolate) {}
- MUST_USE_RESULT MaybeObject* CompareNil(Handle<Object> object);
+ Handle<Object> CompareNil(Handle<Object> object);
static Handle<Code> GetUninitialized();
- static void Clear(Address address, Code* target);
+ static void Clear(Address address,
+ Code* target,
+ ConstantPoolArray* constant_pool);
- static MUST_USE_RESULT MaybeObject* DoCompareNilSlow(NilValue nil,
- Handle<Object> object);
+ static Handle<Object> DoCompareNilSlow(Isolate* isolate, NilValue nil,
+ Handle<Object> object);
};
public:
explicit ToBooleanIC(Isolate* isolate) : IC(EXTRA_CALL_FRAME, isolate) { }
- MaybeObject* ToBoolean(Handle<Object> object);
+ Handle<Object> ToBoolean(Handle<Object> object);
};
enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK };
void PatchInlinedSmiCode(Address address, InlinedSmiCheck check);
-DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissFromStubFailure);
-DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_MissFromStubFailure);
-DECLARE_RUNTIME_FUNCTION(MaybeObject*, UnaryOpIC_Miss);
-DECLARE_RUNTIME_FUNCTION(MaybeObject*, StoreIC_MissFromStubFailure);
-DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedCallIC_MissFromStubFailure);
-DECLARE_RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss);
-DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_Miss);
-DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_MissWithAllocationSite);
-DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss);
-DECLARE_RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss);
+DECLARE_RUNTIME_FUNCTION(KeyedLoadIC_MissFromStubFailure);
+DECLARE_RUNTIME_FUNCTION(KeyedStoreIC_MissFromStubFailure);
+DECLARE_RUNTIME_FUNCTION(UnaryOpIC_Miss);
+DECLARE_RUNTIME_FUNCTION(StoreIC_MissFromStubFailure);
+DECLARE_RUNTIME_FUNCTION(ElementsTransitionAndStoreIC_Miss);
+DECLARE_RUNTIME_FUNCTION(BinaryOpIC_Miss);
+DECLARE_RUNTIME_FUNCTION(BinaryOpIC_MissWithAllocationSite);
+DECLARE_RUNTIME_FUNCTION(CompareNilIC_Miss);
+DECLARE_RUNTIME_FUNCTION(ToBooleanIC_Miss);
} } // namespace v8::internal