#endif
-#define DECLARE_RUNTIME_FUNCTION(Name) \
-Object* Name(int args_length, Object** args_object, Isolate* isolate)
-
#define RUNTIME_FUNCTION_RETURNS_TYPE(Type, Name) \
static INLINE(Type __RT_impl_##Name(Arguments args, Isolate* isolate)); \
Type Name(int args_length, Object** args_object, Isolate* isolate) { \
__ Push(receiver, key); // Receiver, key.
// Perform tail call to the entry.
- __ TailCallExternalReference(
- ExternalReference(IC_Utility(IC::kLoadElementWithInterceptor),
- masm->isolate()),
- 2, 1);
+ __ TailCallRuntime(Runtime::kLoadElementWithInterceptor, 2, 1);
__ bind(&slow);
PropertyAccessCompiler::TailCallBuiltin(
__ Push(r1, r2, r3);
// Call the entry.
- IC::UtilityId id = GetICState() == DEFAULT ? IC::kCallIC_Miss
- : IC::kCallIC_Customization_Miss;
-
- ExternalReference miss = ExternalReference(IC_Utility(id), masm->isolate());
- __ CallExternalReference(miss, 3);
+ Runtime::FunctionId id = GetICState() == DEFAULT
+ ? Runtime::kCallIC_Miss
+ : Runtime::kCallIC_Customization_Miss;
+ __ CallRuntime(id, 3);
// Move result to edi and exit the internal frame.
__ mov(r1, r0);
void CompareICStub::GenerateMiss(MacroAssembler* masm) {
{
// Call the runtime system in a fresh internal frame.
- ExternalReference miss =
- ExternalReference(IC_Utility(IC::kCompareIC_Miss), isolate());
-
FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
__ Push(r1, r0);
__ Push(lr, r1, r0);
__ mov(ip, Operand(Smi::FromInt(op())));
__ push(ip);
- __ CallExternalReference(miss, 3);
+ __ CallRuntime(Runtime::kCompareIC_Miss, 3);
// Compute the entry point of the rewritten stub.
__ add(r2, r0, Operand(Code::kHeaderSize - kHeapObjectTag));
// Restore registers.
if (mode == SAVE_RESULT_REGISTER) __ push(r0);
__ mov(r0, Operand::Zero()); // no arguments
- __ mov(r1, Operand(ExternalReference::debug_break(masm->isolate())));
+ __ mov(r1,
+ Operand(ExternalReference(
+ Runtime::FunctionForId(Runtime::kDebugBreak), masm->isolate())));
CEntryStub ceb(masm->isolate(), 1);
__ CallStub(&ceb);
void MacroAssembler::DebugBreak() {
mov(r0, Operand::Zero());
- mov(r1, Operand(ExternalReference(Runtime::kDebugBreak, isolate())));
+ mov(r1,
+ Operand(ExternalReference(Runtime::kHandleDebuggerStatement, isolate())));
CEntryStub ces(isolate(), 1);
DCHECK(AllowThisStubCall(&ces));
Call(ces.GetCode(), RelocInfo::DEBUGGER_STATEMENT);
// Everything is fine, call runtime.
__ Push(receiver, key);
- __ TailCallExternalReference(
- ExternalReference(IC_Utility(IC::kLoadElementWithInterceptor),
- masm->isolate()),
- 2, 1);
+ __ TailCallRuntime(Runtime::kLoadElementWithInterceptor, 2, 1);
__ Bind(&slow);
PropertyAccessCompiler::TailCallBuiltin(
__ Push(x1, x2, x3);
// Call the entry.
- IC::UtilityId id = GetICState() == DEFAULT ? IC::kCallIC_Miss
- : IC::kCallIC_Customization_Miss;
-
- ExternalReference miss = ExternalReference(IC_Utility(id), masm->isolate());
- __ CallExternalReference(miss, 3);
+ Runtime::FunctionId id = GetICState() == DEFAULT
+ ? Runtime::kCallIC_Miss
+ : Runtime::kCallIC_Customization_Miss;
+ __ CallRuntime(id, 3);
// Move result to edi and exit the internal frame.
__ Mov(x1, x0);
Register stub_entry = x11;
{
- ExternalReference miss =
- ExternalReference(IC_Utility(IC::kCompareIC_Miss), isolate());
-
FrameScope scope(masm, StackFrame::INTERNAL);
Register op = x10;
Register left = x1;
__ Push(left, right, op);
// Call the miss handler. This also pops the arguments.
- __ CallExternalReference(miss, 3);
+ __ CallRuntime(Runtime::kCompareIC_Miss, 3);
// Compute the entry point of the rewritten stub.
__ Add(stub_entry, x0, Code::kHeaderSize - kHeapObjectTag);
if (mode == SAVE_RESULT_REGISTER) __ Push(x0);
__ Mov(x0, 0); // No arguments.
- __ Mov(x1, ExternalReference::debug_break(masm->isolate()));
+ __ Mov(x1, ExternalReference(Runtime::FunctionForId(Runtime::kDebugBreak),
+ masm->isolate()));
CEntryStub stub(masm->isolate(), 1);
__ CallStub(&stub);
void MacroAssembler::DebugBreak() {
Mov(x0, 0);
- Mov(x1, ExternalReference(Runtime::kDebugBreak, isolate()));
+ Mov(x1, ExternalReference(Runtime::kHandleDebuggerStatement, isolate()));
CEntryStub ces(isolate(), 1);
DCHECK(AllowThisStubCall(&ces));
Call(ces.GetCode(), RelocInfo::DEBUGGER_STATEMENT);
}
-ExternalReference::ExternalReference(const IC_Utility& ic_utility,
- Isolate* isolate)
- : address_(Redirect(isolate, ic_utility.address())) {}
-
-
ExternalReference::ExternalReference(StatsCounter* counter)
: address_(reinterpret_cast<Address>(counter->GetInternalPointer())) {}
}
-ExternalReference ExternalReference::debug_break(Isolate* isolate) {
- return ExternalReference(Redirect(isolate, FUNCTION_ADDR(Debug_Break)));
-}
-
-
ExternalReference ExternalReference::debug_step_in_fp_address(
Isolate* isolate) {
return ExternalReference(isolate->debug()->step_in_fp_addr());
// External function
//----------------------------------------------------------------------------
-class IC_Utility;
class SCTableReference;
class Debug_Address;
ExternalReference(const Runtime::Function* f, Isolate* isolate);
- ExternalReference(const IC_Utility& ic_utility, Isolate* isolate);
-
explicit ExternalReference(StatsCounter* counter);
ExternalReference(Isolate::AddressId id, Isolate* isolate);
Address address() const { return reinterpret_cast<Address>(address_); }
- // Function Debug::Break()
- static ExternalReference debug_break(Isolate* isolate);
-
// Used to check if single stepping is enabled in generated code.
static ExternalReference debug_step_in_fp_address(Isolate* isolate);
void LoadDictionaryElementStub::InitializeDescriptor(
CodeStubDescriptor* descriptor) {
- descriptor->Initialize(FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure));
+ descriptor->Initialize(
+ FUNCTION_ADDR(Runtime_KeyedLoadIC_MissFromStubFailure));
}
void HandlerStub::InitializeDescriptor(CodeStubDescriptor* descriptor) {
if (kind() == Code::STORE_IC) {
- descriptor->Initialize(FUNCTION_ADDR(StoreIC_MissFromStubFailure));
+ descriptor->Initialize(FUNCTION_ADDR(Runtime_StoreIC_MissFromStubFailure));
} else if (kind() == Code::KEYED_LOAD_IC) {
- descriptor->Initialize(FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure));
+ descriptor->Initialize(
+ FUNCTION_ADDR(Runtime_KeyedLoadIC_MissFromStubFailure));
} else if (kind() == Code::KEYED_STORE_IC) {
- descriptor->Initialize(FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure));
+ descriptor->Initialize(
+ FUNCTION_ADDR(Runtime_KeyedStoreIC_MissFromStubFailure));
}
}
void StoreFastElementStub::InitializeDescriptor(
CodeStubDescriptor* descriptor) {
- descriptor->Initialize(FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure));
+ descriptor->Initialize(
+ FUNCTION_ADDR(Runtime_KeyedStoreIC_MissFromStubFailure));
}
void ElementsTransitionAndStoreStub::InitializeDescriptor(
CodeStubDescriptor* descriptor) {
- descriptor->Initialize(FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss));
+ descriptor->Initialize(
+ FUNCTION_ADDR(Runtime_ElementsTransitionAndStoreIC_Miss));
}
void CompareNilICStub::InitializeDescriptor(CodeStubDescriptor* descriptor) {
- descriptor->Initialize(FUNCTION_ADDR(CompareNilIC_Miss));
- descriptor->SetMissHandler(
- ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate()));
+ descriptor->Initialize(FUNCTION_ADDR(Runtime_CompareNilIC_Miss));
+ descriptor->SetMissHandler(ExternalReference(
+ Runtime::FunctionForId(Runtime::kCompareNilIC_Miss), isolate()));
}
void ToBooleanStub::InitializeDescriptor(CodeStubDescriptor* descriptor) {
- descriptor->Initialize(FUNCTION_ADDR(ToBooleanIC_Miss));
- descriptor->SetMissHandler(
- ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate()));
+ descriptor->Initialize(FUNCTION_ADDR(Runtime_ToBooleanIC_Miss));
+ descriptor->SetMissHandler(ExternalReference(
+ Runtime::FunctionForId(Runtime::kToBooleanIC_Miss), isolate()));
}
void BinaryOpICStub::InitializeDescriptor(CodeStubDescriptor* descriptor) {
- descriptor->Initialize(FUNCTION_ADDR(BinaryOpIC_Miss));
- descriptor->SetMissHandler(
- ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate()));
+ descriptor->Initialize(FUNCTION_ADDR(Runtime_BinaryOpIC_Miss));
+ descriptor->SetMissHandler(ExternalReference(
+ Runtime::FunctionForId(Runtime::kBinaryOpIC_Miss), isolate()));
}
void BinaryOpWithAllocationSiteStub::InitializeDescriptor(
CodeStubDescriptor* descriptor) {
- descriptor->Initialize(FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite));
+ descriptor->Initialize(
+ FUNCTION_ADDR(Runtime_BinaryOpIC_MissWithAllocationSite));
}
void AstGraphBuilder::VisitDebuggerStatement(DebuggerStatement* stmt) {
- Node* node = NewNode(javascript()->CallRuntime(Runtime::kDebugBreak, 0));
+ Node* node =
+ NewNode(javascript()->CallRuntime(Runtime::kHandleDebuggerStatement, 0));
PrepareFrameState(node, stmt->DebugBreakId());
environment()->MarkAllLocalsLive();
}
}
-RUNTIME_FUNCTION(Debug_Break) {
- // Get the top-most JavaScript frame.
- JavaScriptFrameIterator it(isolate);
- isolate->debug()->Break(args, it.frame());
- isolate->debug()->SetAfterBreakTarget(it.frame());
- return isolate->heap()->undefined_value();
-}
-
-
// Check the break point objects for whether one or more are actually
// triggered. This function returns a JSArray with the break point objects
// which is triggered.
#include "src/frames-inl.h"
#include "src/hashmap.h"
#include "src/liveedit.h"
+#include "src/runtime/runtime.h"
#include "src/string-stream.h"
#include "src/v8threads.h"
};
-DECLARE_RUNTIME_FUNCTION(Debug_Break);
-
-
// This scope is used to load and enter the debug context and create a new
// break state. Leaving the scope will restore the previous state.
// On failure to load, FailedToEnter returns true.
__ push(scratch); // return address
// Perform tail call to the entry.
- ExternalReference ref = ExternalReference(
- IC_Utility(IC::kLoadElementWithInterceptor), masm->isolate());
- __ TailCallExternalReference(ref, 2, 1);
+ __ TailCallRuntime(Runtime::kLoadElementWithInterceptor, 2, 1);
__ bind(&slow);
PropertyAccessCompiler::TailCallBuiltin(
__ push(edx);
// Call the entry.
- IC::UtilityId id = GetICState() == DEFAULT ? IC::kCallIC_Miss
- : IC::kCallIC_Customization_Miss;
-
- ExternalReference miss = ExternalReference(IC_Utility(id), masm->isolate());
- __ CallExternalReference(miss, 3);
+ Runtime::FunctionId id = GetICState() == DEFAULT
+ ? Runtime::kCallIC_Miss
+ : Runtime::kCallIC_Customization_Miss;
+ __ CallRuntime(id, 3);
// Move result to edi and exit the internal frame.
__ mov(edi, eax);
void CompareICStub::GenerateMiss(MacroAssembler* masm) {
{
// Call the runtime system in a fresh internal frame.
- ExternalReference miss = ExternalReference(IC_Utility(IC::kCompareIC_Miss),
- isolate());
FrameScope scope(masm, StackFrame::INTERNAL);
__ push(edx); // Preserve edx and eax.
__ push(eax);
__ push(edx); // And also use them as the arguments.
__ push(eax);
__ push(Immediate(Smi::FromInt(op())));
- __ CallExternalReference(miss, 3);
+ __ CallRuntime(Runtime::kCompareIC_Miss, 3);
// Compute the entry point of the rewritten stub.
__ lea(edi, FieldOperand(eax, Code::kHeaderSize));
__ pop(eax);
if (mode == SAVE_RESULT_REGISTER) __ push(eax);
__ Move(eax, Immediate(0)); // No arguments.
- __ mov(ebx, Immediate(ExternalReference::debug_break(masm->isolate())));
+ __ mov(ebx,
+ Immediate(ExternalReference(
+ Runtime::FunctionForId(Runtime::kDebugBreak), masm->isolate())));
CEntryStub ceb(masm->isolate(), 1);
__ CallStub(&ceb);
void MacroAssembler::DebugBreak() {
Move(eax, Immediate(0));
- mov(ebx, Immediate(ExternalReference(Runtime::kDebugBreak, isolate())));
+ mov(ebx, Immediate(ExternalReference(Runtime::kHandleDebuggerStatement,
+ isolate())));
CEntryStub ces(isolate(), 1);
call(ces.GetCode(), RelocInfo::DEBUGGER_STATEMENT);
}
static void CompileCallLoadPropertyWithInterceptor(
MacroAssembler* masm, Register receiver, Register holder, Register name,
- Handle<JSObject> holder_obj, IC::UtilityId id) {
+ Handle<JSObject> holder_obj, Runtime::FunctionId id) {
PushInterceptorArguments(masm, receiver, holder, name, holder_obj);
- __ CallExternalReference(ExternalReference(IC_Utility(id), masm->isolate()),
- NamedLoadHandlerCompiler::kInterceptorArgsLength);
+ __ CallRuntime(id, NamedLoadHandlerCompiler::kInterceptorArgsLength);
}
// The slow case calls into the runtime to complete the store without causing
// an IC miss that would otherwise cause a transition to the generic stub.
- ExternalReference ref =
- ExternalReference(IC_Utility(IC::kStoreIC_Slow), masm->isolate());
- __ TailCallExternalReference(ref, 3, 1);
+ __ TailCallRuntime(Runtime::kStoreIC_Slow, 3, 1);
}
// The slow case calls into the runtime to complete the store without causing
// an IC miss that would otherwise cause a transition to the generic stub.
- ExternalReference ref =
- ExternalReference(IC_Utility(IC::kKeyedStoreIC_Slow), masm->isolate());
- __ TailCallExternalReference(ref, 3, 1);
+ __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow, 3, 1);
}
// of this method.)
CompileCallLoadPropertyWithInterceptor(
masm(), receiver(), holder_reg, this->name(), holder(),
- IC::kLoadPropertyWithInterceptorOnly);
+ Runtime::kLoadPropertyWithInterceptorOnly);
// Check if interceptor provided a value for property. If it's
// the case, return immediately.
PushInterceptorArguments(masm(), receiver(), holder_reg, this->name(),
holder());
- ExternalReference ref = ExternalReference(
- IC_Utility(IC::kLoadPropertyWithInterceptor), isolate());
- __ TailCallExternalReference(
- ref, NamedLoadHandlerCompiler::kInterceptorArgsLength, 1);
+ __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor,
+ NamedLoadHandlerCompiler::kInterceptorArgsLength, 1);
}
__ Push(ip, value());
// Do tail-call to the runtime system.
- ExternalReference store_callback_property =
- ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate());
- __ TailCallExternalReference(store_callback_property, 5, 1);
+ __ TailCallRuntime(Runtime::kStoreCallbackProperty, 5, 1);
// Return the generated code.
return GetCode(kind(), Code::FAST, name);
__ Push(receiver(), this->name(), value());
// Do tail-call to the runtime system.
- ExternalReference store_ic_property = ExternalReference(
- IC_Utility(IC::kStorePropertyWithInterceptor), isolate());
- __ TailCallExternalReference(store_ic_property, 3, 1);
+ __ TailCallRuntime(Runtime::kStorePropertyWithInterceptor, 3, 1);
// Return the generated code.
return GetCode(kind(), Code::FAST, name);
LoadIC_PushArgs(masm);
// Perform tail call to the entry.
- ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss), isolate);
int arg_count = 4;
- __ TailCallExternalReference(ref, arg_count, 1);
+ __ TailCallRuntime(Runtime::kLoadIC_Miss, arg_count, 1);
}
LoadIC_PushArgs(masm);
// Perform tail call to the entry.
- ExternalReference ref =
- ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate);
int arg_count = 4;
- __ TailCallExternalReference(ref, arg_count, 1);
+ __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss, arg_count, 1);
}
__ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(),
StoreDescriptor::ValueRegister());
- ExternalReference ref =
- ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate());
- __ TailCallExternalReference(ref, 3, 1);
+ __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss, 3, 1);
}
StoreDescriptor::ValueRegister());
// Perform tail call to the entry.
- ExternalReference ref =
- ExternalReference(IC_Utility(kStoreIC_Miss), masm->isolate());
- __ TailCallExternalReference(ref, 3, 1);
+ __ TailCallRuntime(Runtime::kStoreIC_Miss, 3, 1);
}
static void CompileCallLoadPropertyWithInterceptor(
MacroAssembler* masm, Register receiver, Register holder, Register name,
- Handle<JSObject> holder_obj, IC::UtilityId id) {
+ Handle<JSObject> holder_obj, Runtime::FunctionId id) {
PushInterceptorArguments(masm, receiver, holder, name, holder_obj);
- __ CallExternalReference(ExternalReference(IC_Utility(id), masm->isolate()),
- NamedLoadHandlerCompiler::kInterceptorArgsLength);
+ __ CallRuntime(id, NamedLoadHandlerCompiler::kInterceptorArgsLength);
}
// The slow case calls into the runtime to complete the store without causing
// an IC miss that would otherwise cause a transition to the generic stub.
- ExternalReference ref =
- ExternalReference(IC_Utility(IC::kStoreIC_Slow), masm->isolate());
- __ TailCallExternalReference(ref, 3, 1);
+ __ TailCallRuntime(Runtime::kStoreIC_Slow, 3, 1);
}
// The slow case calls into the runtime to complete the store without causing
// an IC miss that would otherwise cause a transition to the generic stub.
- ExternalReference ref =
- ExternalReference(IC_Utility(IC::kKeyedStoreIC_Slow), masm->isolate());
- __ TailCallExternalReference(ref, 3, 1);
+ __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow, 3, 1);
}
__ Push(receiver(), this->name(), value());
// Do tail-call to the runtime system.
- ExternalReference store_ic_property = ExternalReference(
- IC_Utility(IC::kStorePropertyWithInterceptor), isolate());
- __ TailCallExternalReference(store_ic_property, 3, 1);
+ __ TailCallRuntime(Runtime::kStorePropertyWithInterceptor, 3, 1);
// Return the generated code.
return GetCode(kind(), Code::FAST, name);
// of this method.)
CompileCallLoadPropertyWithInterceptor(
masm(), receiver(), holder_reg, this->name(), holder(),
- IC::kLoadPropertyWithInterceptorOnly);
+ Runtime::kLoadPropertyWithInterceptorOnly);
// Check if interceptor provided a value for property. If it's
// the case, return immediately.
PushInterceptorArguments(masm(), receiver(), holder_reg, this->name(),
holder());
- ExternalReference ref = ExternalReference(
- IC_Utility(IC::kLoadPropertyWithInterceptor), isolate());
- __ TailCallExternalReference(
- ref, NamedLoadHandlerCompiler::kInterceptorArgsLength, 1);
+ __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor,
+ NamedLoadHandlerCompiler::kInterceptorArgsLength, 1);
}
__ Push(receiver(), holder_reg, scratch1(), scratch2(), value());
// Do tail-call to the runtime system.
- ExternalReference store_callback_property =
- ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate());
- __ TailCallExternalReference(store_callback_property, 5, 1);
+ __ TailCallRuntime(Runtime::kStoreCallbackProperty, 5, 1);
// Return the generated code.
return GetCode(kind(), Code::FAST, name);
LoadWithVectorDescriptor::NameRegister(),
LoadWithVectorDescriptor::SlotRegister(),
LoadWithVectorDescriptor::VectorRegister());
- ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss), isolate);
int arg_count = 4;
- __ TailCallExternalReference(ref, arg_count, 1);
+ __ TailCallRuntime(Runtime::kLoadIC_Miss, arg_count, 1);
}
LoadWithVectorDescriptor::VectorRegister());
// Perform tail call to the entry.
- ExternalReference ref =
- ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate);
int arg_count = 4;
- __ TailCallExternalReference(ref, arg_count, 1);
+ __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss, arg_count, 1);
}
__ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(),
StoreDescriptor::ValueRegister());
- ExternalReference ref =
- ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate());
- __ TailCallExternalReference(ref, 3, 1);
+ __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss, 3, 1);
}
StoreDescriptor::ValueRegister());
// Tail call to the entry.
- ExternalReference ref =
- ExternalReference(IC_Utility(kStoreIC_Miss), masm->isolate());
- __ TailCallExternalReference(ref, 3, 1);
+ __ TailCallRuntime(Runtime::kStoreIC_Miss, 3, 1);
}
static void CompileCallLoadPropertyWithInterceptor(
MacroAssembler* masm, Register receiver, Register holder, Register name,
- Handle<JSObject> holder_obj, IC::UtilityId id) {
+ Handle<JSObject> holder_obj, Runtime::FunctionId id) {
PushInterceptorArguments(masm, receiver, holder, name, holder_obj);
- __ CallExternalReference(ExternalReference(IC_Utility(id), masm->isolate()),
- NamedLoadHandlerCompiler::kInterceptorArgsLength);
+ __ CallRuntime(id, NamedLoadHandlerCompiler::kInterceptorArgsLength);
}
StoreIC_PushArgs(masm);
// Do tail-call to runtime routine.
- ExternalReference ref(IC_Utility(IC::kStoreIC_Slow), masm->isolate());
- __ TailCallExternalReference(ref, 3, 1);
+ __ TailCallRuntime(Runtime::kStoreIC_Slow, 3, 1);
}
StoreIC_PushArgs(masm);
// Do tail-call to runtime routine.
- ExternalReference ref(IC_Utility(IC::kKeyedStoreIC_Slow), masm->isolate());
- __ TailCallExternalReference(ref, 3, 1);
+ __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow, 3, 1);
}
// of this method.)
CompileCallLoadPropertyWithInterceptor(
masm(), receiver(), holder_reg, this->name(), holder(),
- IC::kLoadPropertyWithInterceptorOnly);
+ Runtime::kLoadPropertyWithInterceptorOnly);
// Check if interceptor provided a value for property. If it's
// the case, return immediately.
holder());
__ push(scratch2()); // restore old return address
- ExternalReference ref = ExternalReference(
- IC_Utility(IC::kLoadPropertyWithInterceptor), isolate());
- __ TailCallExternalReference(
- ref, NamedLoadHandlerCompiler::kInterceptorArgsLength, 1);
+ __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor,
+ NamedLoadHandlerCompiler::kInterceptorArgsLength, 1);
}
__ push(scratch1()); // restore return address
// Do tail-call to the runtime system.
- ExternalReference store_callback_property =
- ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate());
- __ TailCallExternalReference(store_callback_property, 5, 1);
+ __ TailCallRuntime(Runtime::kStoreCallbackProperty, 5, 1);
// Return the generated code.
return GetCode(kind(), Code::FAST, name);
__ push(scratch1()); // restore return address
// Do tail-call to the runtime system.
- ExternalReference store_ic_property = ExternalReference(
- IC_Utility(IC::kStorePropertyWithInterceptor), isolate());
- __ TailCallExternalReference(store_ic_property, 3, 1);
+ __ TailCallRuntime(Runtime::kStorePropertyWithInterceptor, 3, 1);
// Return the generated code.
return GetCode(kind(), Code::FAST, name);
LoadIC_PushArgs(masm);
// Perform tail call to the entry.
- ExternalReference ref =
- ExternalReference(IC_Utility(kLoadIC_Miss), masm->isolate());
int arg_count = 4;
- __ TailCallExternalReference(ref, arg_count, 1);
+ __ TailCallRuntime(Runtime::kLoadIC_Miss, arg_count, 1);
}
LoadIC_PushArgs(masm);
// Perform tail call to the entry.
- ExternalReference ref =
- ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate());
int arg_count = 4;
- __ TailCallExternalReference(ref, arg_count, 1);
+ __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss, arg_count, 1);
}
StoreIC_PushArgs(masm);
// Perform tail call to the entry.
- ExternalReference ref =
- ExternalReference(IC_Utility(kStoreIC_Miss), masm->isolate());
- __ TailCallExternalReference(ref, 3, 1);
+ __ TailCallRuntime(Runtime::kStoreIC_Miss, 3, 1);
}
StoreIC_PushArgs(masm);
// Do tail-call to runtime routine.
- ExternalReference ref =
- ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate());
- __ TailCallExternalReference(ref, 3, 1);
+ __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss, 3, 1);
}
//
// Used from ic-<arch>.cc.
-RUNTIME_FUNCTION(CallIC_Miss) {
+RUNTIME_FUNCTION(Runtime_CallIC_Miss) {
TimerEventScope<TimerEventIcMiss> timer(isolate);
HandleScope scope(isolate);
DCHECK(args.length() == 3);
}
-RUNTIME_FUNCTION(CallIC_Customization_Miss) {
+RUNTIME_FUNCTION(Runtime_CallIC_Customization_Miss) {
TimerEventScope<TimerEventIcMiss> timer(isolate);
HandleScope scope(isolate);
DCHECK(args.length() == 3);
// Used from ic-<arch>.cc.
-RUNTIME_FUNCTION(LoadIC_Miss) {
+RUNTIME_FUNCTION(Runtime_LoadIC_Miss) {
TimerEventScope<TimerEventIcMiss> timer(isolate);
HandleScope scope(isolate);
Handle<Object> receiver = args.at<Object>(0);
// Used from ic-<arch>.cc
-RUNTIME_FUNCTION(KeyedLoadIC_Miss) {
+RUNTIME_FUNCTION(Runtime_KeyedLoadIC_Miss) {
TimerEventScope<TimerEventIcMiss> timer(isolate);
HandleScope scope(isolate);
Handle<Object> receiver = args.at<Object>(0);
}
-RUNTIME_FUNCTION(KeyedLoadIC_MissFromStubFailure) {
+RUNTIME_FUNCTION(Runtime_KeyedLoadIC_MissFromStubFailure) {
TimerEventScope<TimerEventIcMiss> timer(isolate);
HandleScope scope(isolate);
Handle<Object> receiver = args.at<Object>(0);
// Used from ic-<arch>.cc.
-RUNTIME_FUNCTION(StoreIC_Miss) {
+RUNTIME_FUNCTION(Runtime_StoreIC_Miss) {
TimerEventScope<TimerEventIcMiss> timer(isolate);
HandleScope scope(isolate);
Handle<Object> receiver = args.at<Object>(0);
}
-RUNTIME_FUNCTION(StoreIC_MissFromStubFailure) {
+RUNTIME_FUNCTION(Runtime_StoreIC_MissFromStubFailure) {
TimerEventScope<TimerEventIcMiss> timer(isolate);
HandleScope scope(isolate);
Handle<Object> receiver = args.at<Object>(0);
// Used from ic-<arch>.cc.
-RUNTIME_FUNCTION(KeyedStoreIC_Miss) {
+RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Miss) {
TimerEventScope<TimerEventIcMiss> timer(isolate);
HandleScope scope(isolate);
Handle<Object> receiver = args.at<Object>(0);
}
-RUNTIME_FUNCTION(KeyedStoreIC_MissFromStubFailure) {
+RUNTIME_FUNCTION(Runtime_KeyedStoreIC_MissFromStubFailure) {
TimerEventScope<TimerEventIcMiss> timer(isolate);
HandleScope scope(isolate);
Handle<Object> receiver = args.at<Object>(0);
}
-RUNTIME_FUNCTION(StoreIC_Slow) {
+RUNTIME_FUNCTION(Runtime_StoreIC_Slow) {
HandleScope scope(isolate);
DCHECK(args.length() == 3);
StoreIC ic(IC::NO_EXTRA_FRAME, isolate);
}
-RUNTIME_FUNCTION(KeyedStoreIC_Slow) {
+RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Slow) {
HandleScope scope(isolate);
DCHECK(args.length() == 3);
KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate);
}
-RUNTIME_FUNCTION(ElementsTransitionAndStoreIC_Miss) {
+RUNTIME_FUNCTION(Runtime_ElementsTransitionAndStoreIC_Miss) {
TimerEventScope<TimerEventIcMiss> timer(isolate);
HandleScope scope(isolate);
DCHECK(args.length() == 4);
}
-RUNTIME_FUNCTION(BinaryOpIC_Miss) {
+RUNTIME_FUNCTION(Runtime_BinaryOpIC_Miss) {
TimerEventScope<TimerEventIcMiss> timer(isolate);
HandleScope scope(isolate);
DCHECK_EQ(2, args.length());
}
-RUNTIME_FUNCTION(BinaryOpIC_MissWithAllocationSite) {
+RUNTIME_FUNCTION(Runtime_BinaryOpIC_MissWithAllocationSite) {
TimerEventScope<TimerEventIcMiss> timer(isolate);
HandleScope scope(isolate);
DCHECK_EQ(3, args.length());
// Used from CompareICStub::GenerateMiss in code-stubs-<arch>.cc.
-RUNTIME_FUNCTION(CompareIC_Miss) {
+RUNTIME_FUNCTION(Runtime_CompareIC_Miss) {
TimerEventScope<TimerEventIcMiss> timer(isolate);
HandleScope scope(isolate);
DCHECK(args.length() == 3);
}
-RUNTIME_FUNCTION(CompareNilIC_Miss) {
+RUNTIME_FUNCTION(Runtime_CompareNilIC_Miss) {
TimerEventScope<TimerEventIcMiss> timer(isolate);
HandleScope scope(isolate);
Handle<Object> object = args.at<Object>(0);
}
-RUNTIME_FUNCTION(Unreachable) {
+RUNTIME_FUNCTION(Runtime_Unreachable) {
UNREACHABLE();
CHECK(false);
return isolate->heap()->undefined_value();
}
-RUNTIME_FUNCTION(ToBooleanIC_Miss) {
+RUNTIME_FUNCTION(Runtime_ToBooleanIC_Miss) {
TimerEventScope<TimerEventIcMiss> timer(isolate);
DCHECK(args.length() == 1);
HandleScope scope(isolate);
}
-RUNTIME_FUNCTION(StoreCallbackProperty) {
+RUNTIME_FUNCTION(Runtime_StoreCallbackProperty) {
Handle<JSObject> receiver = args.at<JSObject>(0);
Handle<JSObject> holder = args.at<JSObject>(1);
Handle<HeapObject> callback_or_cell = args.at<HeapObject>(2);
* Returns |Heap::no_interceptor_result_sentinel()| if interceptor doesn't
* provide any value for the given name.
*/
-RUNTIME_FUNCTION(LoadPropertyWithInterceptorOnly) {
+RUNTIME_FUNCTION(Runtime_LoadPropertyWithInterceptorOnly) {
DCHECK(args.length() == NamedLoadHandlerCompiler::kInterceptorArgsLength);
Handle<Name> name =
args.at<Name>(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex);
* Loads a property with an interceptor performing post interceptor
* lookup if interceptor failed.
*/
-RUNTIME_FUNCTION(LoadPropertyWithInterceptor) {
+RUNTIME_FUNCTION(Runtime_LoadPropertyWithInterceptor) {
HandleScope scope(isolate);
DCHECK(args.length() == NamedLoadHandlerCompiler::kInterceptorArgsLength);
Handle<Name> name =
}
-RUNTIME_FUNCTION(StorePropertyWithInterceptor) {
+RUNTIME_FUNCTION(Runtime_StorePropertyWithInterceptor) {
HandleScope scope(isolate);
DCHECK(args.length() == 3);
StoreIC ic(IC::NO_EXTRA_FRAME, isolate);
}
-RUNTIME_FUNCTION(LoadElementWithInterceptor) {
+RUNTIME_FUNCTION(Runtime_LoadElementWithInterceptor) {
// TODO(verwaest): This should probably get the holder and receiver as input.
HandleScope scope(isolate);
Handle<JSObject> receiver = args.at<JSObject>(0);
}
-RUNTIME_FUNCTION(LoadIC_MissFromStubFailure) {
+RUNTIME_FUNCTION(Runtime_LoadIC_MissFromStubFailure) {
TimerEventScope<TimerEventIcMiss> timer(isolate);
HandleScope scope(isolate);
Handle<Object> receiver = args.at<Object>(0);
return *result;
}
-
-
-static const Address IC_utilities[] = {
-#define ADDR(name) FUNCTION_ADDR(name),
- IC_UTIL_LIST(ADDR) NULL
-#undef ADDR
-};
-
-
-Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; }
} // namespace internal
} // namespace v8
namespace v8 {
namespace internal {
-
-// IC_UTIL_LIST defines all utility functions called from generated
-// inline caching code. The argument for the macro, ICU, is the function name.
-#define IC_UTIL_LIST(ICU) \
- ICU(LoadIC_Miss) \
- ICU(KeyedLoadIC_Miss) \
- ICU(CallIC_Miss) \
- ICU(CallIC_Customization_Miss) \
- ICU(StoreIC_Miss) \
- ICU(StoreIC_Slow) \
- ICU(KeyedStoreIC_Miss) \
- ICU(KeyedStoreIC_Slow) \
- /* Utilities for IC stubs. */ \
- ICU(StoreCallbackProperty) \
- ICU(LoadPropertyWithInterceptorOnly) \
- ICU(LoadPropertyWithInterceptor) \
- ICU(LoadElementWithInterceptor) \
- ICU(StorePropertyWithInterceptor) \
- ICU(CompareIC_Miss) \
- ICU(BinaryOpIC_Miss) \
- ICU(CompareNilIC_Miss) \
- ICU(Unreachable) \
- ICU(ToBooleanIC_Miss)
//
// IC is the base class for LoadIC, StoreIC, KeyedLoadIC, and KeyedStoreIC.
//
class IC {
public:
- // The ids for utility called from the generated code.
- enum UtilityId {
-#define CONST_NAME(name) k##name,
- IC_UTIL_LIST(CONST_NAME)
-#undef CONST_NAME
- kUtilityCount
- };
-
- // Looks up the address of the named utility.
- static Address AddressFromUtilityId(UtilityId id);
-
// Alias the inline cache state type to make the IC code more readable.
typedef InlineCacheState State;
};
-// An IC_Utility encapsulates IC::UtilityId. It exists mainly because you
-// cannot make forward declarations to an enum.
-class IC_Utility {
- public:
- explicit IC_Utility(IC::UtilityId id)
- : address_(IC::AddressFromUtilityId(id)), id_(id) {}
-
- Address address() const { return address_; }
-
- IC::UtilityId id() const { return id_; }
-
- private:
- Address address_;
- IC::UtilityId id_;
-};
-
-
class CallIC : public IC {
public:
CallIC(Isolate* isolate, CallICNexus* nexus)
enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK };
void PatchInlinedSmiCode(Address address, InlinedSmiCheck check);
-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);
-DECLARE_RUNTIME_FUNCTION(LoadIC_MissFromStubFailure);
-
-// Support functions for callbacks handlers.
-DECLARE_RUNTIME_FUNCTION(StoreCallbackProperty);
-
-// Support functions for interceptor handlers.
-DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptorOnly);
-DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptor);
-DECLARE_RUNTIME_FUNCTION(LoadElementWithInterceptor);
-DECLARE_RUNTIME_FUNCTION(StorePropertyWithInterceptor);
}
} // namespace v8::internal
static void CompileCallLoadPropertyWithInterceptor(
MacroAssembler* masm, Register receiver, Register holder, Register name,
- Handle<JSObject> holder_obj, IC::UtilityId id) {
+ Handle<JSObject> holder_obj, Runtime::FunctionId id) {
PushInterceptorArguments(masm, receiver, holder, name, holder_obj);
- __ CallExternalReference(ExternalReference(IC_Utility(id), masm->isolate()),
- NamedLoadHandlerCompiler::kInterceptorArgsLength);
+ __ CallRuntime(id, NamedLoadHandlerCompiler::kInterceptorArgsLength);
}
// The slow case calls into the runtime to complete the store without causing
// an IC miss that would otherwise cause a transition to the generic stub.
- ExternalReference ref =
- ExternalReference(IC_Utility(IC::kStoreIC_Slow), masm->isolate());
- __ TailCallExternalReference(ref, 3, 1);
+ __ TailCallRuntime(Runtime::kStoreIC_Slow, 3, 1);
}
// The slow case calls into the runtime to complete the store without causing
// an IC miss that would otherwise cause a transition to the generic stub.
- ExternalReference ref =
- ExternalReference(IC_Utility(IC::kKeyedStoreIC_Slow), masm->isolate());
- __ TailCallExternalReference(ref, 3, 1);
+ __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow, 3, 1);
}
// of this method).
CompileCallLoadPropertyWithInterceptor(
masm(), receiver(), holder_reg, this->name(), holder(),
- IC::kLoadPropertyWithInterceptorOnly);
+ Runtime::kLoadPropertyWithInterceptorOnly);
// Check if interceptor provided a value for property. If it's
// the case, return immediately.
PushInterceptorArguments(masm(), receiver(), holder_reg, this->name(),
holder());
- ExternalReference ref = ExternalReference(
- IC_Utility(IC::kLoadPropertyWithInterceptor), isolate());
- __ TailCallExternalReference(
- ref, NamedLoadHandlerCompiler::kInterceptorArgsLength, 1);
+ __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor,
+ NamedLoadHandlerCompiler::kInterceptorArgsLength, 1);
}
__ Push(at, value());
// Do tail-call to the runtime system.
- ExternalReference store_callback_property =
- ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate());
- __ TailCallExternalReference(store_callback_property, 5, 1);
+ __ TailCallRuntime(Runtime::kStoreCallbackProperty, 5, 1);
// Return the generated code.
return GetCode(kind(), Code::FAST, name);
__ Push(receiver(), this->name(), value());
// Do tail-call to the runtime system.
- ExternalReference store_ic_property = ExternalReference(
- IC_Utility(IC::kStorePropertyWithInterceptor), isolate());
- __ TailCallExternalReference(store_ic_property, 3, 1);
+ __ TailCallRuntime(Runtime::kStorePropertyWithInterceptor, 3, 1);
// Return the generated code.
return GetCode(kind(), Code::FAST, name);
LoadIC_PushArgs(masm);
// Perform tail call to the entry.
- ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss), isolate);
int arg_count = 4;
- __ TailCallExternalReference(ref, arg_count, 1);
+ __ TailCallRuntime(Runtime::kLoadIC_Miss, arg_count, 1);
}
LoadIC_PushArgs(masm);
// Perform tail call to the entry.
- ExternalReference ref =
- ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate);
-
int arg_count = 4;
- __ TailCallExternalReference(ref, arg_count, 1);
+ __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss, arg_count, 1);
}
__ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(),
StoreDescriptor::ValueRegister());
- ExternalReference ref =
- ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate());
- __ TailCallExternalReference(ref, 3, 1);
+ __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss, 3, 1);
}
__ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(),
StoreDescriptor::ValueRegister());
// Perform tail call to the entry.
- ExternalReference ref =
- ExternalReference(IC_Utility(kStoreIC_Miss), masm->isolate());
- __ TailCallExternalReference(ref, 3, 1);
+ __ TailCallRuntime(Runtime::kStoreIC_Miss, 3, 1);
}
static void CompileCallLoadPropertyWithInterceptor(
MacroAssembler* masm, Register receiver, Register holder, Register name,
- Handle<JSObject> holder_obj, IC::UtilityId id) {
+ Handle<JSObject> holder_obj, Runtime::FunctionId id) {
PushInterceptorArguments(masm, receiver, holder, name, holder_obj);
- __ CallExternalReference(ExternalReference(IC_Utility(id), masm->isolate()),
- NamedLoadHandlerCompiler::kInterceptorArgsLength);
+ __ CallRuntime(id, NamedLoadHandlerCompiler::kInterceptorArgsLength);
}
// The slow case calls into the runtime to complete the store without causing
// an IC miss that would otherwise cause a transition to the generic stub.
- ExternalReference ref =
- ExternalReference(IC_Utility(IC::kStoreIC_Slow), masm->isolate());
- __ TailCallExternalReference(ref, 3, 1);
+ __ TailCallRuntime(Runtime::kStoreIC_Slow, 3, 1);
}
// The slow case calls into the runtime to complete the store without causing
// an IC miss that would otherwise cause a transition to the generic stub.
- ExternalReference ref =
- ExternalReference(IC_Utility(IC::kKeyedStoreIC_Slow), masm->isolate());
- __ TailCallExternalReference(ref, 3, 1);
+ __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow, 3, 1);
}
// of this method).
CompileCallLoadPropertyWithInterceptor(
masm(), receiver(), holder_reg, this->name(), holder(),
- IC::kLoadPropertyWithInterceptorOnly);
+ Runtime::kLoadPropertyWithInterceptorOnly);
// Check if interceptor provided a value for property. If it's
// the case, return immediately.
PushInterceptorArguments(masm(), receiver(), holder_reg, this->name(),
holder());
- ExternalReference ref = ExternalReference(
- IC_Utility(IC::kLoadPropertyWithInterceptor), isolate());
- __ TailCallExternalReference(
- ref, NamedLoadHandlerCompiler::kInterceptorArgsLength, 1);
+ __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor,
+ NamedLoadHandlerCompiler::kInterceptorArgsLength, 1);
}
__ Push(at, value());
// Do tail-call to the runtime system.
- ExternalReference store_callback_property =
- ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate());
- __ TailCallExternalReference(store_callback_property, 5, 1);
+ __ TailCallRuntime(Runtime::kStoreCallbackProperty, 5, 1);
// Return the generated code.
return GetCode(kind(), Code::FAST, name);
__ Push(receiver(), this->name(), value());
// Do tail-call to the runtime system.
- ExternalReference store_ic_property = ExternalReference(
- IC_Utility(IC::kStorePropertyWithInterceptor), isolate());
- __ TailCallExternalReference(store_ic_property, 3, 1);
+ __ TailCallRuntime(Runtime::kStorePropertyWithInterceptor, 3, 1);
// Return the generated code.
return GetCode(kind(), Code::FAST, name);
LoadIC_PushArgs(masm);
// Perform tail call to the entry.
- ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss), isolate);
int arg_count = 4;
- __ TailCallExternalReference(ref, arg_count, 1);
+ __ TailCallRuntime(Runtime::kLoadIC_Miss, arg_count, 1);
}
LoadIC_PushArgs(masm);
// Perform tail call to the entry.
- ExternalReference ref =
- ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate);
-
int arg_count = 4;
- __ TailCallExternalReference(ref, arg_count, 1);
+ __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss, arg_count, 1);
}
__ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(),
StoreDescriptor::ValueRegister());
- ExternalReference ref =
- ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate());
- __ TailCallExternalReference(ref, 3, 1);
+ __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss, 3, 1);
}
__ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(),
StoreDescriptor::ValueRegister());
// Perform tail call to the entry.
- ExternalReference ref =
- ExternalReference(IC_Utility(kStoreIC_Miss), masm->isolate());
- __ TailCallExternalReference(ref, 3, 1);
+ __ TailCallRuntime(Runtime::kStoreIC_Miss, 3, 1);
}
static void CompileCallLoadPropertyWithInterceptor(
MacroAssembler* masm, Register receiver, Register holder, Register name,
- Handle<JSObject> holder_obj, IC::UtilityId id) {
+ Handle<JSObject> holder_obj, Runtime::FunctionId id) {
PushInterceptorArguments(masm, receiver, holder, name, holder_obj);
- __ CallExternalReference(ExternalReference(IC_Utility(id), masm->isolate()),
- NamedLoadHandlerCompiler::kInterceptorArgsLength);
+ __ CallRuntime(id, NamedLoadHandlerCompiler::kInterceptorArgsLength);
}
StoreIC_PushArgs(masm);
// Do tail-call to runtime routine.
- ExternalReference ref(IC_Utility(IC::kStoreIC_Slow), masm->isolate());
- __ TailCallExternalReference(ref, 3, 1);
+ __ TailCallRuntime(Runtime::kStoreIC_Slow, 3, 1);
}
StoreIC_PushArgs(masm);
// Do tail-call to runtime routine.
- ExternalReference ref(IC_Utility(IC::kKeyedStoreIC_Slow), masm->isolate());
- __ TailCallExternalReference(ref, 3, 1);
+ __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow, 3, 1);
}
// of this method.)
CompileCallLoadPropertyWithInterceptor(
masm(), receiver(), holder_reg, this->name(), holder(),
- IC::kLoadPropertyWithInterceptorOnly);
+ Runtime::kLoadPropertyWithInterceptorOnly);
// Check if interceptor provided a value for property. If it's
// the case, return immediately.
holder());
__ PushReturnAddressFrom(scratch2());
- ExternalReference ref = ExternalReference(
- IC_Utility(IC::kLoadPropertyWithInterceptor), isolate());
- __ TailCallExternalReference(
- ref, NamedLoadHandlerCompiler::kInterceptorArgsLength, 1);
+ __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor,
+ NamedLoadHandlerCompiler::kInterceptorArgsLength, 1);
}
__ PushReturnAddressFrom(scratch1());
// Do tail-call to the runtime system.
- ExternalReference store_callback_property =
- ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate());
- __ TailCallExternalReference(store_callback_property, 5, 1);
+ __ TailCallRuntime(Runtime::kStoreCallbackProperty, 5, 1);
// Return the generated code.
return GetCode(kind(), Code::FAST, name);
__ PushReturnAddressFrom(scratch1());
// Do tail-call to the runtime system.
- ExternalReference store_ic_property = ExternalReference(
- IC_Utility(IC::kStorePropertyWithInterceptor), isolate());
- __ TailCallExternalReference(store_ic_property, 3, 1);
+ __ TailCallRuntime(Runtime::kStorePropertyWithInterceptor, 3, 1);
// Return the generated code.
return GetCode(kind(), Code::FAST, name);
LoadIC_PushArgs(masm);
// Perform tail call to the entry.
- ExternalReference ref =
- ExternalReference(IC_Utility(kLoadIC_Miss), masm->isolate());
int arg_count = 4;
- __ TailCallExternalReference(ref, arg_count, 1);
+ __ TailCallRuntime(Runtime::kLoadIC_Miss, arg_count, 1);
}
LoadIC_PushArgs(masm);
// Perform tail call to the entry.
- ExternalReference ref =
- ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate());
int arg_count = 4;
- __ TailCallExternalReference(ref, arg_count, 1);
+ __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss, arg_count, 1);
}
StoreIC_PushArgs(masm);
// Perform tail call to the entry.
- ExternalReference ref =
- ExternalReference(IC_Utility(kStoreIC_Miss), masm->isolate());
- __ TailCallExternalReference(ref, 3, 1);
+ __ TailCallRuntime(Runtime::kStoreIC_Miss, 3, 1);
}
StoreIC_PushArgs(masm);
// Do tail-call to runtime routine.
- ExternalReference ref =
- ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate());
- __ TailCallExternalReference(ref, 3, 1);
+ __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss, 3, 1);
}
__ Push(receiver, key); // Receiver, key.
// Perform tail call to the entry.
- __ TailCallExternalReference(
- ExternalReference(IC_Utility(IC::kLoadElementWithInterceptor),
- masm->isolate()),
- 2, 1);
+ __ TailCallRuntime(Runtime::kLoadElementWithInterceptor, 2, 1);
__ bind(&slow);
PropertyAccessCompiler::TailCallBuiltin(
__ Push(a1, a2, a3);
// Call the entry.
- IC::UtilityId id = GetICState() == DEFAULT ? IC::kCallIC_Miss
- : IC::kCallIC_Customization_Miss;
-
- ExternalReference miss = ExternalReference(IC_Utility(id), masm->isolate());
- __ CallExternalReference(miss, 3);
+ Runtime::FunctionId id = GetICState() == DEFAULT
+ ? Runtime::kCallIC_Miss
+ : Runtime::kCallIC_Customization_Miss;
+ __ CallRuntime(id, 3);
// Move result to a1 and exit the internal frame.
__ mov(a1, v0);
void CompareICStub::GenerateMiss(MacroAssembler* masm) {
{
// Call the runtime system in a fresh internal frame.
- ExternalReference miss =
- ExternalReference(IC_Utility(IC::kCompareIC_Miss), isolate());
FrameScope scope(masm, StackFrame::INTERNAL);
__ Push(a1, a0);
__ Push(ra, a1, a0);
__ li(t0, Operand(Smi::FromInt(op())));
__ addiu(sp, sp, -kPointerSize);
- __ CallExternalReference(miss, 3, USE_DELAY_SLOT);
+ __ CallRuntime(Runtime::kCompareIC_Miss, 3, kDontSaveFPRegs,
+ USE_DELAY_SLOT);
__ sw(t0, MemOperand(sp)); // In the delay slot.
// Compute the entry point of the rewritten stub.
__ Addu(a2, v0, Operand(Code::kHeaderSize - kHeapObjectTag));
if (mode == SAVE_RESULT_REGISTER) __ push(v0);
__ PrepareCEntryArgs(0); // No arguments.
- __ PrepareCEntryFunction(ExternalReference::debug_break(masm->isolate()));
+ __ PrepareCEntryFunction(ExternalReference(
+ Runtime::FunctionForId(Runtime::kDebugBreak), masm->isolate()));
CEntryStub ceb(masm->isolate(), 1);
__ CallStub(&ceb);
void MacroAssembler::DebugBreak() {
PrepareCEntryArgs(0);
- PrepareCEntryFunction(ExternalReference(Runtime::kDebugBreak, isolate()));
+ PrepareCEntryFunction(
+ ExternalReference(Runtime::kHandleDebuggerStatement, isolate()));
CEntryStub ces(isolate(), 1);
DCHECK(AllowThisStubCall(&ces));
Call(ces.GetCode(), RelocInfo::DEBUGGER_STATEMENT);
}
-void MacroAssembler::CallRuntime(const Runtime::Function* f,
- int num_arguments,
- SaveFPRegsMode save_doubles) {
+void MacroAssembler::CallRuntime(const Runtime::Function* f, int num_arguments,
+ SaveFPRegsMode save_doubles,
+ BranchDelaySlot bd) {
// All parameters are on the stack. v0 has the return value after call.
// If the expected number of arguments of the runtime function is
PrepareCEntryArgs(num_arguments);
PrepareCEntryFunction(ExternalReference(f, isolate()));
CEntryStub stub(isolate(), 1, save_doubles);
- CallStub(&stub);
+ CallStub(&stub, TypeFeedbackId::None(), al, zero_reg, Operand(zero_reg), bd);
}
void CallJSExitStub(CodeStub* stub);
// Call a runtime routine.
- void CallRuntime(const Runtime::Function* f,
- int num_arguments,
- SaveFPRegsMode save_doubles = kDontSaveFPRegs);
+ void CallRuntime(const Runtime::Function* f, int num_arguments,
+ SaveFPRegsMode save_doubles = kDontSaveFPRegs,
+ BranchDelaySlot bd = PROTECT);
void CallRuntimeSaveDoubles(Runtime::FunctionId id) {
const Runtime::Function* function = Runtime::FunctionForId(id);
CallRuntime(function, function->nargs, kSaveFPRegs);
}
// Convenience function: Same as above, but takes the fid instead.
- void CallRuntime(Runtime::FunctionId id,
- int num_arguments,
- SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
- CallRuntime(Runtime::FunctionForId(id), num_arguments, save_doubles);
+ void CallRuntime(Runtime::FunctionId id, int num_arguments,
+ SaveFPRegsMode save_doubles = kDontSaveFPRegs,
+ BranchDelaySlot bd = PROTECT) {
+ CallRuntime(Runtime::FunctionForId(id), num_arguments, save_doubles, bd);
}
// Convenience function: call an external reference.
__ Push(receiver, key); // Receiver, key.
// Perform tail call to the entry.
- __ TailCallExternalReference(
- ExternalReference(IC_Utility(IC::kLoadElementWithInterceptor),
- masm->isolate()),
- 2, 1);
+ __ TailCallRuntime(Runtime::kLoadElementWithInterceptor, 2, 1);
__ bind(&slow);
PropertyAccessCompiler::TailCallBuiltin(
__ Push(a1, a2, a3);
// Call the entry.
- IC::UtilityId id = GetICState() == DEFAULT ? IC::kCallIC_Miss
- : IC::kCallIC_Customization_Miss;
-
- ExternalReference miss = ExternalReference(IC_Utility(id), masm->isolate());
- __ CallExternalReference(miss, 3);
+ Runtime::FunctionId id = GetICState() == DEFAULT
+ ? Runtime::kCallIC_Miss //
+ : Runtime::kCallIC_Customization_Miss;
+ __ CallRuntime(id, 3);
// Move result to a1 and exit the internal frame.
__ mov(a1, v0);
void CompareICStub::GenerateMiss(MacroAssembler* masm) {
{
// Call the runtime system in a fresh internal frame.
- ExternalReference miss =
- ExternalReference(IC_Utility(IC::kCompareIC_Miss), isolate());
FrameScope scope(masm, StackFrame::INTERNAL);
__ Push(a1, a0);
__ Push(ra, a1, a0);
__ li(a4, Operand(Smi::FromInt(op())));
__ daddiu(sp, sp, -kPointerSize);
- __ CallExternalReference(miss, 3, USE_DELAY_SLOT);
+ __ CallRuntime(Runtime::kCompareIC_Miss, 3, kDontSaveFPRegs,
+ USE_DELAY_SLOT);
__ sd(a4, MemOperand(sp)); // In the delay slot.
// Compute the entry point of the rewritten stub.
__ Daddu(a2, v0, Operand(Code::kHeaderSize - kHeapObjectTag));
if (mode == SAVE_RESULT_REGISTER) __ push(v0);
__ PrepareCEntryArgs(0); // No arguments.
- __ PrepareCEntryFunction(ExternalReference::debug_break(masm->isolate()));
+ __ PrepareCEntryFunction(ExternalReference(
+ Runtime::FunctionForId(Runtime::kDebugBreak), masm->isolate()));
CEntryStub ceb(masm->isolate(), 1);
__ CallStub(&ceb);
void MacroAssembler::DebugBreak() {
PrepareCEntryArgs(0);
- PrepareCEntryFunction(ExternalReference(Runtime::kDebugBreak, isolate()));
+ PrepareCEntryFunction(
+ ExternalReference(Runtime::kHandleDebuggerStatement, isolate()));
CEntryStub ces(isolate(), 1);
DCHECK(AllowThisStubCall(&ces));
Call(ces.GetCode(), RelocInfo::DEBUGGER_STATEMENT);
}
}
-void MacroAssembler::CallRuntime(const Runtime::Function* f,
- int num_arguments,
- SaveFPRegsMode save_doubles) {
+void MacroAssembler::CallRuntime(const Runtime::Function* f, int num_arguments,
+ SaveFPRegsMode save_doubles,
+ BranchDelaySlot bd) {
// All parameters are on the stack. v0 has the return value after call.
// If the expected number of arguments of the runtime function is
PrepareCEntryArgs(num_arguments);
PrepareCEntryFunction(ExternalReference(f, isolate()));
CEntryStub stub(isolate(), 1, save_doubles);
- CallStub(&stub);
+ CallStub(&stub, TypeFeedbackId::None(), al, zero_reg, Operand(zero_reg), bd);
}
void CallJSExitStub(CodeStub* stub);
// Call a runtime routine.
- void CallRuntime(const Runtime::Function* f,
- int num_arguments,
- SaveFPRegsMode save_doubles = kDontSaveFPRegs);
+ void CallRuntime(const Runtime::Function* f, int num_arguments,
+ SaveFPRegsMode save_doubles = kDontSaveFPRegs,
+ BranchDelaySlot bd = PROTECT);
void CallRuntimeSaveDoubles(Runtime::FunctionId id) {
const Runtime::Function* function = Runtime::FunctionForId(id);
CallRuntime(function, function->nargs, kSaveFPRegs);
}
// Convenience function: Same as above, but takes the fid instead.
- void CallRuntime(Runtime::FunctionId id,
- int num_arguments,
- SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
- CallRuntime(Runtime::FunctionForId(id), num_arguments, save_doubles);
+ void CallRuntime(Runtime::FunctionId id, int num_arguments,
+ SaveFPRegsMode save_doubles = kDontSaveFPRegs,
+ BranchDelaySlot bd = PROTECT) {
+ CallRuntime(Runtime::FunctionForId(id), num_arguments, save_doubles, bd);
}
// Convenience function: call an external reference.
void MacroAssembler::DebugBreak() {
li(r3, Operand::Zero());
- mov(r4, Operand(ExternalReference(Runtime::kDebugBreak, isolate())));
+ mov(r4,
+ Operand(ExternalReference(Runtime::kHandleDebuggerStatement, isolate())));
CEntryStub ces(isolate(), 1);
DCHECK(AllowThisStubCall(&ces));
Call(ces.GetCode(), RelocInfo::DEBUGGER_STATEMENT);
RUNTIME_FUNCTION(Runtime_DebugBreak) {
SealHandleScope shs(isolate);
DCHECK(args.length() == 0);
+ // Get the top-most JavaScript frame.
+ JavaScriptFrameIterator it(isolate);
+ isolate->debug()->Break(args, it.frame());
+ isolate->debug()->SetAfterBreakTarget(it.frame());
+ return isolate->heap()->undefined_value();
+}
+
+
+RUNTIME_FUNCTION(Runtime_HandleDebuggerStatement) {
+ SealHandleScope shs(isolate);
+ DCHECK(args.length() == 0);
isolate->debug()->HandleDebugBreak();
return isolate->heap()->undefined_value();
}
#define FOR_EACH_INTRINSIC_DEBUG(F) \
+ F(HandleDebuggerStatement, 0, 1) \
F(DebugBreak, 0, 1) \
F(SetDebugEventListener, 2, 1) \
F(ScheduleBreak, 0, 1) \
F(LoadLookupSlotNoReferenceError, 2, 2)
+// Most intrinsics are implemented in the runtime/ directory, but ICs are
+// implemented in ic.cc for now.
+#define FOR_EACH_INTRINSIC_IC(F) \
+ F(LoadIC_Miss, 3, 1) \
+ F(KeyedLoadIC_Miss, 3, 1) \
+ F(CallIC_Miss, 3, 1) \
+ F(CallIC_Customization_Miss, 3, 1) \
+ F(StoreIC_Miss, 3, 1) \
+ F(StoreIC_Slow, 3, 1) \
+ F(KeyedStoreIC_Miss, 3, 1) \
+ F(KeyedStoreIC_Slow, 3, 1) \
+ F(StoreCallbackProperty, 5, 1) \
+ F(LoadPropertyWithInterceptorOnly, 3, 1) \
+ F(LoadPropertyWithInterceptor, 3, 1) \
+ F(LoadElementWithInterceptor, 2, 1) \
+ F(StorePropertyWithInterceptor, 3, 1) \
+ F(CompareIC_Miss, 3, 1) \
+ F(BinaryOpIC_Miss, 2, 1) \
+ F(CompareNilIC_Miss, 1, 1) \
+ F(Unreachable, 0, 1) \
+ F(ToBooleanIC_Miss, 1, 1) \
+ F(KeyedLoadIC_MissFromStubFailure, 4, 1) \
+ F(KeyedStoreIC_MissFromStubFailure, 3, 1) \
+ F(StoreIC_MissFromStubFailure, 3, 1) \
+ F(ElementsTransitionAndStoreIC_Miss, 4, 1) \
+ F(BinaryOpIC_MissWithAllocationSite, 3, 1) \
+ F(LoadIC_MissFromStubFailure, 0, 1)
+
+
#define FOR_EACH_INTRINSIC_RETURN_OBJECT(F) \
+ FOR_EACH_INTRINSIC_IC(F) \
FOR_EACH_INTRINSIC_ARRAY(F) \
FOR_EACH_INTRINSIC_ATOMICS(F) \
FOR_EACH_INTRINSIC_CLASSES(F) \
FOR_EACH_INTRINSIC_RETURN_OBJECT(F)
+#define F(name, nargs, ressize) \
+ Object* Runtime_##name(int args_length, Object** args_object, \
+ Isolate* isolate);
+FOR_EACH_INTRINSIC_RETURN_OBJECT(F)
+#undef F
+
//---------------------------------------------------------------------------
// Runtime provides access to all C++ runtime functions.
"Heap::NewSpaceAllocationLimitAddress()");
Add(ExternalReference::new_space_allocation_top_address(isolate).address(),
"Heap::NewSpaceAllocationTopAddress()");
- Add(ExternalReference::debug_break(isolate).address(), "Debug::Break()");
Add(ExternalReference::debug_step_in_fp_address(isolate).address(),
"Debug::step_in_fp_addr()");
Add(ExternalReference::mod_two_doubles_operation(isolate).address(),
Add(ref.address(), runtime_functions[i].name);
}
- static const RefTableEntry inline_caches[] = {
-#define IC_ENTRY(name) \
- { IC::k##name, "IC::" #name } \
- ,
- IC_UTIL_LIST(IC_ENTRY)
-#undef IC_ENTRY
- };
-
- for (unsigned i = 0; i < arraysize(inline_caches); ++i) {
- ExternalReference ref(
- IC_Utility(static_cast<IC::UtilityId>(inline_caches[i].id)), isolate);
- Add(ref.address(), runtime_functions[i].name);
- }
-
// Stat counters
struct StatsRefTableEntry {
StatsCounter* (Counters::*counter)();
__ PushReturnAddressFrom(scratch);
// Perform tail call to the entry.
- __ TailCallExternalReference(
- ExternalReference(IC_Utility(IC::kLoadElementWithInterceptor),
- masm->isolate()),
- 2, 1);
+ __ TailCallRuntime(Runtime::kLoadElementWithInterceptor, 2, 1);
__ bind(&slow);
PropertyAccessCompiler::TailCallBuiltin(
__ Push(rdx);
// Call the entry.
- IC::UtilityId id = GetICState() == DEFAULT ? IC::kCallIC_Miss
- : IC::kCallIC_Customization_Miss;
-
- ExternalReference miss = ExternalReference(IC_Utility(id), masm->isolate());
- __ CallExternalReference(miss, 3);
+ Runtime::FunctionId id = GetICState() == DEFAULT
+ ? Runtime::kCallIC_Miss
+ : Runtime::kCallIC_Customization_Miss;
+ __ CallRuntime(id, 3);
// Move result to edi and exit the internal frame.
__ movp(rdi, rax);
void CompareICStub::GenerateMiss(MacroAssembler* masm) {
{
// Call the runtime system in a fresh internal frame.
- ExternalReference miss =
- ExternalReference(IC_Utility(IC::kCompareIC_Miss), isolate());
-
FrameScope scope(masm, StackFrame::INTERNAL);
__ Push(rdx);
__ Push(rax);
__ Push(rdx);
__ Push(rax);
__ Push(Smi::FromInt(op()));
- __ CallExternalReference(miss, 3);
+ __ CallRuntime(Runtime::kCompareIC_Miss, 3);
// Compute the entry point of the rewritten stub.
__ leap(rdi, FieldOperand(rax, Code::kHeaderSize));
if (mode == SAVE_RESULT_REGISTER) __ Push(rax);
__ Set(rax, 0); // No arguments (argc == 0).
- __ Move(rbx, ExternalReference::debug_break(masm->isolate()));
+ __ Move(rbx, ExternalReference(Runtime::FunctionForId(Runtime::kDebugBreak),
+ masm->isolate()));
CEntryStub ceb(masm->isolate(), 1);
__ CallStub(&ceb);
void MacroAssembler::DebugBreak() {
Set(rax, 0); // No arguments.
- LoadAddress(rbx, ExternalReference(Runtime::kDebugBreak, isolate()));
+ LoadAddress(rbx,
+ ExternalReference(Runtime::kHandleDebuggerStatement, isolate()));
CEntryStub ces(isolate(), 1);
DCHECK(AllowThisStubCall(&ces));
Call(ces.GetCode(), RelocInfo::DEBUGGER_STATEMENT);
void MacroAssembler::DebugBreak() {
Move(eax, Immediate(0));
- mov(ebx, Immediate(ExternalReference(Runtime::kDebugBreak, isolate())));
+ mov(ebx, Immediate(ExternalReference(Runtime::kHandleDebuggerStatement,
+ isolate())));
CEntryStub ces(isolate(), 1);
call(ces.GetCode(), RelocInfo::DEBUGGER_STATEMENT);
}
var d = 0;
function recurse() {
if (++d == 25135) { // A magic number just below stack overflow on ia32
- %DebugBreak();
+ %HandleDebuggerStatement();
}
recurse();
}