Introduce accessors on builtins instance and use them to avoid TLS access when getting builtins.

R=vitalyr@chromium.org

Review URL: http://codereview.chromium.org/6717018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7327 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
ager@chromium.org 2011-03-23 13:40:07 +00:00
parent feac1ff9dd
commit 1bdc8031fa
53 changed files with 478 additions and 522 deletions

View File

@ -443,9 +443,9 @@ void Builtins::Generate_ArrayCode(MacroAssembler* masm) {
// Jump to the generic array code if the specialized code cannot handle
// the construction.
__ bind(&generic_array_code);
Code* code = masm->isolate()->builtins()->builtin(
Builtins::ArrayCodeGeneric);
Handle<Code> array_code(code);
Handle<Code> array_code =
masm->isolate()->builtins()->ArrayCodeGeneric();
__ Jump(array_code, RelocInfo::CODE_TARGET);
}
@ -476,9 +476,8 @@ void Builtins::Generate_ArrayConstructCode(MacroAssembler* masm) {
// Jump to the generic construct code in case the specialized code cannot
// handle the construction.
__ bind(&generic_constructor);
Code* code = masm->isolate()->builtins()->builtin(
Builtins::JSConstructStubGeneric);
Handle<Code> generic_construct_stub(code);
Handle<Code> generic_construct_stub =
masm->isolate()->builtins()->JSConstructStubGeneric();
__ Jump(generic_construct_stub, RelocInfo::CODE_TARGET);
}
@ -637,8 +636,8 @@ void Builtins::Generate_JSConstructCall(MacroAssembler* masm) {
// Set expected number of arguments to zero (not changing r0).
__ mov(r2, Operand(0, RelocInfo::NONE));
__ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR);
__ Jump(Handle<Code>(masm->isolate()->builtins()->builtin(
ArgumentsAdaptorTrampoline)), RelocInfo::CODE_TARGET);
__ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(),
RelocInfo::CODE_TARGET);
}
@ -911,8 +910,8 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
// r1: constructor function
if (is_api_function) {
__ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset));
Handle<Code> code = Handle<Code>(
isolate->builtins()->builtin(Builtins::HandleApiCallConstruct));
Handle<Code> code =
masm->isolate()->builtins()->HandleApiCallConstruct();
ParameterCount expected(0);
__ InvokeCode(code, expected, expected,
RelocInfo::CODE_TARGET, CALL_FUNCTION);
@ -1046,8 +1045,8 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
// Invoke the code and pass argc as r0.
__ mov(r0, Operand(r3));
if (is_construct) {
__ Call(Handle<Code>(masm->isolate()->builtins()->builtin(
Builtins::JSConstructCall)), RelocInfo::CODE_TARGET);
__ Call(masm->isolate()->builtins()->JSConstructCall(),
RelocInfo::CODE_TARGET);
} else {
ParameterCount actual(r0);
__ InvokeFunction(r1, actual, CALL_FUNCTION);
@ -1339,8 +1338,8 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
// Expected number of arguments is 0 for CALL_NON_FUNCTION.
__ mov(r2, Operand(0, RelocInfo::NONE));
__ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION);
__ Jump(Handle<Code>(masm->isolate()->builtins()->builtin(
ArgumentsAdaptorTrampoline)), RelocInfo::CODE_TARGET);
__ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(),
RelocInfo::CODE_TARGET);
__ bind(&function);
}
@ -1355,8 +1354,9 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
__ mov(r2, Operand(r2, ASR, kSmiTagSize));
__ ldr(r3, FieldMemOperand(r1, JSFunction::kCodeEntryOffset));
__ cmp(r2, r0); // Check formal and actual parameter counts.
__ Jump(Handle<Code>(masm->isolate()->builtins()->builtin(
ArgumentsAdaptorTrampoline)), RelocInfo::CODE_TARGET, ne);
__ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(),
RelocInfo::CODE_TARGET,
ne);
ParameterCount expected(0);
__ InvokeCode(r3, expected, expected, JUMP_FUNCTION);

View File

@ -4496,11 +4496,11 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
// r3: argc
// r4: argv
if (is_construct) {
ExternalReference construct_entry(Builtins::JSConstructEntryTrampoline,
ExternalReference construct_entry(Builtins::kJSConstructEntryTrampoline,
isolate);
__ mov(ip, Operand(construct_entry));
} else {
ExternalReference entry(Builtins::JSEntryTrampoline, isolate);
ExternalReference entry(Builtins::kJSEntryTrampoline, isolate);
__ mov(ip, Operand(entry));
}
__ ldr(ip, MemOperand(ip)); // deref address
@ -5399,8 +5399,7 @@ void CallFunctionStub::Generate(MacroAssembler* masm) {
__ mov(r0, Operand(argc_)); // Setup the number of arguments.
__ mov(r2, Operand(0, RelocInfo::NONE));
__ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION);
__ Jump(Handle<Code>(Isolate::Current()->builtins()->builtin(
Builtins::ArgumentsAdaptorTrampoline)),
__ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(),
RelocInfo::CODE_TARGET);
}

View File

@ -1787,7 +1787,7 @@ void CodeGenerator::CallApplyLazy(Expression* applicand,
__ CompareObjectType(r0, r1, r2, JS_FUNCTION_TYPE);
__ b(ne, &build_args);
Handle<Code> apply_code(
Isolate::Current()->builtins()->builtin(Builtins::FunctionApply));
Isolate::Current()->builtins()->builtin(Builtins::kFunctionApply));
__ ldr(r1, FieldMemOperand(r0, JSFunction::kCodeEntryOffset));
__ sub(r1, r1, Operand(Code::kHeaderSize - kHeapObjectTag));
__ cmp(r1, Operand(apply_code));
@ -3632,7 +3632,7 @@ void CodeGenerator::VisitObjectLiteral(ObjectLiteral* node) {
case ObjectLiteral::Property::COMPUTED:
if (key->handle()->IsSymbol()) {
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
Builtins::StoreIC_Initialize));
Builtins::kStoreIC_Initialize));
Load(value);
if (property->emit_store()) {
frame_->PopToR0();
@ -4461,7 +4461,7 @@ void CodeGenerator::VisitCallNew(CallNew* node) {
// constructor invocation.
CodeForSourcePosition(node->position());
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
Builtins::JSConstructCall));
Builtins::kJSConstructCall));
frame_->CallCodeObject(ic, RelocInfo::CONSTRUCT_CALL, arg_count + 1);
frame_->EmitPush(r0);
@ -6601,7 +6601,7 @@ void DeferredReferenceGetNamedValue::Generate() {
// The rest of the instructions in the deferred code must be together.
{ Assembler::BlockConstPoolScope block_const_pool(masm_);
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
Builtins::LoadIC_Initialize));
Builtins::kLoadIC_Initialize));
RelocInfo::Mode mode = is_contextual_
? RelocInfo::CODE_TARGET_CONTEXT
: RelocInfo::CODE_TARGET;
@ -6678,7 +6678,7 @@ void DeferredReferenceGetKeyedValue::Generate() {
{ Assembler::BlockConstPoolScope block_const_pool(masm_);
// Call keyed load IC. It has the arguments key and receiver in r0 and r1.
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
Builtins::KeyedLoadIC_Initialize));
Builtins::kKeyedLoadIC_Initialize));
__ Call(ic, RelocInfo::CODE_TARGET);
// The call must be followed by a nop instruction to indicate that the
// keyed load has been inlined.
@ -6742,8 +6742,9 @@ void DeferredReferenceSetKeyedValue::Generate() {
// Call keyed store IC. It has the arguments value, key and receiver in r0,
// r1 and r2.
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
(strict_mode_ == kStrictMode) ? Builtins::KeyedStoreIC_Initialize_Strict
: Builtins::KeyedStoreIC_Initialize));
(strict_mode_ == kStrictMode)
? Builtins::kKeyedStoreIC_Initialize_Strict
: Builtins::kKeyedStoreIC_Initialize));
__ Call(ic, RelocInfo::CODE_TARGET);
// The call must be followed by a nop instruction to indicate that the
// keyed store has been inlined.
@ -6797,8 +6798,8 @@ void DeferredReferenceSetNamedValue::Generate() {
// Call keyed store IC. It has the arguments value, key and receiver in r0,
// r1 and r2.
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
(strict_mode_ == kStrictMode) ? Builtins::StoreIC_Initialize_Strict
: Builtins::StoreIC_Initialize));
(strict_mode_ == kStrictMode) ? Builtins::kStoreIC_Initialize_Strict
: Builtins::kStoreIC_Initialize));
__ Call(ic, RelocInfo::CODE_TARGET);
// The call must be followed by a nop instruction to indicate that the
// named store has been inlined.

View File

@ -106,7 +106,7 @@ void Deoptimizer::DeoptimizeFunction(JSFunction* function) {
// Add the deoptimizing code to the list.
DeoptimizingCodeListNode* node = new DeoptimizingCodeListNode(code);
DeoptimizerData* data = Isolate::Current()->deoptimizer_data();
DeoptimizerData* data = code->GetIsolate()->deoptimizer_data();
node->set_next(data->deoptimizing_code_list_);
data->deoptimizing_code_list_ = node;
@ -316,8 +316,7 @@ void Deoptimizer::DoComputeOsrOutputFrame() {
optimized_code_->entry() + pc_offset);
output_[0]->SetPc(pc);
}
Code* continuation = Isolate::Current()->builtins()->builtin(
Builtins::NotifyOSR);
Code* continuation = isolate_->builtins()->builtin(Builtins::kNotifyOSR);
output_[0]->SetContinuation(
reinterpret_cast<uint32_t>(continuation->entry()));
@ -496,8 +495,8 @@ void Deoptimizer::DoComputeFrame(TranslationIterator* iterator,
if (is_topmost) {
Builtins* builtins = isolate_->builtins();
Code* continuation = (bailout_type_ == EAGER)
? builtins->builtin(Builtins::NotifyDeoptimized)
: builtins->builtin(Builtins::NotifyLazyDeoptimized);
? builtins->builtin(Builtins::kNotifyDeoptimized)
: builtins->builtin(Builtins::kNotifyLazyDeoptimized);
output_frame->SetContinuation(
reinterpret_cast<uint32_t>(continuation->entry()));
}

View File

@ -781,9 +781,9 @@ void FullCodeGenerator::EmitDeclaration(Variable* variable,
prop->key()->AsLiteral()->handle()->IsSmi());
__ mov(r1, Operand(prop->key()->AsLiteral()->handle()));
Handle<Code> ic(isolate()->builtins()->builtin(is_strict_mode()
? Builtins::KeyedStoreIC_Initialize_Strict
: Builtins::KeyedStoreIC_Initialize));
Handle<Code> ic = is_strict_mode()
? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
: isolate()->builtins()->KeyedStoreIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
// Value in r0 is ignored (declarations are statements).
}
@ -1186,8 +1186,8 @@ void FullCodeGenerator::EmitDynamicLoadFromSlotFastCase(
ContextSlotOperandCheckExtensions(obj_proxy->var()->AsSlot(),
slow));
__ mov(r0, Operand(key_literal->handle()));
Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::KeyedLoadIC_Initialize));
Handle<Code> ic =
isolate()->builtins()->KeyedLoadIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
__ jmp(done);
}
@ -1253,8 +1253,7 @@ void FullCodeGenerator::EmitLoadGlobalSlotCheckExtensions(
RelocInfo::Mode mode = (typeof_state == INSIDE_TYPEOF)
? RelocInfo::CODE_TARGET
: RelocInfo::CODE_TARGET_CONTEXT;
Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::LoadIC_Initialize));
Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize();
EmitCallIC(ic, mode);
}
@ -1272,8 +1271,7 @@ void FullCodeGenerator::EmitVariableLoad(Variable* var) {
// object (receiver) in r0.
__ ldr(r0, GlobalObjectOperand());
__ mov(r2, Operand(var->name()));
Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::LoadIC_Initialize));
Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET_CONTEXT);
context()->Plug(r0);
@ -1332,8 +1330,7 @@ void FullCodeGenerator::EmitVariableLoad(Variable* var) {
__ mov(r0, Operand(key_literal->handle()));
// Call keyed load IC. It has arguments key and receiver in r0 and r1.
Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::KeyedLoadIC_Initialize));
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
context()->Plug(r0);
}
@ -1442,8 +1439,7 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
VisitForAccumulatorValue(value);
__ mov(r2, Operand(key->handle()));
__ ldr(r1, MemOperand(sp));
Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::StoreIC_Initialize));
Handle<Code> ic = isolate()->builtins()->StoreIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
PrepareForBailoutForId(key->id(), NO_REGISTERS);
} else {
@ -1698,8 +1694,7 @@ void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
Literal* key = prop->key()->AsLiteral();
__ mov(r2, Operand(key->handle()));
// Call load IC. It has arguments receiver and property name r0 and r2.
Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::LoadIC_Initialize));
Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
}
@ -1707,8 +1702,7 @@ void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
SetSourcePosition(prop->position());
// Call keyed load IC. It has arguments key and receiver in r0 and r1.
Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::KeyedLoadIC_Initialize));
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
}
@ -1853,9 +1847,9 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, int bailout_ast_id) {
__ mov(r1, r0);
__ pop(r0); // Restore value.
__ mov(r2, Operand(prop->key()->AsLiteral()->handle()));
Handle<Code> ic(isolate()->builtins()->builtin(
is_strict_mode() ? Builtins::StoreIC_Initialize_Strict
: Builtins::StoreIC_Initialize));
Handle<Code> ic = is_strict_mode()
? isolate()->builtins()->StoreIC_Initialize_Strict()
: isolate()->builtins()->StoreIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
break;
}
@ -1876,9 +1870,9 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, int bailout_ast_id) {
__ pop(r2);
}
__ pop(r0); // Restore value.
Handle<Code> ic(isolate()->builtins()->builtin(
is_strict_mode() ? Builtins::KeyedStoreIC_Initialize_Strict
: Builtins::KeyedStoreIC_Initialize));
Handle<Code> ic = is_strict_mode()
? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
: isolate()->builtins()->KeyedStoreIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
break;
}
@ -1902,9 +1896,9 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var,
// r2, and the global object in r1.
__ mov(r2, Operand(var->name()));
__ ldr(r1, GlobalObjectOperand());
Handle<Code> ic(isolate()->builtins()->builtin(
is_strict_mode() ? Builtins::StoreIC_Initialize_Strict
: Builtins::StoreIC_Initialize));
Handle<Code> ic = is_strict_mode()
? isolate()->builtins()->StoreIC_Initialize_Strict()
: isolate()->builtins()->StoreIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET_CONTEXT);
} else if (op == Token::INIT_CONST) {
@ -2011,9 +2005,9 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
__ pop(r1);
}
Handle<Code> ic(isolate()->builtins()->builtin(
is_strict_mode() ? Builtins::StoreIC_Initialize_Strict
: Builtins::StoreIC_Initialize));
Handle<Code> ic = is_strict_mode()
? isolate()->builtins()->StoreIC_Initialize_Strict()
: isolate()->builtins()->StoreIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
// If the assignment ends an initialization block, revert to fast case.
@ -2057,9 +2051,9 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
__ pop(r2);
}
Handle<Code> ic(isolate()->builtins()->builtin(
is_strict_mode() ? Builtins::KeyedStoreIC_Initialize_Strict
: Builtins::KeyedStoreIC_Initialize));
Handle<Code> ic = is_strict_mode()
? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
: isolate()->builtins()->KeyedStoreIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
// If the assignment ends an initialization block, revert to fast case.
@ -2344,8 +2338,7 @@ void FullCodeGenerator::VisitCall(Call* expr) {
// Record source code position for IC call.
SetSourcePosition(prop->position());
Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::KeyedLoadIC_Initialize));
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
__ ldr(r1, GlobalObjectOperand());
__ ldr(r1, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset));
@ -2413,8 +2406,8 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
__ mov(r0, Operand(arg_count));
__ ldr(r1, MemOperand(sp, arg_count * kPointerSize));
Handle<Code> construct_builtin(isolate()->builtins()->builtin(
Builtins::JSConstructCall));
Handle<Code> construct_builtin =
isolate()->builtins()->JSConstructCall();
__ Call(construct_builtin, RelocInfo::CONSTRUCT_CALL);
context()->Plug(r0);
}
@ -3914,9 +3907,9 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
case NAMED_PROPERTY: {
__ mov(r2, Operand(prop->key()->AsLiteral()->handle()));
__ pop(r1);
Handle<Code> ic(isolate()->builtins()->builtin(
is_strict_mode() ? Builtins::StoreIC_Initialize_Strict
: Builtins::StoreIC_Initialize));
Handle<Code> ic = is_strict_mode()
? isolate()->builtins()->StoreIC_Initialize_Strict()
: isolate()->builtins()->StoreIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
if (expr->is_postfix()) {
@ -3931,9 +3924,9 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
case KEYED_PROPERTY: {
__ pop(r1); // Key.
__ pop(r2); // Receiver.
Handle<Code> ic(isolate()->builtins()->builtin(
is_strict_mode() ? Builtins::KeyedStoreIC_Initialize_Strict
: Builtins::KeyedStoreIC_Initialize));
Handle<Code> ic = is_strict_mode()
? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
: isolate()->builtins()->KeyedStoreIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
if (expr->is_postfix()) {
@ -3957,8 +3950,7 @@ void FullCodeGenerator::VisitForTypeofValue(Expression* expr) {
Comment cmnt(masm_, "Global variable");
__ ldr(r0, GlobalObjectOperand());
__ mov(r2, Operand(proxy->name()));
Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::LoadIC_Initialize));
Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize();
// Use a regular load, not a contextual load, to avoid a reference
// error.
EmitCallIC(ic, RelocInfo::CODE_TARGET);

View File

@ -2209,8 +2209,7 @@ void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
// Name is always in r2.
__ mov(r2, Operand(instr->name()));
Handle<Code> ic(
isolate()->builtins()->builtin(Builtins::LoadIC_Initialize));
Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
@ -2341,8 +2340,7 @@ void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
ASSERT(ToRegister(instr->object()).is(r1));
ASSERT(ToRegister(instr->key()).is(r0));
Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::KeyedLoadIC_Initialize));
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
@ -2908,8 +2906,7 @@ void LCodeGen::DoCallNew(LCallNew* instr) {
ASSERT(ToRegister(instr->InputAt(0)).is(r1));
ASSERT(ToRegister(instr->result()).is(r0));
Handle<Code> builtin(isolate()->builtins()->builtin(
Builtins::JSConstructCall));
Handle<Code> builtin = isolate()->builtins()->JSConstructCall();
__ mov(r0, Operand(instr->arity()));
CallCode(builtin, RelocInfo::CONSTRUCT_CALL, instr);
}
@ -2958,9 +2955,9 @@ void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
// Name is always in r2.
__ mov(r2, Operand(instr->name()));
Handle<Code> ic(isolate()->builtins()->builtin(
info_->is_strict() ? Builtins::StoreIC_Initialize_Strict
: Builtins::StoreIC_Initialize));
Handle<Code> ic = info_->is_strict()
? isolate()->builtins()->StoreIC_Initialize_Strict()
: isolate()->builtins()->StoreIC_Initialize();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
@ -3013,9 +3010,9 @@ void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
ASSERT(ToRegister(instr->key()).is(r1));
ASSERT(ToRegister(instr->value()).is(r0));
Handle<Code> ic(isolate()->builtins()->builtin(
info_->is_strict() ? Builtins::KeyedStoreIC_Initialize_Strict
: Builtins::KeyedStoreIC_Initialize));
Handle<Code> ic = info_->is_strict()
? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
: isolate()->builtins()->KeyedStoreIC_Initialize();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}

View File

@ -903,8 +903,7 @@ void MacroAssembler::InvokePrologue(const ParameterCount& expected,
}
Handle<Code> adaptor =
Handle<Code>(Isolate::Current()->builtins()->builtin(
Builtins::ArgumentsAdaptorTrampoline));
isolate()->builtins()->ArgumentsAdaptorTrampoline();
if (flag == CALL_FUNCTION) {
if (call_wrapper != NULL) {
call_wrapper->BeforeCall(CallSize(adaptor, RelocInfo::CODE_TARGET));

View File

@ -211,7 +211,7 @@ void StubCache::GenerateProbe(MacroAssembler* masm,
Register scratch,
Register extra,
Register extra2) {
Isolate* isolate = Isolate::Current();
Isolate* isolate = masm->isolate();
Label miss;
// Make sure that code is valid. The shifting code relies on the
@ -289,14 +289,15 @@ void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm,
void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype(
MacroAssembler* masm, int index, Register prototype, Label* miss) {
Isolate* isolate = masm->isolate();
// Check we're still in the same context.
__ ldr(prototype, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX)));
__ Move(ip, Isolate::Current()->global());
__ Move(ip, isolate->global());
__ cmp(prototype, ip);
__ b(ne, miss);
// Get the global function with the given index.
JSFunction* function = JSFunction::cast(
Isolate::Current()->global_context()->get(index));
JSFunction* function =
JSFunction::cast(isolate->global_context()->get(index));
// Load its initial map. The global functions all have initial maps.
__ Move(prototype, Handle<Map>(function->initial_map()));
// Load the prototype from the initial map.
@ -511,9 +512,9 @@ void StubCompiler::GenerateLoadMiss(MacroAssembler* masm, Code::Kind kind) {
ASSERT(kind == Code::LOAD_IC || kind == Code::KEYED_LOAD_IC);
Code* code = NULL;
if (kind == Code::LOAD_IC) {
code = Isolate::Current()->builtins()->builtin(Builtins::LoadIC_Miss);
code = masm->isolate()->builtins()->builtin(Builtins::kLoadIC_Miss);
} else {
code = Isolate::Current()->builtins()->builtin(Builtins::KeyedLoadIC_Miss);
code = masm->isolate()->builtins()->builtin(Builtins::kKeyedLoadIC_Miss);
}
Handle<Code> ic(code);
@ -952,7 +953,7 @@ static void StoreIntAsFloat(MacroAssembler* masm,
Register fval,
Register scratch1,
Register scratch2) {
if (Isolate::Current()->cpu_features()->IsSupported(VFP3)) {
if (masm->isolate()->cpu_features()->IsSupported(VFP3)) {
CpuFeatures::Scope scope(VFP3);
__ vmov(s0, ival);
__ add(scratch1, dst, Operand(wordoffset, LSL, 2));
@ -1164,7 +1165,7 @@ Register StubCompiler::CheckPrototypes(JSObject* object,
__ b(ne, miss);
// Log the check depth.
LOG(Isolate::Current(), IntEvent("check-maps-depth", depth + 1));
LOG(masm()->isolate(), IntEvent("check-maps-depth", depth + 1));
// Perform security check for access to the global object.
ASSERT(holder->IsJSGlobalProxy() || !holder->IsAccessCheckNeeded());
@ -1500,7 +1501,7 @@ void CallStubCompiler::GenerateLoadFunctionFromCell(JSGlobalPropertyCell* cell,
MaybeObject* CallStubCompiler::GenerateMissBranch() {
MaybeObject* maybe_obj = Isolate::Current()->stub_cache()->ComputeCallMiss(
MaybeObject* maybe_obj = masm()->isolate()->stub_cache()->ComputeCallMiss(
arguments().immediate(), kind_);
Object* obj;
if (!maybe_obj->ToObject(&obj)) return maybe_obj;
@ -2047,7 +2048,7 @@ MaybeObject* CallStubCompiler::CompileMathFloorCall(Object* object,
// -- sp[argc * 4] : receiver
// -----------------------------------
if (!Isolate::Current()->cpu_features()->IsSupported(VFP3))
if (!masm()->isolate()->cpu_features()->IsSupported(VFP3))
return HEAP->undefined_value();
CpuFeatures::Scope scope_vfp3(VFP3);
@ -2612,8 +2613,7 @@ MaybeObject* StoreStubCompiler::CompileStoreField(JSObject* object,
r1, r2, r3,
&miss);
__ bind(&miss);
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
Builtins::StoreIC_Miss));
Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss();
__ Jump(ic, RelocInfo::CODE_TARGET);
// Return the generated code.
@ -2662,8 +2662,7 @@ MaybeObject* StoreStubCompiler::CompileStoreCallback(JSObject* object,
// Handle store cache miss.
__ bind(&miss);
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
Builtins::StoreIC_Miss));
Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss();
__ Jump(ic, RelocInfo::CODE_TARGET);
// Return the generated code.
@ -2712,8 +2711,7 @@ MaybeObject* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver,
// Handle store cache miss.
__ bind(&miss);
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
Builtins::StoreIC_Miss));
Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss();
__ Jump(ic, RelocInfo::CODE_TARGET);
// Return the generated code.
@ -2757,8 +2755,7 @@ MaybeObject* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object,
// Handle store cache miss.
__ bind(&miss);
__ IncrementCounter(counters->named_store_global_inline_miss(), 1, r4, r3);
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
Builtins::StoreIC_Miss));
Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss();
__ Jump(ic, RelocInfo::CODE_TARGET);
// Return the generated code.
@ -3211,9 +3208,7 @@ MaybeObject* KeyedStoreStubCompiler::CompileStoreField(JSObject* object,
__ bind(&miss);
__ DecrementCounter(counters->keyed_store_field(), 1, r3, r4);
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
Builtins::KeyedStoreIC_Miss));
Handle<Code> ic = masm()->isolate()->builtins()->KeyedStoreIC_Miss();
__ Jump(ic, RelocInfo::CODE_TARGET);
// Return the generated code.
@ -3283,8 +3278,7 @@ MaybeObject* KeyedStoreStubCompiler::CompileStoreSpecialized(
__ Ret();
__ bind(&miss);
Handle<Code> ic(
Isolate::Current()->builtins()->builtin(Builtins::KeyedStoreIC_Miss));
Handle<Code> ic = masm()->isolate()->builtins()->KeyedStoreIC_Miss();
__ Jump(ic, RelocInfo::CODE_TARGET);
// Return the generated code.
@ -3428,10 +3422,8 @@ MaybeObject* ConstructStubCompiler::CompileConstructStub(JSFunction* function) {
// Jump to the generic stub in case the specialized code cannot handle the
// construction.
__ bind(&generic_stub_call);
Code* code = Isolate::Current()->builtins()->builtin(
Builtins::JSConstructStubGeneric);
Handle<Code> generic_construct_stub(code);
__ Jump(generic_construct_stub, RelocInfo::CODE_TARGET);
Handle<Code> code = masm()->isolate()->builtins()->JSConstructStubGeneric();
__ Jump(code, RelocInfo::CODE_TARGET);
// Return the generated code.
return GetCode();
@ -3518,7 +3510,7 @@ MaybeObject* ExternalArrayStubCompiler::CompileKeyedLoadStub(
__ ldr(value, MemOperand(r3, key, LSL, 1));
break;
case kExternalFloatArray:
if (Isolate::Current()->cpu_features()->IsSupported(VFP3)) {
if (masm()->isolate()->cpu_features()->IsSupported(VFP3)) {
CpuFeatures::Scope scope(VFP3);
__ add(r2, r3, Operand(key, LSL, 1));
__ vldr(s0, r2, 0);
@ -3557,7 +3549,7 @@ MaybeObject* ExternalArrayStubCompiler::CompileKeyedLoadStub(
// Now we can use r0 for the result as key is not needed any more.
__ mov(r0, r5);
if (Isolate::Current()->cpu_features()->IsSupported(VFP3)) {
if (masm()->isolate()->cpu_features()->IsSupported(VFP3)) {
CpuFeatures::Scope scope(VFP3);
__ vmov(s0, value);
__ vcvt_f64_s32(d0, s0);
@ -3572,7 +3564,7 @@ MaybeObject* ExternalArrayStubCompiler::CompileKeyedLoadStub(
// The test is different for unsigned int values. Since we need
// the value to be in the range of a positive smi, we can't
// handle either of the top two bits being set in the value.
if (Isolate::Current()->cpu_features()->IsSupported(VFP3)) {
if (masm()->isolate()->cpu_features()->IsSupported(VFP3)) {
CpuFeatures::Scope scope(VFP3);
Label box_int, done;
__ tst(value, Operand(0xC0000000));
@ -3636,7 +3628,7 @@ MaybeObject* ExternalArrayStubCompiler::CompileKeyedLoadStub(
} else if (array_type == kExternalFloatArray) {
// For the floating-point array type, we need to always allocate a
// HeapNumber.
if (Isolate::Current()->cpu_features()->IsSupported(VFP3)) {
if (masm()->isolate()->cpu_features()->IsSupported(VFP3)) {
CpuFeatures::Scope scope(VFP3);
// Allocate a HeapNumber for the result. Don't use r0 and r1 as
// AllocateHeapNumber clobbers all registers - also when jumping due to
@ -3829,10 +3821,9 @@ MaybeObject* ExternalArrayStubCompiler::CompileKeyedStoreStub(
// The WebGL specification leaves the behavior of storing NaN and
// +/-Infinity into integer arrays basically undefined. For more
// reproducible behavior, convert these to zero.
if (Isolate::Current()->cpu_features()->IsSupported(VFP3)) {
if (masm()->isolate()->cpu_features()->IsSupported(VFP3)) {
CpuFeatures::Scope scope(VFP3);
if (array_type == kExternalFloatArray) {
// vldr requires offset to be a multiple of 4 so we can not
// include -kHeapObjectTag into it.

View File

@ -322,7 +322,7 @@ void VirtualFrame::InvokeBuiltin(Builtins::JavaScript id,
void VirtualFrame::CallLoadIC(Handle<String> name, RelocInfo::Mode mode) {
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
Builtins::LoadIC_Initialize));
Builtins::kLoadIC_Initialize));
PopToR0();
SpillAll();
__ mov(r2, Operand(name));
@ -334,8 +334,8 @@ void VirtualFrame::CallStoreIC(Handle<String> name,
bool is_contextual,
StrictModeFlag strict_mode) {
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
(strict_mode == kStrictMode) ? Builtins::StoreIC_Initialize_Strict
: Builtins::StoreIC_Initialize));
(strict_mode == kStrictMode) ? Builtins::kStoreIC_Initialize_Strict
: Builtins::kStoreIC_Initialize));
PopToR0();
RelocInfo::Mode mode;
if (is_contextual) {
@ -354,7 +354,7 @@ void VirtualFrame::CallStoreIC(Handle<String> name,
void VirtualFrame::CallKeyedLoadIC() {
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
Builtins::KeyedLoadIC_Initialize));
Builtins::kKeyedLoadIC_Initialize));
PopToR1R0();
SpillAll();
CallCodeObject(ic, RelocInfo::CODE_TARGET, 0);
@ -363,8 +363,8 @@ void VirtualFrame::CallKeyedLoadIC() {
void VirtualFrame::CallKeyedStoreIC(StrictModeFlag strict_mode) {
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
(strict_mode == kStrictMode) ? Builtins::KeyedStoreIC_Initialize_Strict
: Builtins::KeyedStoreIC_Initialize));
(strict_mode == kStrictMode) ? Builtins::kKeyedStoreIC_Initialize_Strict
: Builtins::kKeyedStoreIC_Initialize));
PopToR1R0();
SpillAll();
EmitPop(r2);
@ -388,7 +388,7 @@ void VirtualFrame::CallCodeObject(Handle<Code> code,
break;
case Code::BUILTIN:
ASSERT(*code == Isolate::Current()->builtins()->builtin(
Builtins::JSConstructCall));
Builtins::kJSConstructCall));
break;
default:
UNREACHABLE();

View File

@ -527,12 +527,12 @@ void Property::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
// Record type feedback from the oracle in the AST.
is_monomorphic_ = oracle->LoadIsMonomorphic(this);
if (key()->IsPropertyName()) {
if (oracle->LoadIsBuiltin(this, Builtins::LoadIC_ArrayLength)) {
if (oracle->LoadIsBuiltin(this, Builtins::kLoadIC_ArrayLength)) {
is_array_length_ = true;
} else if (oracle->LoadIsBuiltin(this, Builtins::LoadIC_StringLength)) {
} else if (oracle->LoadIsBuiltin(this, Builtins::kLoadIC_StringLength)) {
is_string_length_ = true;
} else if (oracle->LoadIsBuiltin(this,
Builtins::LoadIC_FunctionPrototype)) {
Builtins::kLoadIC_FunctionPrototype)) {
is_function_prototype_ = true;
} else {
Literal* lit_key = key()->AsLiteral();
@ -541,7 +541,7 @@ void Property::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
ZoneMapList* types = oracle->LoadReceiverTypes(this, name);
receiver_types_ = types;
}
} else if (oracle->LoadIsBuiltin(this, Builtins::KeyedLoadIC_String)) {
} else if (oracle->LoadIsBuiltin(this, Builtins::kKeyedLoadIC_String)) {
is_string_access_ = true;
} else if (is_monomorphic_) {
monomorphic_receiver_type_ = oracle->LoadMonomorphicReceiverType(this);

View File

@ -445,7 +445,7 @@ Handle<JSFunction> Genesis::CreateEmptyFunction() {
// --- E m p t y ---
Handle<Code> code =
Handle<Code>(Isolate::Current()->builtins()->builtin(
Builtins::EmptyFunction));
Builtins::kEmptyFunction));
empty_function->set_code(*code);
empty_function->shared()->set_code(*code);
Handle<String> source = FACTORY->NewStringFromAscii(CStrVector("() {}"));
@ -587,9 +587,9 @@ void Genesis::CreateStrictModeFunctionMaps(Handle<JSFunction> empty) {
// Create the ThrowTypeError function instances.
Handle<JSFunction> arguments_throw =
CreateThrowTypeErrorFunction(Builtins::StrictFunctionArguments);
CreateThrowTypeErrorFunction(Builtins::kStrictFunctionArguments);
Handle<JSFunction> caller_throw =
CreateThrowTypeErrorFunction(Builtins::StrictFunctionCaller);
CreateThrowTypeErrorFunction(Builtins::kStrictFunctionCaller);
// Complete the callback fixed arrays.
arguments->set(0, *arguments_throw);
@ -673,7 +673,7 @@ Handle<JSGlobalProxy> Genesis::CreateNewGlobals(
if (js_global_template.is_null()) {
Handle<String> name = Handle<String>(HEAP->empty_symbol());
Handle<Code> code = Handle<Code>(Isolate::Current()->builtins()->builtin(
Builtins::Illegal));
Builtins::kIllegal));
js_global_function =
FACTORY->NewFunction(name, JS_GLOBAL_OBJECT_TYPE,
JSGlobalObject::kSize, code, true);
@ -707,7 +707,7 @@ Handle<JSGlobalProxy> Genesis::CreateNewGlobals(
if (global_template.IsEmpty()) {
Handle<String> name = Handle<String>(HEAP->empty_symbol());
Handle<Code> code = Handle<Code>(Isolate::Current()->builtins()->builtin(
Builtins::Illegal));
Builtins::kIllegal));
global_proxy_function =
FACTORY->NewFunction(name, JS_GLOBAL_PROXY_TYPE,
JSGlobalProxy::kSize, code, true);
@ -796,15 +796,15 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
// Install global Function object
InstallFunction(global, "Function", JS_FUNCTION_TYPE, JSFunction::kSize,
empty_function, Builtins::Illegal, true); // ECMA native.
empty_function, Builtins::kIllegal, true); // ECMA native.
{ // --- A r r a y ---
Handle<JSFunction> array_function =
InstallFunction(global, "Array", JS_ARRAY_TYPE, JSArray::kSize,
Isolate::Current()->initial_object_prototype(),
Builtins::ArrayCode, true);
Builtins::kArrayCode, true);
array_function->shared()->set_construct_stub(
Isolate::Current()->builtins()->builtin(Builtins::ArrayConstructCode));
Isolate::Current()->builtins()->builtin(Builtins::kArrayConstructCode));
array_function->shared()->DontAdaptArguments();
// This seems a bit hackish, but we need to make sure Array.length
@ -832,7 +832,7 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
Handle<JSFunction> number_fun =
InstallFunction(global, "Number", JS_VALUE_TYPE, JSValue::kSize,
Isolate::Current()->initial_object_prototype(),
Builtins::Illegal, true);
Builtins::kIllegal, true);
global_context()->set_number_function(*number_fun);
}
@ -840,7 +840,7 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
Handle<JSFunction> boolean_fun =
InstallFunction(global, "Boolean", JS_VALUE_TYPE, JSValue::kSize,
Isolate::Current()->initial_object_prototype(),
Builtins::Illegal, true);
Builtins::kIllegal, true);
global_context()->set_boolean_function(*boolean_fun);
}
@ -848,9 +848,10 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
Handle<JSFunction> string_fun =
InstallFunction(global, "String", JS_VALUE_TYPE, JSValue::kSize,
Isolate::Current()->initial_object_prototype(),
Builtins::Illegal, true);
Builtins::kIllegal, true);
string_fun->shared()->set_construct_stub(
Isolate::Current()->builtins()->builtin(Builtins::StringConstructCode));
Isolate::Current()->builtins()->builtin(
Builtins::kStringConstructCode));
global_context()->set_string_function(*string_fun);
// Add 'length' property to strings.
Handle<DescriptorArray> string_descriptors =
@ -872,7 +873,7 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
Handle<JSFunction> date_fun =
InstallFunction(global, "Date", JS_VALUE_TYPE, JSValue::kSize,
Isolate::Current()->initial_object_prototype(),
Builtins::Illegal, true);
Builtins::kIllegal, true);
global_context()->set_date_function(*date_fun);
}
@ -883,7 +884,7 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
Handle<JSFunction> regexp_fun =
InstallFunction(global, "RegExp", JS_REGEXP_TYPE, JSRegExp::kSize,
Isolate::Current()->initial_object_prototype(),
Builtins::Illegal, true);
Builtins::kIllegal, true);
global_context()->set_regexp_function(*regexp_fun);
ASSERT(regexp_fun->has_initial_map());
@ -968,7 +969,7 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
// class_name equals 'Arguments'.
Handle<String> symbol = FACTORY->LookupAsciiSymbol("Arguments");
Handle<Code> code = Handle<Code>(
Isolate::Current()->builtins()->builtin(Builtins::Illegal));
Isolate::Current()->builtins()->builtin(Builtins::kIllegal));
Handle<JSObject> prototype =
Handle<JSObject>(
JSObject::cast(global_context()->object_function()->prototype()));
@ -1023,9 +1024,9 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
Handle<FixedArray> caller = FACTORY->NewFixedArray(2, TENURED);
Handle<JSFunction> callee_throw =
CreateThrowTypeErrorFunction(Builtins::StrictArgumentsCallee);
CreateThrowTypeErrorFunction(Builtins::kStrictArgumentsCallee);
Handle<JSFunction> caller_throw =
CreateThrowTypeErrorFunction(Builtins::StrictArgumentsCaller);
CreateThrowTypeErrorFunction(Builtins::kStrictArgumentsCaller);
// Install the ThrowTypeError functions.
callee->set(0, *callee_throw);
@ -1088,7 +1089,7 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
{ // --- context extension
// Create a function for the context extension objects.
Handle<Code> code = Handle<Code>(
Isolate::Current()->builtins()->builtin(Builtins::Illegal));
Isolate::Current()->builtins()->builtin(Builtins::kIllegal));
Handle<JSFunction> context_extension_fun =
FACTORY->NewFunction(FACTORY->empty_symbol(),
JS_CONTEXT_EXTENSION_OBJECT_TYPE,
@ -1106,7 +1107,7 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
// Setup the call-as-function delegate.
Handle<Code> code =
Handle<Code>(Isolate::Current()->builtins()->builtin(
Builtins::HandleApiCallAsFunction));
Builtins::kHandleApiCallAsFunction));
Handle<JSFunction> delegate =
FACTORY->NewFunction(FACTORY->empty_symbol(), JS_OBJECT_TYPE,
JSObject::kHeaderSize, code, true);
@ -1118,7 +1119,7 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
// Setup the call-as-constructor delegate.
Handle<Code> code =
Handle<Code>(Isolate::Current()->builtins()->builtin(
Builtins::HandleApiCallAsConstructor));
Builtins::kHandleApiCallAsConstructor));
Handle<JSFunction> delegate =
FACTORY->NewFunction(FACTORY->empty_symbol(), JS_OBJECT_TYPE,
JSObject::kHeaderSize, code, true);
@ -1251,7 +1252,7 @@ bool Genesis::InstallNatives() {
// JavaScript builtins, a reference to the builtins object
// (itself) and a reference to the global_context directly in the object.
Handle<Code> code = Handle<Code>(
isolate->builtins()->builtin(Builtins::Illegal));
isolate->builtins()->builtin(Builtins::kIllegal));
Handle<JSFunction> builtins_fun =
factory->NewFunction(factory->empty_symbol(), JS_BUILTINS_OBJECT_TYPE,
JSBuiltinsObject::kSize, code, true);
@ -1296,7 +1297,7 @@ bool Genesis::InstallNatives() {
Handle<JSFunction> script_fun =
InstallFunction(builtins, "Script", JS_VALUE_TYPE, JSValue::kSize,
isolate->initial_object_prototype(),
Builtins::Illegal, false);
Builtins::kIllegal, false);
Handle<JSObject> prototype =
factory->NewJSObject(isolate->object_function(), TENURED);
SetPrototype(script_fun, prototype);
@ -1421,7 +1422,7 @@ bool Genesis::InstallNatives() {
InstallFunction(builtins, "OpaqueReference", JS_VALUE_TYPE,
JSValue::kSize,
isolate->initial_object_prototype(),
Builtins::Illegal, false);
Builtins::kIllegal, false);
Handle<JSObject> prototype =
factory->NewJSObject(isolate->object_function(), TENURED);
SetPrototype(opaque_reference_fun, prototype);
@ -1443,14 +1444,14 @@ bool Genesis::InstallNatives() {
JS_ARRAY_TYPE,
JSArray::kSize,
isolate->initial_object_prototype(),
Builtins::ArrayCode,
Builtins::kArrayCode,
true);
Handle<JSObject> prototype =
factory->NewJSObject(isolate->object_function(), TENURED);
SetPrototype(array_function, prototype);
array_function->shared()->set_construct_stub(
isolate->builtins()->builtin(Builtins::ArrayConstructCode));
isolate->builtins()->builtin(Builtins::kArrayConstructCode));
array_function->shared()->DontAdaptArguments();
// Make "length" magic on instances.
@ -1505,12 +1506,12 @@ bool Genesis::InstallNatives() {
Handle<JSFunction> call =
InstallFunction(proto, "call", JS_OBJECT_TYPE, JSObject::kHeaderSize,
Handle<JSObject>::null(),
Builtins::FunctionCall,
Builtins::kFunctionCall,
false);
Handle<JSFunction> apply =
InstallFunction(proto, "apply", JS_OBJECT_TYPE, JSObject::kHeaderSize,
Handle<JSObject>::null(),
Builtins::FunctionApply,
Builtins::kFunctionApply,
false);
// Make sure that Function.prototype.call appears to be compiled.

View File

@ -1576,7 +1576,7 @@ void Builtins::InitBuiltinFunctionTable() {
functions->generator = FUNCTION_ADDR(Generate_##aname); \
functions->c_code = NULL; \
functions->s_name = #aname; \
functions->name = aname; \
functions->name = k##aname; \
functions->flags = Code::ComputeFlags(Code::kind, \
NOT_IN_LOOP, \
state, \
@ -1685,4 +1685,23 @@ const char* Builtins::Lookup(byte* pc) {
}
#define DEFINE_BUILTIN_ACCESSOR_C(name, ignore) \
Handle<Code> Builtins::name() { \
Code** code_address = \
reinterpret_cast<Code**>(builtin_address(k##name)); \
return Handle<Code>(code_address); \
}
#define DEFINE_BUILTIN_ACCESSOR_A(name, kind, state, extra) \
Handle<Code> Builtins::name() { \
Code** code_address = \
reinterpret_cast<Code**>(builtin_address(k##name)); \
return Handle<Code>(code_address); \
}
BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C)
BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A)
BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
#undef DEFINE_BUILTIN_ACCESSOR_C
#undef DEFINE_BUILTIN_ACCESSOR_A
} } // namespace v8::internal

View File

@ -260,8 +260,8 @@ class Builtins {
const char* Lookup(byte* pc);
enum Name {
#define DEF_ENUM_C(name, ignore) name,
#define DEF_ENUM_A(name, kind, state, extra) name,
#define DEF_ENUM_C(name, ignore) k##name,
#define DEF_ENUM_A(name, kind, state, extra) k##name,
BUILTIN_LIST_C(DEF_ENUM_C)
BUILTIN_LIST_A(DEF_ENUM_A)
BUILTIN_LIST_DEBUG_A(DEF_ENUM_A)
@ -284,6 +284,15 @@ class Builtins {
id_count
};
#define DECLARE_BUILTIN_ACCESSOR_C(name, ignore) Handle<Code> name();
#define DECLARE_BUILTIN_ACCESSOR_A(name, kind, state, extra) \
Handle<Code> name();
BUILTIN_LIST_C(DECLARE_BUILTIN_ACCESSOR_C)
BUILTIN_LIST_A(DECLARE_BUILTIN_ACCESSOR_A)
BUILTIN_LIST_DEBUG_A(DECLARE_BUILTIN_ACCESSOR_A)
#undef DECLARE_BUILTIN_ACCESSOR_C
#undef DECLARE_BUILTIN_ACCESSOR_A
Code* builtin(Name name) {
// Code::cast cannot be used here since we access builtins
// during the marking phase of mark sweep. See IC::Clear.

View File

@ -710,8 +710,7 @@ Handle<SharedFunctionInfo> Compiler::BuildFunctionInfo(FunctionLiteral* literal,
// Generate code
if (FLAG_lazy && allow_lazy) {
Handle<Code> code(
info.isolate()->builtins()->builtin(Builtins::LazyCompile));
Handle<Code> code = info.isolate()->builtins()->LazyCompile();
info.SetCode(code);
} else {
if (V8::UseCrankshaft()) {
@ -801,7 +800,7 @@ void Compiler::RecordFunctionCompilation(Logger::LogEventsAndTags tag,
if (info->isolate()->logger()->is_logging() || CpuProfiler::is_profiling()) {
Handle<Script> script = info->script();
Handle<Code> code = info->code();
if (*code == info->isolate()->builtins()->builtin(Builtins::LazyCompile))
if (*code == info->isolate()->builtins()->builtin(Builtins::kLazyCompile))
return;
if (script->name()->IsString()) {
int line_num = GetScriptLineNumber(script, shared->start_position()) + 1;

View File

@ -717,11 +717,11 @@ void Debug::Setup(bool create_heap_objects) {
if (create_heap_objects) {
// Get code to handle debug break on return.
debug_break_return_ =
Isolate::Current()->builtins()->builtin(Builtins::Return_DebugBreak);
Isolate::Current()->builtins()->builtin(Builtins::kReturn_DebugBreak);
ASSERT(debug_break_return_->IsCode());
// Get code to handle debug break in debug break slots.
debug_break_slot_ =
Isolate::Current()->builtins()->builtin(Builtins::Slot_DebugBreak);
Isolate::Current()->builtins()->builtin(Builtins::kSlot_DebugBreak);
ASSERT(debug_break_slot_->IsCode());
}
}
@ -1007,14 +1007,15 @@ Object* Debug::Break(RUNTIME_CALLING_CONVENTION) {
FRAME_DROPPED_IN_IC_CALL) {
// We must have been calling IC stub. Do not go there anymore.
Code* plain_return =
Isolate::Current()->builtins()->builtin(Builtins::PlainReturn_LiveEdit);
Isolate::Current()->builtins()->builtin(
Builtins::kPlainReturn_LiveEdit);
debug->thread_local_.after_break_target_ = plain_return->entry();
} else if (debug->thread_local_.frame_drop_mode_ ==
FRAME_DROPPED_IN_DEBUG_SLOT_CALL) {
// Debug break slot stub does not return normally, instead it manually
// cleans the stack and jumps. We should patch the jump address.
Code* plain_return = Isolate::Current()->builtins()->builtin(
Builtins::FrameDropper_LiveEdit);
Builtins::kFrameDropper_LiveEdit);
debug->thread_local_.after_break_target_ = plain_return->entry();
} else if (debug->thread_local_.frame_drop_mode_ ==
FRAME_DROPPED_IN_DIRECT_CALL) {
@ -1517,22 +1518,16 @@ Handle<Code> Debug::FindDebugBreak(Handle<Code> code, RelocInfo::Mode mode) {
return ComputeCallDebugBreak(code->arguments_count(), code->kind());
case Code::LOAD_IC:
return Handle<Code>(Isolate::Current()->builtins()->builtin(
Builtins::LoadIC_DebugBreak));
return Isolate::Current()->builtins()->LoadIC_DebugBreak();
case Code::STORE_IC:
return Handle<Code>(Isolate::Current()->builtins()->builtin(
Builtins::StoreIC_DebugBreak));
return Isolate::Current()->builtins()->StoreIC_DebugBreak();
case Code::KEYED_LOAD_IC:
return Handle<Code>(
Isolate::Current()->builtins()->builtin(
Builtins::KeyedLoadIC_DebugBreak));
return Isolate::Current()->builtins()->KeyedLoadIC_DebugBreak();
case Code::KEYED_STORE_IC:
return Handle<Code>(
Isolate::Current()->builtins()->builtin(
Builtins::KeyedStoreIC_DebugBreak));
return Isolate::Current()->builtins()->KeyedStoreIC_DebugBreak();
default:
UNREACHABLE();
@ -1540,15 +1535,13 @@ Handle<Code> Debug::FindDebugBreak(Handle<Code> code, RelocInfo::Mode mode) {
}
if (RelocInfo::IsConstructCall(mode)) {
Handle<Code> result =
Handle<Code>(Isolate::Current()->builtins()->builtin(
Builtins::ConstructCall_DebugBreak));
Isolate::Current()->builtins()->ConstructCall_DebugBreak();
return result;
}
if (code->kind() == Code::STUB) {
ASSERT(code->major_key() == CodeStub::CallFunction);
Handle<Code> result =
Handle<Code>(Isolate::Current()->builtins()->builtin(
Builtins::StubNoRegisters_DebugBreak));
Isolate::Current()->builtins()->StubNoRegisters_DebugBreak();
return result;
}
@ -1616,9 +1609,9 @@ void Debug::HandleStepIn(Handle<JSFunction> function,
// Don't allow step into functions in the native context.
if (!function->IsBuiltin()) {
if (function->shared()->code() ==
Isolate::Current()->builtins()->builtin(Builtins::FunctionApply) ||
Isolate::Current()->builtins()->builtin(Builtins::kFunctionApply) ||
function->shared()->code() ==
Isolate::Current()->builtins()->builtin(Builtins::FunctionCall)) {
Isolate::Current()->builtins()->builtin(Builtins::kFunctionCall)) {
// Handle function.apply and function.call separately to flood the
// function to be called and not the code for Builtins::FunctionApply or
// Builtins::FunctionCall. The receiver of call/apply is the target

View File

@ -993,11 +993,8 @@ Handle<JSObject> Factory::NewArgumentsObject(Handle<Object> callee,
Handle<JSFunction> Factory::CreateApiFunction(
Handle<FunctionTemplateInfo> obj, ApiInstanceType instance_type) {
Handle<Code> code = Handle<Code>(isolate()->builtins()->builtin(
Builtins::HandleApiCall));
Handle<Code> construct_stub =
Handle<Code>(isolate()->builtins()->builtin(
Builtins::JSConstructStubApi));
Handle<Code> code = isolate()->builtins()->HandleApiCall();
Handle<Code> construct_stub = isolate()->builtins()->JSConstructStubApi();
int internal_field_count = 0;
if (!obj->instance_template()->IsUndefined()) {

View File

@ -851,7 +851,7 @@ Address InternalFrame::GetCallerStackPointer() const {
Code* ArgumentsAdaptorFrame::unchecked_code() const {
return Isolate::Current()->builtins()->builtin(
Builtins::ArgumentsAdaptorTrampoline);
Builtins::kArgumentsAdaptorTrampoline);
}

View File

@ -2271,11 +2271,11 @@ MaybeObject* Heap::AllocateSharedFunctionInfo(Object* name) {
SharedFunctionInfo* share = SharedFunctionInfo::cast(result);
share->set_name(name);
Code* illegal = isolate_->builtins()->builtin(Builtins::Illegal);
Code* illegal = isolate_->builtins()->builtin(Builtins::kIllegal);
share->set_code(illegal);
share->set_scope_info(SerializedScopeInfo::Empty());
Code* construct_stub = isolate_->builtins()->builtin(
Builtins::JSConstructStubGeneric);
Builtins::kJSConstructStubGeneric);
share->set_construct_stub(construct_stub);
share->set_expected_nof_properties(0);
share->set_length(0);

View File

@ -1246,7 +1246,7 @@ class HCallConstantFunction: public HCall<0> {
bool IsApplyFunction() const {
return function_->code() ==
Isolate::Current()->builtins()->builtin(Builtins::FunctionApply);
Isolate::Current()->builtins()->builtin(Builtins::kFunctionApply);
}
virtual void PrintDataTo(StringStream* stream);

View File

@ -100,8 +100,9 @@ void Builtins::Generate_JSConstructCall(MacroAssembler* masm) {
// Set expected number of arguments to zero (not changing eax).
__ Set(ebx, Immediate(0));
__ GetBuiltinEntry(edx, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR);
__ jmp(Handle<Code>(masm->isolate()->builtins()->builtin(
ArgumentsAdaptorTrampoline)), RelocInfo::CODE_TARGET);
Handle<Code> arguments_adaptor =
masm->isolate()->builtins()->ArgumentsAdaptorTrampoline();
__ jmp(arguments_adaptor, RelocInfo::CODE_TARGET);
}
@ -334,8 +335,8 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
// Call the function.
if (is_api_function) {
__ mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
Handle<Code> code = Handle<Code>(
masm->isolate()->builtins()->builtin(Builtins::HandleApiCallConstruct));
Handle<Code> code =
masm->isolate()->builtins()->HandleApiCallConstruct();
ParameterCount expected(0);
__ InvokeCode(code, expected, expected,
RelocInfo::CODE_TARGET, CALL_FUNCTION);
@ -436,8 +437,8 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
// Invoke the code.
if (is_construct) {
__ call(Handle<Code>(masm->isolate()->builtins()->builtin(
Builtins::JSConstructCall)), RelocInfo::CODE_TARGET);
__ call(masm->isolate()->builtins()->JSConstructCall(),
RelocInfo::CODE_TARGET);
} else {
ParameterCount actual(eax);
__ InvokeFunction(edi, actual, CALL_FUNCTION);
@ -674,8 +675,8 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
__ j(not_zero, &function, taken);
__ Set(ebx, Immediate(0));
__ GetBuiltinEntry(edx, Builtins::CALL_NON_FUNCTION);
__ jmp(Handle<Code>(masm->isolate()->builtins()->builtin(
ArgumentsAdaptorTrampoline)), RelocInfo::CODE_TARGET);
__ jmp(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(),
RelocInfo::CODE_TARGET);
__ bind(&function);
}
@ -688,8 +689,8 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
__ mov(edx, FieldOperand(edi, JSFunction::kCodeEntryOffset));
__ SmiUntag(ebx);
__ cmp(eax, Operand(ebx));
__ j(not_equal, Handle<Code>(masm->isolate()->builtins()->builtin(
ArgumentsAdaptorTrampoline)));
__ j(not_equal,
masm->isolate()->builtins()->ArgumentsAdaptorTrampoline());
ParameterCount expected(0);
__ InvokeCode(Operand(edx), expected, expected, JUMP_FUNCTION);
@ -796,8 +797,7 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) {
__ mov(edx, Operand(ebp, 2 * kPointerSize)); // load arguments
// Use inline caching to speed up access to arguments.
Handle<Code> ic(masm->isolate()->builtins()->builtin(
Builtins::KeyedLoadIC_Initialize));
Handle<Code> ic = masm->isolate()->builtins()->KeyedLoadIC_Initialize();
__ call(ic, RelocInfo::CODE_TARGET);
// It is important that we do not have a test instruction after the
// call. A test instruction after the call is used to indicate that
@ -1235,8 +1235,8 @@ void Builtins::Generate_ArrayCode(MacroAssembler* masm) {
// Jump to the generic array code in case the specialized code cannot handle
// the construction.
__ bind(&generic_array_code);
Code* code = masm->isolate()->builtins()->builtin(Builtins::ArrayCodeGeneric);
Handle<Code> array_code(code);
Handle<Code> array_code =
masm->isolate()->builtins()->ArrayCodeGeneric();
__ jmp(array_code, RelocInfo::CODE_TARGET);
}
@ -1269,9 +1269,8 @@ void Builtins::Generate_ArrayConstructCode(MacroAssembler* masm) {
// Jump to the generic construct code in case the specialized code cannot
// handle the construction.
__ bind(&generic_constructor);
Code* code = masm->isolate()->builtins()->builtin(
Builtins::JSConstructStubGeneric);
Handle<Code> generic_construct_stub(code);
Handle<Code> generic_construct_stub =
masm->isolate()->builtins()->JSConstructStubGeneric();
__ jmp(generic_construct_stub, RelocInfo::CODE_TARGET);
}
@ -1588,7 +1587,7 @@ void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
#undef __
} } // namespace v8::internal
}
} // namespace v8::internal
#endif // V8_TARGET_ARCH_IA32

View File

@ -4681,8 +4681,8 @@ void CallFunctionStub::Generate(MacroAssembler* masm) {
__ Set(eax, Immediate(argc_));
__ Set(ebx, Immediate(0));
__ GetBuiltinEntry(edx, Builtins::CALL_NON_FUNCTION);
Handle<Code> adaptor(masm->isolate()->builtins()->builtin(
Builtins::ArgumentsAdaptorTrampoline));
Handle<Code> adaptor =
masm->isolate()->builtins()->ArgumentsAdaptorTrampoline();
__ jmp(adaptor, RelocInfo::CODE_TARGET);
}
@ -4950,11 +4950,11 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
// stub, because the builtin stubs may not have been generated yet.
if (is_construct) {
ExternalReference construct_entry(
Builtins::JSConstructEntryTrampoline,
Builtins::kJSConstructEntryTrampoline,
masm->isolate());
__ mov(edx, Immediate(construct_entry));
} else {
ExternalReference entry(Builtins::JSEntryTrampoline,
ExternalReference entry(Builtins::kJSEntryTrampoline,
masm->isolate());
__ mov(edx, Immediate(entry));
}

View File

@ -3347,7 +3347,7 @@ void CodeGenerator::CallApplyLazy(Expression* applicand,
__ mov(ecx, FieldOperand(eax, JSFunction::kCodeEntryOffset));
__ sub(Operand(ecx), Immediate(Code::kHeaderSize - kHeapObjectTag));
Handle<Code> apply_code(masm()->isolate()->builtins()->builtin(
Builtins::FunctionApply));
Builtins::kFunctionApply));
__ cmp(Operand(ecx), Immediate(apply_code));
__ j(not_equal, &build_args);
@ -9393,7 +9393,7 @@ void DeferredReferenceGetNamedValue::Generate() {
}
__ Set(ecx, Immediate(name_));
Handle<Code> ic(masm()->isolate()->builtins()->builtin(
Builtins::LoadIC_Initialize));
Builtins::kLoadIC_Initialize));
RelocInfo::Mode mode = is_contextual_
? RelocInfo::CODE_TARGET_CONTEXT
: RelocInfo::CODE_TARGET;
@ -9474,7 +9474,7 @@ void DeferredReferenceGetKeyedValue::Generate() {
// This means that we cannot allow test instructions after calls to
// KeyedLoadIC stubs in other places.
Handle<Code> ic(masm()->isolate()->builtins()->builtin(
Builtins::KeyedLoadIC_Initialize));
Builtins::kKeyedLoadIC_Initialize));
__ call(ic, RelocInfo::CODE_TARGET);
// The delta from the start of the map-compare instruction to the
// test instruction. We use masm_-> directly here instead of the __
@ -9578,8 +9578,8 @@ void DeferredReferenceSetKeyedValue::Generate() {
// Call the IC stub.
Handle<Code> ic(masm()->isolate()->builtins()->builtin(
(strict_mode_ == kStrictMode) ? Builtins::KeyedStoreIC_Initialize_Strict
: Builtins::KeyedStoreIC_Initialize));
(strict_mode_ == kStrictMode) ? Builtins::kKeyedStoreIC_Initialize_Strict
: Builtins::kKeyedStoreIC_Initialize));
__ call(ic, RelocInfo::CODE_TARGET);
// The delta from the start of the map-compare instruction to the
// test instruction. We use masm_-> directly here instead of the

View File

@ -123,7 +123,7 @@ void Deoptimizer::DeoptimizeFunction(JSFunction* function) {
// Add the deoptimizing code to the list.
DeoptimizingCodeListNode* node = new DeoptimizingCodeListNode(code);
DeoptimizerData* data = Isolate::Current()->deoptimizer_data();
DeoptimizerData* data = code->GetIsolate()->deoptimizer_data();
node->set_next(data->deoptimizing_code_list_);
data->deoptimizing_code_list_ = node;
@ -325,7 +325,7 @@ void Deoptimizer::DoComputeOsrOutputFrame() {
output_[0]->SetPc(pc);
}
Code* continuation =
Isolate::Current()->builtins()->builtin(Builtins::NotifyOSR);
function->GetIsolate()->builtins()->builtin(Builtins::kNotifyOSR);
output_[0]->SetContinuation(
reinterpret_cast<uint32_t>(continuation->entry()));
@ -494,8 +494,8 @@ void Deoptimizer::DoComputeFrame(TranslationIterator* iterator,
if (is_topmost) {
Builtins* builtins = isolate_->builtins();
Code* continuation = (bailout_type_ == EAGER)
? builtins->builtin(Builtins::NotifyDeoptimized)
: builtins->builtin(Builtins::NotifyLazyDeoptimized);
? builtins->builtin(Builtins::kNotifyDeoptimized)
: builtins->builtin(Builtins::kNotifyLazyDeoptimized);
output_frame->SetContinuation(
reinterpret_cast<uint32_t>(continuation->entry()));
}

View File

@ -732,9 +732,9 @@ void FullCodeGenerator::EmitDeclaration(Variable* variable,
prop->key()->AsLiteral()->handle()->IsSmi());
__ Set(ecx, Immediate(prop->key()->AsLiteral()->handle()));
Handle<Code> ic(isolate()->builtins()->builtin(is_strict_mode()
? Builtins::KeyedStoreIC_Initialize_Strict
: Builtins::KeyedStoreIC_Initialize));
Handle<Code> ic = is_strict_mode()
? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
: isolate()->builtins()->KeyedStoreIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
}
}
@ -1102,8 +1102,7 @@ void FullCodeGenerator::EmitLoadGlobalSlotCheckExtensions(
// load IC call.
__ mov(eax, GlobalObjectOperand());
__ mov(ecx, slot->var()->name());
Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::LoadIC_Initialize));
Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize();
RelocInfo::Mode mode = (typeof_state == INSIDE_TYPEOF)
? RelocInfo::CODE_TARGET
: RelocInfo::CODE_TARGET_CONTEXT;
@ -1186,8 +1185,8 @@ void FullCodeGenerator::EmitDynamicLoadFromSlotFastCase(
ContextSlotOperandCheckExtensions(obj_proxy->var()->AsSlot(),
slow));
__ mov(eax, Immediate(key_literal->handle()));
Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::KeyedLoadIC_Initialize));
Handle<Code> ic =
isolate()->builtins()->KeyedLoadIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
__ jmp(done);
}
@ -1210,8 +1209,7 @@ void FullCodeGenerator::EmitVariableLoad(Variable* var) {
// object on the stack.
__ mov(eax, GlobalObjectOperand());
__ mov(ecx, var->name());
Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::LoadIC_Initialize));
Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET_CONTEXT);
context()->Plug(eax);
@ -1274,8 +1272,7 @@ void FullCodeGenerator::EmitVariableLoad(Variable* var) {
__ mov(eax, Immediate(key_literal->handle()));
// Do a keyed property load.
Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::KeyedLoadIC_Initialize));
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
// Drop key and object left on the stack by IC.
@ -1386,9 +1383,9 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
VisitForAccumulatorValue(value);
__ mov(ecx, Immediate(key->handle()));
__ mov(edx, Operand(esp, 0));
Handle<Code> ic(isolate()->builtins()->builtin(
is_strict_mode() ? Builtins::StoreIC_Initialize_Strict
: Builtins::StoreIC_Initialize));
Handle<Code> ic = is_strict_mode()
? isolate()->builtins()->StoreIC_Initialize_Strict()
: isolate()->builtins()->StoreIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
PrepareForBailoutForId(key->id(), NO_REGISTERS);
} else {
@ -1637,16 +1634,14 @@ void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
SetSourcePosition(prop->position());
Literal* key = prop->key()->AsLiteral();
__ mov(ecx, Immediate(key->handle()));
Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::LoadIC_Initialize));
Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
}
void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
SetSourcePosition(prop->position());
Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::KeyedLoadIC_Initialize));
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
}
@ -1787,9 +1782,9 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, int bailout_ast_id) {
__ mov(edx, eax);
__ pop(eax); // Restore value.
__ mov(ecx, prop->key()->AsLiteral()->handle());
Handle<Code> ic(isolate()->builtins()->builtin(
is_strict_mode() ? Builtins::StoreIC_Initialize_Strict
: Builtins::StoreIC_Initialize));
Handle<Code> ic = is_strict_mode()
? isolate()->builtins()->StoreIC_Initialize_Strict()
: isolate()->builtins()->StoreIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
break;
}
@ -1810,9 +1805,9 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, int bailout_ast_id) {
__ pop(edx);
}
__ pop(eax); // Restore value.
Handle<Code> ic(isolate()->builtins()->builtin(
is_strict_mode() ? Builtins::KeyedStoreIC_Initialize_Strict
: Builtins::KeyedStoreIC_Initialize));
Handle<Code> ic = is_strict_mode()
? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
: isolate()->builtins()->KeyedStoreIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
break;
}
@ -1836,9 +1831,9 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var,
// ecx, and the global object on the stack.
__ mov(ecx, var->name());
__ mov(edx, GlobalObjectOperand());
Handle<Code> ic(isolate()->builtins()->builtin(
is_strict_mode() ? Builtins::StoreIC_Initialize_Strict
: Builtins::StoreIC_Initialize));
Handle<Code> ic = is_strict_mode()
? isolate()->builtins()->StoreIC_Initialize_Strict()
: isolate()->builtins()->StoreIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET_CONTEXT);
} else if (op == Token::INIT_CONST) {
@ -1939,9 +1934,9 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
} else {
__ pop(edx);
}
Handle<Code> ic(isolate()->builtins()->builtin(
is_strict_mode() ? Builtins::StoreIC_Initialize_Strict
: Builtins::StoreIC_Initialize));
Handle<Code> ic = is_strict_mode()
? isolate()->builtins()->StoreIC_Initialize_Strict()
: isolate()->builtins()->StoreIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
// If the assignment ends an initialization block, revert to fast case.
@ -1979,9 +1974,9 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
}
// Record source code position before IC call.
SetSourcePosition(expr->position());
Handle<Code> ic(isolate()->builtins()->builtin(
is_strict_mode() ? Builtins::KeyedStoreIC_Initialize_Strict
: Builtins::KeyedStoreIC_Initialize));
Handle<Code> ic = is_strict_mode()
? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
: isolate()->builtins()->KeyedStoreIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
// If the assignment ends an initialization block, revert to fast case.
@ -2257,8 +2252,7 @@ void FullCodeGenerator::VisitCall(Call* expr) {
// Record source code position for IC call.
SetSourcePosition(prop->position());
Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::KeyedLoadIC_Initialize));
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
// Push result (function).
__ push(eax);
@ -2326,8 +2320,8 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
__ Set(eax, Immediate(arg_count));
__ mov(edi, Operand(esp, arg_count * kPointerSize));
Handle<Code> construct_builtin(isolate()->builtins()->builtin(
Builtins::JSConstructCall));
Handle<Code> construct_builtin =
isolate()->builtins()->JSConstructCall();
__ call(construct_builtin, RelocInfo::CONSTRUCT_CALL);
context()->Plug(eax);
}
@ -3873,9 +3867,9 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
case NAMED_PROPERTY: {
__ mov(ecx, prop->key()->AsLiteral()->handle());
__ pop(edx);
Handle<Code> ic(isolate()->builtins()->builtin(
is_strict_mode() ? Builtins::StoreIC_Initialize_Strict
: Builtins::StoreIC_Initialize));
Handle<Code> ic = is_strict_mode()
? isolate()->builtins()->StoreIC_Initialize_Strict()
: isolate()->builtins()->StoreIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
if (expr->is_postfix()) {
@ -3890,9 +3884,9 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
case KEYED_PROPERTY: {
__ pop(ecx);
__ pop(edx);
Handle<Code> ic(isolate()->builtins()->builtin(
is_strict_mode() ? Builtins::KeyedStoreIC_Initialize_Strict
: Builtins::KeyedStoreIC_Initialize));
Handle<Code> ic = is_strict_mode()
? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
: isolate()->builtins()->KeyedStoreIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
if (expr->is_postfix()) {
@ -3918,8 +3912,7 @@ void FullCodeGenerator::VisitForTypeofValue(Expression* expr) {
Comment cmnt(masm_, "Global variable");
__ mov(eax, GlobalObjectOperand());
__ mov(ecx, Immediate(proxy->name()));
Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::LoadIC_Initialize));
Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize();
// Use a regular load, not a contextual load, to avoid a reference
// error.
EmitCallIC(ic, RelocInfo::CODE_TARGET);

View File

@ -2130,7 +2130,7 @@ void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
ASSERT(ToRegister(instr->result()).is(eax));
__ mov(ecx, instr->name());
Handle<Code> ic(isolate()->builtins()->builtin(Builtins::LoadIC_Initialize));
Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
@ -2255,8 +2255,7 @@ void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
ASSERT(ToRegister(instr->object()).is(edx));
ASSERT(ToRegister(instr->key()).is(eax));
Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::KeyedLoadIC_Initialize));
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
@ -2813,8 +2812,7 @@ void LCodeGen::DoCallNew(LCallNew* instr) {
ASSERT(ToRegister(instr->constructor()).is(edi));
ASSERT(ToRegister(instr->result()).is(eax));
Handle<Code> builtin(isolate()->builtins()->builtin(
Builtins::JSConstructCall));
Handle<Code> builtin = isolate()->builtins()->JSConstructCall();
__ Set(eax, Immediate(instr->arity()));
CallCode(builtin, RelocInfo::CONSTRUCT_CALL, instr);
}
@ -2861,9 +2859,9 @@ void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
ASSERT(ToRegister(instr->value()).is(eax));
__ mov(ecx, instr->name());
Handle<Code> ic(isolate()->builtins()->builtin(
info_->is_strict() ? Builtins::StoreIC_Initialize_Strict
: Builtins::StoreIC_Initialize));
Handle<Code> ic = info_->is_strict()
? isolate()->builtins()->StoreIC_Initialize_Strict()
: isolate()->builtins()->StoreIC_Initialize();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
@ -2931,9 +2929,9 @@ void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
ASSERT(ToRegister(instr->key()).is(ecx));
ASSERT(ToRegister(instr->value()).is(eax));
Handle<Code> ic(isolate()->builtins()->builtin(
info_->is_strict() ? Builtins::KeyedStoreIC_Initialize_Strict
: Builtins::KeyedStoreIC_Initialize));
Handle<Code> ic = info_->is_strict()
? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
: isolate()->builtins()->KeyedStoreIC_Initialize();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}

View File

@ -1486,8 +1486,7 @@ void MacroAssembler::InvokePrologue(const ParameterCount& expected,
if (!definitely_matches) {
Handle<Code> adaptor =
Handle<Code>(Isolate::Current()->builtins()->builtin(
Builtins::ArgumentsAdaptorTrampoline));
isolate()->builtins()->ArgumentsAdaptorTrampoline();
if (!code_constant.is_null()) {
mov(edx, Immediate(code_constant));
add(Operand(edx), Immediate(Code::kHeaderSize - kHeapObjectTag));

View File

@ -275,13 +275,14 @@ void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm,
void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype(
MacroAssembler* masm, int index, Register prototype, Label* miss) {
Isolate* isolate = masm->isolate();
// Check we're still in the same context.
__ cmp(Operand(esi, Context::SlotOffset(Context::GLOBAL_INDEX)),
Isolate::Current()->global());
isolate->global());
__ j(not_equal, miss);
// Get the global function with the given index.
JSFunction* function = JSFunction::cast(
Isolate::Current()->global_context()->get(index));
JSFunction* function =
JSFunction::cast(isolate->global_context()->get(index));
// Load its initial map. The global functions all have initial maps.
__ Set(prototype, Immediate(Handle<Map>(function->initial_map())));
// Load the prototype from the initial map.
@ -748,9 +749,9 @@ void StubCompiler::GenerateLoadMiss(MacroAssembler* masm, Code::Kind kind) {
ASSERT(kind == Code::LOAD_IC || kind == Code::KEYED_LOAD_IC);
Code* code = NULL;
if (kind == Code::LOAD_IC) {
code = Isolate::Current()->builtins()->builtin(Builtins::LoadIC_Miss);
code = masm->isolate()->builtins()->builtin(Builtins::kLoadIC_Miss);
} else {
code = Isolate::Current()->builtins()->builtin(Builtins::KeyedLoadIC_Miss);
code = masm->isolate()->builtins()->builtin(Builtins::kKeyedLoadIC_Miss);
}
Handle<Code> ic(code);
@ -1360,8 +1361,8 @@ void CallStubCompiler::GenerateLoadFunctionFromCell(JSGlobalPropertyCell* cell,
MaybeObject* CallStubCompiler::GenerateMissBranch() {
MaybeObject* maybe_obj =
Isolate::Current()->stub_cache()->ComputeCallMiss(
arguments().immediate(), kind_);
masm()->isolate()->stub_cache()->ComputeCallMiss(arguments().immediate(),
kind_);
Object* obj;
if (!maybe_obj->ToObject(&obj)) return maybe_obj;
__ jmp(Handle<Code>(Code::cast(obj)), RelocInfo::CODE_TARGET);
@ -1913,7 +1914,7 @@ MaybeObject* CallStubCompiler::CompileMathFloorCall(Object* object,
// -- esp[(argc + 1) * 4] : receiver
// -----------------------------------
if (!Isolate::Current()->cpu_features()->IsSupported(SSE2))
if (masm()->isolate()->cpu_features()->IsSupported(SSE2))
return HEAP->undefined_value();
CpuFeatures::Scope use_sse2(SSE2);
@ -2483,8 +2484,7 @@ MaybeObject* StoreStubCompiler::CompileStoreField(JSObject* object,
// Handle store cache miss.
__ bind(&miss);
__ mov(ecx, Immediate(Handle<String>(name))); // restore name
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
Builtins::StoreIC_Miss));
Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss();
__ jmp(ic, RelocInfo::CODE_TARGET);
// Return the generated code.
@ -2536,7 +2536,7 @@ MaybeObject* StoreStubCompiler::CompileStoreCallback(JSObject* object,
// Handle store cache miss.
__ bind(&miss);
Handle<Code> ic(isolate->builtins()->builtin(Builtins::StoreIC_Miss));
Handle<Code> ic = isolate->builtins()->StoreIC_Miss();
__ jmp(ic, RelocInfo::CODE_TARGET);
// Return the generated code.
@ -2587,7 +2587,7 @@ MaybeObject* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver,
// Handle store cache miss.
__ bind(&miss);
Handle<Code> ic(isolate->builtins()->builtin(Builtins::StoreIC_Miss));
Handle<Code> ic = isolate->builtins()->StoreIC_Miss();
__ jmp(ic, RelocInfo::CODE_TARGET);
// Return the generated code.
@ -2637,8 +2637,7 @@ MaybeObject* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object,
// Handle store cache miss.
__ bind(&miss);
__ IncrementCounter(counters->named_store_global_inline_miss(), 1);
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
Builtins::StoreIC_Miss));
Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss();
__ jmp(ic, RelocInfo::CODE_TARGET);
// Return the generated code.
@ -2676,8 +2675,7 @@ MaybeObject* KeyedStoreStubCompiler::CompileStoreField(JSObject* object,
// Handle store cache miss.
__ bind(&miss);
__ DecrementCounter(counters->keyed_store_field(), 1);
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
Builtins::KeyedStoreIC_Miss));
Handle<Code> ic = masm()->isolate()->builtins()->KeyedStoreIC_Miss();
__ jmp(ic, RelocInfo::CODE_TARGET);
// Return the generated code.
@ -2734,8 +2732,7 @@ MaybeObject* KeyedStoreStubCompiler::CompileStoreSpecialized(
// Handle store cache miss.
__ bind(&miss);
Handle<Code> ic(
Isolate::Current()->builtins()->builtin(Builtins::KeyedStoreIC_Miss));
Handle<Code> ic = masm()->isolate()->builtins()->KeyedStoreIC_Miss();
__ jmp(ic, RelocInfo::CODE_TARGET);
// Return the generated code.
@ -3284,7 +3281,7 @@ MaybeObject* ConstructStubCompiler::CompileConstructStub(JSFunction* function) {
int arg_number = shared->GetThisPropertyAssignmentArgument(i);
__ mov(ebx, edi);
__ cmp(eax, arg_number);
if (Isolate::Current()->cpu_features()->IsSupported(CMOV)) {
if (masm()->isolate()->cpu_features()->IsSupported(CMOV)) {
CpuFeatures::Scope use_cmov(CMOV);
__ cmov(above, ebx, Operand(ecx, arg_number * -kPointerSize));
} else {
@ -3327,9 +3324,8 @@ MaybeObject* ConstructStubCompiler::CompileConstructStub(JSFunction* function) {
// Jump to the generic stub in case the specialized code cannot handle the
// construction.
__ bind(&generic_stub_call);
Code* code = Isolate::Current()->builtins()->builtin(
Builtins::JSConstructStubGeneric);
Handle<Code> generic_construct_stub(code);
Handle<Code> generic_construct_stub =
masm()->isolate()->builtins()->JSConstructStubGeneric();
__ jmp(generic_construct_stub, RelocInfo::CODE_TARGET);
// Return the generated code.
@ -3604,10 +3600,10 @@ MaybeObject* ExternalArrayStubCompiler::CompileKeyedStoreStub(
// processors that don't support SSE2. The code in IntegerConvert
// (code-stubs-ia32.cc) is roughly what is needed here though the
// conversion failure case does not need to be handled.
if (Isolate::Current()->cpu_features()->IsSupported(SSE2)) {
if (masm()->isolate()->cpu_features()->IsSupported(SSE2)) {
if (array_type != kExternalIntArray &&
array_type != kExternalUnsignedIntArray) {
ASSERT(Isolate::Current()->cpu_features()->IsSupported(SSE2));
ASSERT(masm()->isolate()->cpu_features()->IsSupported(SSE2));
CpuFeatures::Scope scope(SSE2);
__ cvttsd2si(ecx, FieldOperand(eax, HeapNumber::kValueOffset));
// ecx: untagged integer value
@ -3635,7 +3631,7 @@ MaybeObject* ExternalArrayStubCompiler::CompileKeyedStoreStub(
break;
}
} else {
if (Isolate::Current()->cpu_features()->IsSupported(SSE3)) {
if (masm()->isolate()->cpu_features()->IsSupported(SSE3)) {
CpuFeatures::Scope scope(SSE3);
// fisttp stores values as signed integers. To represent the
// entire range of int and unsigned int arrays, store as a
@ -3648,7 +3644,7 @@ MaybeObject* ExternalArrayStubCompiler::CompileKeyedStoreStub(
__ pop(ecx);
__ add(Operand(esp), Immediate(kPointerSize));
} else {
ASSERT(Isolate::Current()->cpu_features()->IsSupported(SSE2));
ASSERT(masm()->isolate()->cpu_features()->IsSupported(SSE2));
CpuFeatures::Scope scope(SSE2);
// We can easily implement the correct rounding behavior for the
// range [0, 2^31-1]. For the time being, to keep this code simple,

View File

@ -1017,7 +1017,7 @@ Result VirtualFrame::CallLoadIC(RelocInfo::Mode mode) {
MoveResultsToRegisters(&name, &receiver, ecx, eax);
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
Builtins::LoadIC_Initialize));
Builtins::kLoadIC_Initialize));
return RawCallCodeObject(ic, mode);
}
@ -1030,7 +1030,7 @@ Result VirtualFrame::CallKeyedLoadIC(RelocInfo::Mode mode) {
MoveResultsToRegisters(&key, &receiver, eax, edx);
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
Builtins::KeyedLoadIC_Initialize));
Builtins::kKeyedLoadIC_Initialize));
return RawCallCodeObject(ic, mode);
}
@ -1041,8 +1041,8 @@ Result VirtualFrame::CallStoreIC(Handle<String> name,
// Value and (if not contextual) receiver are on top of the frame.
// The IC expects name in ecx, value in eax, and receiver in edx.
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
(strict_mode == kStrictMode) ? Builtins::StoreIC_Initialize_Strict
: Builtins::StoreIC_Initialize));
(strict_mode == kStrictMode) ? Builtins::kStoreIC_Initialize_Strict
: Builtins::kStoreIC_Initialize));
Result value = Pop();
RelocInfo::Mode mode;
@ -1108,8 +1108,8 @@ Result VirtualFrame::CallKeyedStoreIC(StrictModeFlag strict_mode) {
}
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
(strict_mode == kStrictMode) ? Builtins::KeyedStoreIC_Initialize_Strict
: Builtins::KeyedStoreIC_Initialize));
(strict_mode == kStrictMode) ? Builtins::kKeyedStoreIC_Initialize_Strict
: Builtins::kKeyedStoreIC_Initialize));
return RawCallCodeObject(ic, RelocInfo::CODE_TARGET);
}
@ -1158,7 +1158,7 @@ Result VirtualFrame::CallConstructor(int arg_count) {
// IC expects arg count in eax, function in edi, and the arguments
// and receiver on the stack.
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
Builtins::JSConstructCall));
Builtins::kJSConstructCall));
// Duplicate the function before preparing the frame.
PushElementAt(arg_count);
Result function = Pop();

View File

@ -878,14 +878,14 @@ MaybeObject* LoadIC::Load(State state,
const int offset = String::kLengthOffset;
PatchInlinedLoad(address(), map, offset);
set_target(isolate()->builtins()->builtin(
Builtins::LoadIC_StringLength));
Builtins::kLoadIC_StringLength));
} else {
set_target(isolate()->builtins()->builtin(
Builtins::LoadIC_StringWrapperLength));
Builtins::kLoadIC_StringWrapperLength));
}
} else if (state == MONOMORPHIC && object->IsStringWrapper()) {
set_target(isolate()->builtins()->builtin(
Builtins::LoadIC_StringWrapperLength));
Builtins::kLoadIC_StringWrapperLength));
} else {
set_target(non_monomorphic_stub);
}
@ -908,7 +908,7 @@ MaybeObject* LoadIC::Load(State state,
const int offset = JSArray::kLengthOffset;
PatchInlinedLoad(address(), map, offset);
set_target(isolate()->builtins()->builtin(
Builtins::LoadIC_ArrayLength));
Builtins::kLoadIC_ArrayLength));
} else {
set_target(non_monomorphic_stub);
}
@ -924,7 +924,7 @@ MaybeObject* LoadIC::Load(State state,
#endif
if (state == PREMONOMORPHIC) {
set_target(isolate()->builtins()->builtin(
Builtins::LoadIC_FunctionPrototype));
Builtins::kLoadIC_FunctionPrototype));
} else {
set_target(non_monomorphic_stub);
}
@ -1451,8 +1451,8 @@ MaybeObject* StoreIC::Store(State state,
if (FLAG_trace_ic) PrintF("[StoreIC : +#length /array]\n");
#endif
Builtins::Name target = (strict_mode == kStrictMode)
? Builtins::StoreIC_ArrayLength_Strict
: Builtins::StoreIC_ArrayLength;
? Builtins::kStoreIC_ArrayLength_Strict
: Builtins::kStoreIC_ArrayLength;
set_target(isolate()->builtins()->builtin(target));
return receiver->SetProperty(*name, *value, NONE, strict_mode);
}

View File

@ -316,15 +316,15 @@ class LoadIC: public IC {
// Stub accessors.
Code* megamorphic_stub() {
return isolate()->builtins()->builtin(
Builtins::LoadIC_Megamorphic);
Builtins::kLoadIC_Megamorphic);
}
static Code* initialize_stub() {
return Isolate::Current()->builtins()->builtin(
Builtins::LoadIC_Initialize);
Builtins::kLoadIC_Initialize);
}
Code* pre_monomorphic_stub() {
return isolate()->builtins()->builtin(
Builtins::LoadIC_PreMonomorphic);
Builtins::kLoadIC_PreMonomorphic);
}
static void Clear(Address address, Code* target);
@ -382,28 +382,28 @@ class KeyedLoadIC: public IC {
// Stub accessors.
static Code* initialize_stub() {
return Isolate::Current()->builtins()->builtin(
Builtins::KeyedLoadIC_Initialize);
Builtins::kKeyedLoadIC_Initialize);
}
Code* megamorphic_stub() {
return isolate()->builtins()->builtin(
Builtins::KeyedLoadIC_Generic);
Builtins::kKeyedLoadIC_Generic);
}
Code* generic_stub() {
return isolate()->builtins()->builtin(
Builtins::KeyedLoadIC_Generic);
Builtins::kKeyedLoadIC_Generic);
}
Code* pre_monomorphic_stub() {
return isolate()->builtins()->builtin(
Builtins::KeyedLoadIC_PreMonomorphic);
Builtins::kKeyedLoadIC_PreMonomorphic);
}
Code* string_stub() {
return isolate()->builtins()->builtin(
Builtins::KeyedLoadIC_String);
Builtins::kKeyedLoadIC_String);
}
Code* indexed_interceptor_stub() {
return isolate()->builtins()->builtin(
Builtins::KeyedLoadIC_IndexedInterceptor);
Builtins::kKeyedLoadIC_IndexedInterceptor);
}
static void Clear(Address address, Code* target);
@ -465,27 +465,27 @@ class StoreIC: public IC {
// Stub accessors.
Code* megamorphic_stub() {
return isolate()->builtins()->builtin(
Builtins::StoreIC_Megamorphic);
Builtins::kStoreIC_Megamorphic);
}
Code* megamorphic_stub_strict() {
return isolate()->builtins()->builtin(
Builtins::StoreIC_Megamorphic_Strict);
Builtins::kStoreIC_Megamorphic_Strict);
}
static Code* initialize_stub() {
return Isolate::Current()->builtins()->builtin(
Builtins::StoreIC_Initialize);
Builtins::kStoreIC_Initialize);
}
static Code* initialize_stub_strict() {
return Isolate::Current()->builtins()->builtin(
Builtins::StoreIC_Initialize_Strict);
Builtins::kStoreIC_Initialize_Strict);
}
Code* global_proxy_stub() {
return isolate()->builtins()->builtin(
Builtins::StoreIC_GlobalProxy);
Builtins::kStoreIC_GlobalProxy);
}
Code* global_proxy_stub_strict() {
return isolate()->builtins()->builtin(
Builtins::StoreIC_GlobalProxy_Strict);
Builtins::kStoreIC_GlobalProxy_Strict);
}
static void Clear(Address address, Code* target);
@ -540,27 +540,27 @@ class KeyedStoreIC: public IC {
// Stub accessors.
static Code* initialize_stub() {
return Isolate::Current()->builtins()->builtin(
Builtins::KeyedStoreIC_Initialize);
Builtins::kKeyedStoreIC_Initialize);
}
Code* megamorphic_stub() {
return isolate()->builtins()->builtin(
Builtins::KeyedStoreIC_Generic);
Builtins::kKeyedStoreIC_Generic);
}
static Code* initialize_stub_strict() {
return Isolate::Current()->builtins()->builtin(
Builtins::KeyedStoreIC_Initialize_Strict);
Builtins::kKeyedStoreIC_Initialize_Strict);
}
Code* megamorphic_stub_strict() {
return isolate()->builtins()->builtin(
Builtins::KeyedStoreIC_Generic_Strict);
Builtins::kKeyedStoreIC_Generic_Strict);
}
Code* generic_stub() {
return isolate()->builtins()->builtin(
Builtins::KeyedStoreIC_Generic);
Builtins::kKeyedStoreIC_Generic);
}
Code* generic_stub_strict() {
return isolate()->builtins()->builtin(
Builtins::KeyedStoreIC_Generic_Strict);
Builtins::kKeyedStoreIC_Generic_Strict);
}
static void Clear(Address address, Code* target);

View File

@ -1033,7 +1033,7 @@ MaybeObject* LiveEdit::ReplaceFunctionCode(
shared_info->set_construct_stub(
Isolate::Current()->builtins()->builtin(
Builtins::JSConstructStubGeneric));
Builtins::kJSConstructStubGeneric));
DeoptimizeDependentFunctions(*shared_info);
Isolate::Current()->compilation_cache()->Remove(shared_info);
@ -1404,7 +1404,7 @@ static const char* DropFrames(Vector<StackFrame*> frames,
*mode = Debug::FRAME_DROPPED_IN_DEBUG_SLOT_CALL;
} else if (pre_top_frame_code ==
Isolate::Current()->builtins()->builtin(
Builtins::FrameDropper_LiveEdit)) {
Builtins::kFrameDropper_LiveEdit)) {
// OK, we can drop our own code.
*mode = Debug::FRAME_DROPPED_IN_DIRECT_CALL;
} else if (pre_top_frame_code->kind() == Code::STUB &&
@ -1430,8 +1430,7 @@ static const char* DropFrames(Vector<StackFrame*> frames,
// Make sure FixTryCatchHandler is idempotent.
ASSERT(!FixTryCatchHandler(pre_top_frame, bottom_js_frame));
Handle<Code> code(Isolate::Current()->builtins()->builtin(
Builtins::FrameDropper_LiveEdit));
Handle<Code> code = Isolate::Current()->builtins()->FrameDropper_LiveEdit();
top_frame->set_pc(code->entry());
pre_top_frame->SetCallerFp(bottom_js_frame->fp());

View File

@ -789,7 +789,7 @@ void Logger::CodeCreateEvent(LogEventsAndTags tag,
#ifdef ENABLE_LOGGING_AND_PROFILING
if (!log_->IsEnabled() || !FLAG_log_code) return;
if (code == Isolate::Current()->builtins()->builtin(
Builtins::LazyCompile))
Builtins::kLazyCompile))
return;
LogMessageBuilder msg(this);
@ -1418,7 +1418,7 @@ void Logger::LogCompiledFunctions() {
// GetScriptLineNumber call.
for (int i = 0; i < compiled_funcs_count; ++i) {
if (*code_objects[i] == Isolate::Current()->builtins()->builtin(
Builtins::LazyCompile))
Builtins::kLazyCompile))
continue;
Handle<SharedFunctionInfo> shared = sfis[i];
Handle<String> func_name(shared->DebugName());

View File

@ -247,7 +247,7 @@ class CodeFlusher {
private:
void ProcessJSFunctionCandidates() {
Code* lazy_compile = isolate_->builtins()->builtin(Builtins::LazyCompile);
Code* lazy_compile = isolate_->builtins()->builtin(Builtins::kLazyCompile);
JSFunction* candidate = jsfunction_candidates_head_;
JSFunction* next_candidate;
@ -272,7 +272,7 @@ class CodeFlusher {
void ProcessSharedFunctionInfoCandidates() {
Code* lazy_compile = isolate_->builtins()->builtin(Builtins::LazyCompile);
Code* lazy_compile = isolate_->builtins()->builtin(Builtins::kLazyCompile);
SharedFunctionInfo* candidate = shared_function_info_candidates_head_;
SharedFunctionInfo* next_candidate;
@ -570,12 +570,12 @@ class StaticMarkingVisitor : public StaticVisitorBase {
inline static bool IsCompiled(JSFunction* function) {
return function->unchecked_code() !=
Isolate::Current()->builtins()->builtin(Builtins::LazyCompile);
Isolate::Current()->builtins()->builtin(Builtins::kLazyCompile);
}
inline static bool IsCompiled(SharedFunctionInfo* function) {
return function->unchecked_code() !=
Isolate::Current()->builtins()->builtin(Builtins::LazyCompile);
Isolate::Current()->builtins()->builtin(Builtins::kLazyCompile);
}
inline static bool IsFlushable(JSFunction* function) {

View File

@ -3206,7 +3206,7 @@ void SharedFunctionInfo::set_deopt_counter(Smi* value) {
bool SharedFunctionInfo::is_compiled() {
return code() !=
Isolate::Current()->builtins()->builtin(Builtins::LazyCompile);
Isolate::Current()->builtins()->builtin(Builtins::kLazyCompile);
}
@ -3266,7 +3266,7 @@ bool JSFunction::IsOptimized() {
bool JSFunction::IsMarkedForLazyRecompilation() {
return code() == GetIsolate()->builtins()->builtin(Builtins::LazyRecompile);
return code() == GetIsolate()->builtins()->builtin(Builtins::kLazyRecompile);
}
@ -3380,7 +3380,7 @@ bool JSFunction::should_have_prototype() {
bool JSFunction::is_compiled() {
return code() != GetIsolate()->builtins()->builtin(Builtins::LazyCompile);
return code() != GetIsolate()->builtins()->builtin(Builtins::kLazyCompile);
}

View File

@ -5642,7 +5642,7 @@ void JSFunction::MarkForLazyRecompilation() {
ASSERT(shared()->allows_lazy_compilation() ||
code()->optimizable());
Builtins* builtins = GetIsolate()->builtins();
ReplaceCode(builtins->builtin(Builtins::LazyRecompile));
ReplaceCode(builtins->builtin(Builtins::kLazyRecompile));
}
@ -6022,9 +6022,9 @@ void SharedFunctionInfo::StartInobjectSlackTracking(Map* map) {
}
set_initial_map(map);
Builtins* builtins = map->heap()->isolate()->builtins();
ASSERT_EQ(builtins->builtin(Builtins::JSConstructStubGeneric),
ASSERT_EQ(builtins->builtin(Builtins::kJSConstructStubGeneric),
construct_stub());
set_construct_stub(builtins->builtin(Builtins::JSConstructStubCountdown));
set_construct_stub(builtins->builtin(Builtins::kJSConstructStubCountdown));
}
@ -6043,9 +6043,9 @@ void SharedFunctionInfo::DetachInitialMap() {
// several more GCs) CompleteInobjectSlackTracking will eventually be called.
set_initial_map(map->heap()->raw_unchecked_undefined_value());
Builtins* builtins = map->heap()->isolate()->builtins();
ASSERT_EQ(builtins->builtin(Builtins::JSConstructStubCountdown),
ASSERT_EQ(builtins->builtin(Builtins::kJSConstructStubCountdown),
*RawField(this, kConstructStubOffset));
set_construct_stub(builtins->builtin(Builtins::JSConstructStubGeneric));
set_construct_stub(builtins->builtin(Builtins::kJSConstructStubGeneric));
// It is safe to clear the flag: it will be set again if the map is live.
set_live_objects_may_exist(false);
}
@ -6059,9 +6059,9 @@ void SharedFunctionInfo::AttachInitialMap(Map* map) {
// Resume inobject slack tracking.
set_initial_map(map);
Builtins* builtins = map->heap()->isolate()->builtins();
ASSERT_EQ(builtins->builtin(Builtins::JSConstructStubGeneric),
ASSERT_EQ(builtins->builtin(Builtins::kJSConstructStubGeneric),
*RawField(this, kConstructStubOffset));
set_construct_stub(builtins->builtin(Builtins::JSConstructStubCountdown));
set_construct_stub(builtins->builtin(Builtins::kJSConstructStubCountdown));
// The map survived the gc, so there may be objects referencing it.
set_live_objects_may_exist(true);
}
@ -6093,9 +6093,9 @@ void SharedFunctionInfo::CompleteInobjectSlackTracking() {
Heap* heap = map->heap();
set_initial_map(heap->undefined_value());
Builtins* builtins = heap->isolate()->builtins();
ASSERT_EQ(builtins->builtin(Builtins::JSConstructStubCountdown),
ASSERT_EQ(builtins->builtin(Builtins::kJSConstructStubCountdown),
construct_stub());
set_construct_stub(builtins->builtin(Builtins::JSConstructStubGeneric));
set_construct_stub(builtins->builtin(Builtins::kJSConstructStubGeneric));
int slack = map->unused_property_fields();
map->TraverseTransitionTree(&GetMinInobjectSlack, &slack);

View File

@ -197,7 +197,7 @@ void RuntimeProfiler::AttemptOnStackReplacement(JSFunction* function) {
MaybeObject* maybe_check_code = check_stub.TryGetCode();
if (maybe_check_code->ToObject(&check_code)) {
Code* replacement_code =
isolate_->builtins()->builtin(Builtins::OnStackReplacement);
isolate_->builtins()->builtin(Builtins::kOnStackReplacement);
Code* unoptimized_code = shared->code();
Deoptimizer::PatchStackCheckCode(unoptimized_code,
Code::cast(check_code),

View File

@ -1811,13 +1811,13 @@ static MaybeObject* Runtime_SpecialArrayFunctions(RUNTIME_CALLING_CONVENTION) {
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(JSObject, holder, 0);
InstallBuiltin(isolate, holder, "pop", Builtins::ArrayPop);
InstallBuiltin(isolate, holder, "push", Builtins::ArrayPush);
InstallBuiltin(isolate, holder, "shift", Builtins::ArrayShift);
InstallBuiltin(isolate, holder, "unshift", Builtins::ArrayUnshift);
InstallBuiltin(isolate, holder, "slice", Builtins::ArraySlice);
InstallBuiltin(isolate, holder, "splice", Builtins::ArraySplice);
InstallBuiltin(isolate, holder, "concat", Builtins::ArrayConcat);
InstallBuiltin(isolate, holder, "pop", Builtins::kArrayPop);
InstallBuiltin(isolate, holder, "push", Builtins::kArrayPush);
InstallBuiltin(isolate, holder, "shift", Builtins::kArrayShift);
InstallBuiltin(isolate, holder, "unshift", Builtins::kArrayUnshift);
InstallBuiltin(isolate, holder, "slice", Builtins::kArraySlice);
InstallBuiltin(isolate, holder, "splice", Builtins::kArraySplice);
InstallBuiltin(isolate, holder, "concat", Builtins::kArrayConcat);
return *holder;
}
@ -7650,8 +7650,7 @@ static MaybeObject* Runtime_CompileForOnStackReplacement(
}
StackCheckStub check_stub;
Handle<Code> check_code = check_stub.GetCode();
Handle<Code> replacement_code(
isolate->builtins()->builtin(Builtins::OnStackReplacement));
Handle<Code> replacement_code = isolate->builtins()->OnStackReplacement();
Deoptimizer::RevertStackCheckCode(*unoptimized,
*check_code,
*replacement_code);

View File

@ -196,7 +196,7 @@ void ExternalReferenceTable::PopulateTable(Isolate* isolate) {
#define DEF_ENTRY_C(name, ignored) \
{ BUILTIN, \
Builtins::name, \
Builtins::k##name, \
"Builtins::" #name },
#define DEF_ENTRY_A(name, kind, state, extra) DEF_ENTRY_C(name, ignored)

View File

@ -84,7 +84,7 @@ Code* StubCache::Set(String* name, Map* map, Code* code) {
// If the primary entry has useful data in it, we retire it to the
// secondary cache before overwriting it.
if (hit != isolate_->builtins()->builtin(Builtins::Illegal)) {
if (hit != isolate_->builtins()->builtin(Builtins::kIllegal)) {
Code::Flags primary_flags = Code::RemoveTypeFromFlags(hit->flags());
int secondary_offset =
SecondaryOffset(primary->key, primary_flags, primary_offset);
@ -245,7 +245,7 @@ MaybeObject* StubCache::ComputeLoadInterceptor(String* name,
MaybeObject* StubCache::ComputeLoadNormal() {
return isolate_->builtins()->builtin(Builtins::LoadIC_Normal);
return isolate_->builtins()->builtin(Builtins::kLoadIC_Normal);
}
@ -659,8 +659,8 @@ MaybeObject* StubCache::ComputeKeyedLoadOrStoreExternalArray(
MaybeObject* StubCache::ComputeStoreNormal(StrictModeFlag strict_mode) {
return isolate_->builtins()->builtin((strict_mode == kStrictMode)
? Builtins::StoreIC_Normal_Strict
: Builtins::StoreIC_Normal);
? Builtins::kStoreIC_Normal_Strict
: Builtins::kStoreIC_Normal);
}
@ -1221,12 +1221,12 @@ void StubCache::Clear() {
for (int i = 0; i < kPrimaryTableSize; i++) {
primary_[i].key = isolate_->heap()->empty_string();
primary_[i].value = isolate_->builtins()->builtin(
Builtins::Illegal);
Builtins::kIllegal);
}
for (int j = 0; j < kSecondaryTableSize; j++) {
secondary_[j].key = isolate_->heap()->empty_string();
secondary_[j].value = isolate_->builtins()->builtin(
Builtins::Illegal);
Builtins::kIllegal);
}
}

View File

@ -335,7 +335,7 @@ ZoneMapList* TypeFeedbackOracle::CollectReceiverTypes(int position,
Handle<Object> object = GetInfo(position);
if (object->IsUndefined() || object->IsSmi()) return NULL;
if (*object == isolate->builtins()->builtin(Builtins::StoreIC_GlobalProxy)) {
if (*object == isolate->builtins()->builtin(Builtins::kStoreIC_GlobalProxy)) {
// TODO(fschneider): We could collect the maps and signal that
// we need a generic store (or load) here.
ASSERT(Handle<Code>::cast(object)->ic_state() == MEGAMORPHIC);

View File

@ -98,8 +98,8 @@ void Builtins::Generate_JSConstructCall(MacroAssembler* masm) {
// Set expected number of arguments to zero (not changing rax).
__ movq(rbx, Immediate(0));
__ GetBuiltinEntry(rdx, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR);
__ Jump(Handle<Code>(masm->isolate()->builtins()->builtin(
ArgumentsAdaptorTrampoline)), RelocInfo::CODE_TARGET);
__ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(),
RelocInfo::CODE_TARGET);
}
@ -339,8 +339,8 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
// Call the function.
if (is_api_function) {
__ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
Handle<Code> code = Handle<Code>(masm->isolate()->builtins()->builtin(
Builtins::HandleApiCallConstruct));
Handle<Code> code =
masm->isolate()->builtins()->HandleApiCallConstruct();
ParameterCount expected(0);
__ InvokeCode(code, expected, expected,
RelocInfo::CODE_TARGET, CALL_FUNCTION);
@ -493,8 +493,8 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
// Invoke the code.
if (is_construct) {
// Expects rdi to hold function pointer.
__ Call(Handle<Code>(masm->isolate()->builtins()->builtin(
Builtins::JSConstructCall)), RelocInfo::CODE_TARGET);
__ Call(masm->isolate()->builtins()->JSConstructCall(),
RelocInfo::CODE_TARGET);
} else {
ParameterCount actual(rax);
// Function must be in rdi.
@ -734,8 +734,8 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
__ j(not_zero, &function);
__ Set(rbx, 0);
__ GetBuiltinEntry(rdx, Builtins::CALL_NON_FUNCTION);
__ Jump(Handle<Code>(masm->isolate()->builtins()->builtin(
ArgumentsAdaptorTrampoline)), RelocInfo::CODE_TARGET);
__ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(),
RelocInfo::CODE_TARGET);
__ bind(&function);
}
@ -749,8 +749,8 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
__ movq(rdx, FieldOperand(rdi, JSFunction::kCodeEntryOffset));
__ cmpq(rax, rbx);
__ j(not_equal,
Handle<Code>(masm->isolate()->builtins()->builtin(
ArgumentsAdaptorTrampoline)), RelocInfo::CODE_TARGET);
masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(),
RelocInfo::CODE_TARGET);
ParameterCount expected(0);
__ InvokeCode(rdx, expected, expected, JUMP_FUNCTION);
@ -864,8 +864,8 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) {
__ movq(rdx, Operand(rbp, kArgumentsOffset)); // load arguments
// Use inline caching to speed up access to arguments.
Handle<Code> ic(masm->isolate()->builtins()->builtin(
Builtins::KeyedLoadIC_Initialize));
Handle<Code> ic =
masm->isolate()->builtins()->KeyedLoadIC_Initialize();
__ Call(ic, RelocInfo::CODE_TARGET);
// It is important that we do not have a test instruction after the
// call. A test instruction after the call is used to indicate that
@ -1267,9 +1267,8 @@ void Builtins::Generate_ArrayCode(MacroAssembler* masm) {
// Jump to the generic array code in case the specialized code cannot handle
// the construction.
__ bind(&generic_array_code);
Code* code =
masm->isolate()->builtins()->builtin(Builtins::ArrayCodeGeneric);
Handle<Code> array_code(code);
Handle<Code> array_code =
masm->isolate()->builtins()->ArrayCodeGeneric();
__ Jump(array_code, RelocInfo::CODE_TARGET);
}
@ -1302,9 +1301,8 @@ void Builtins::Generate_ArrayConstructCode(MacroAssembler* masm) {
// Jump to the generic construct code in case the specialized code cannot
// handle the construction.
__ bind(&generic_constructor);
Code* code =
masm->isolate()->builtins()->builtin(Builtins::JSConstructStubGeneric);
Handle<Code> generic_construct_stub(code);
Handle<Code> generic_construct_stub =
masm->isolate()->builtins()->JSConstructStubGeneric();
__ Jump(generic_construct_stub, RelocInfo::CODE_TARGET);
}

View File

@ -3332,8 +3332,8 @@ void CallFunctionStub::Generate(MacroAssembler* masm) {
__ Set(rax, argc_);
__ Set(rbx, 0);
__ GetBuiltinEntry(rdx, Builtins::CALL_NON_FUNCTION);
Handle<Code> adaptor(Isolate::Current()->builtins()->builtin(
Builtins::ArgumentsAdaptorTrampoline));
Handle<Code> adaptor =
Isolate::Current()->builtins()->ArgumentsAdaptorTrampoline();
__ Jump(adaptor, RelocInfo::CODE_TARGET);
}
@ -3656,11 +3656,11 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
// directly in the code, because the builtin stubs may not have been
// generated yet at the time this code is generated.
if (is_construct) {
ExternalReference construct_entry(Builtins::JSConstructEntryTrampoline,
ExternalReference construct_entry(Builtins::kJSConstructEntryTrampoline,
isolate);
__ Load(rax, construct_entry);
} else {
ExternalReference entry(Builtins::JSEntryTrampoline, isolate);
ExternalReference entry(Builtins::kJSEntryTrampoline, isolate);
__ Load(rax, entry);
}
__ lea(kScratchRegister, FieldOperand(rax, Code::kHeaderSize));

View File

@ -2561,8 +2561,7 @@ void CodeGenerator::CallApplyLazy(Expression* applicand,
__ j(not_equal, &build_args);
__ movq(rcx, FieldOperand(rax, JSFunction::kCodeEntryOffset));
__ subq(rcx, Immediate(Code::kHeaderSize - kHeapObjectTag));
Handle<Code> apply_code(Isolate::Current()->builtins()->builtin(
Builtins::FunctionApply));
Handle<Code> apply_code = Isolate::Current()->builtins()->FunctionApply();
__ Cmp(rcx, apply_code);
__ j(not_equal, &build_args);
@ -7999,8 +7998,7 @@ void DeferredReferenceGetNamedValue::Generate() {
__ movq(rax, receiver_);
}
__ Move(rcx, name_);
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
Builtins::LoadIC_Initialize));
Handle<Code> ic = Isolate::Current()->builtins()->LoadIC_Initialize();
__ Call(ic, RelocInfo::CODE_TARGET);
// The call must be followed by a test rax instruction to indicate
// that the inobject property case was inlined.
@ -8066,8 +8064,7 @@ void DeferredReferenceGetKeyedValue::Generate() {
// it in the IC initialization code and patch the movq instruction.
// This means that we cannot allow test instructions after calls to
// KeyedLoadIC stubs in other places.
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
Builtins::KeyedLoadIC_Initialize));
Handle<Code> ic = Isolate::Current()->builtins()->KeyedLoadIC_Initialize();
__ Call(ic, RelocInfo::CODE_TARGET);
// The delta from the start of the map-compare instruction to the
// test instruction. We use masm_-> directly here instead of the __
@ -8164,8 +8161,8 @@ void DeferredReferenceSetKeyedValue::Generate() {
// Call the IC stub.
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
(strict_mode_ == kStrictMode) ? Builtins::KeyedStoreIC_Initialize_Strict
: Builtins::KeyedStoreIC_Initialize));
(strict_mode_ == kStrictMode) ? Builtins::kKeyedStoreIC_Initialize_Strict
: Builtins::kKeyedStoreIC_Initialize));
__ Call(ic, RelocInfo::CODE_TARGET);
// The delta from the start of the map-compare instructions (initial movq)
// to the test instruction. We use masm_-> directly here instead of the

View File

@ -187,7 +187,7 @@ void Deoptimizer::DeoptimizeFunction(JSFunction* function) {
// Add the deoptimizing code to the list.
DeoptimizingCodeListNode* node = new DeoptimizingCodeListNode(code);
DeoptimizerData* data = Isolate::Current()->deoptimizer_data();
DeoptimizerData* data = code->GetIsolate()->deoptimizer_data();
node->set_next(data->deoptimizing_code_list_);
data->deoptimizing_code_list_ = node;
@ -389,8 +389,8 @@ void Deoptimizer::DoComputeOsrOutputFrame() {
optimized_code_->entry() + pc_offset);
output_[0]->SetPc(pc);
}
Code* continuation = Isolate::Current()->builtins()->builtin(
Builtins::NotifyOSR);
Code* continuation =
function->GetIsolate()->builtins()->builtin(Builtins::kNotifyOSR);
output_[0]->SetContinuation(
reinterpret_cast<intptr_t>(continuation->entry()));
@ -562,9 +562,8 @@ void Deoptimizer::DoComputeFrame(TranslationIterator* iterator,
// Set the continuation for the topmost frame.
if (is_topmost) {
Code* continuation = (bailout_type_ == EAGER)
? Isolate::Current()->builtins()->builtin(Builtins::NotifyDeoptimized)
: Isolate::Current()->builtins()->builtin(
Builtins::NotifyLazyDeoptimized);
? isolate_->builtins()->builtin(Builtins::kNotifyDeoptimized)
: isolate_->builtins()->builtin(Builtins::kNotifyLazyDeoptimized);
output_frame->SetContinuation(
reinterpret_cast<intptr_t>(continuation->entry()));
}

View File

@ -740,9 +740,9 @@ void FullCodeGenerator::EmitDeclaration(Variable* variable,
prop->key()->AsLiteral()->handle()->IsSmi());
__ Move(rcx, prop->key()->AsLiteral()->handle());
Handle<Code> ic(isolate()->builtins()->builtin(is_strict_mode()
? Builtins::KeyedStoreIC_Initialize_Strict
: Builtins::KeyedStoreIC_Initialize));
Handle<Code> ic = is_strict_mode()
? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
: isolate()->builtins()->KeyedStoreIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
}
}
@ -1121,8 +1121,7 @@ void FullCodeGenerator::EmitLoadGlobalSlotCheckExtensions(
// load IC call.
__ movq(rax, GlobalObjectOperand());
__ Move(rcx, slot->var()->name());
Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::LoadIC_Initialize));
Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize();
RelocInfo::Mode mode = (typeof_state == INSIDE_TYPEOF)
? RelocInfo::CODE_TARGET
: RelocInfo::CODE_TARGET_CONTEXT;
@ -1205,8 +1204,8 @@ void FullCodeGenerator::EmitDynamicLoadFromSlotFastCase(
ContextSlotOperandCheckExtensions(obj_proxy->var()->AsSlot(),
slow));
__ Move(rax, key_literal->handle());
Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::KeyedLoadIC_Initialize));
Handle<Code> ic =
isolate()->builtins()->KeyedLoadIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
__ jmp(done);
}
@ -1229,8 +1228,7 @@ void FullCodeGenerator::EmitVariableLoad(Variable* var) {
// object on the stack.
__ Move(rcx, var->name());
__ movq(rax, GlobalObjectOperand());
Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::LoadIC_Initialize));
Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET_CONTEXT);
context()->Plug(rax);
@ -1293,8 +1291,7 @@ void FullCodeGenerator::EmitVariableLoad(Variable* var) {
__ Move(rax, key_literal->handle());
// Do a keyed property load.
Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::KeyedLoadIC_Initialize));
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
context()->Plug(rax);
}
@ -1405,8 +1402,7 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
__ Move(rcx, key->handle());
__ movq(rdx, Operand(rsp, 0));
if (property->emit_store()) {
Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::StoreIC_Initialize));
Handle<Code> ic = isolate()->builtins()->StoreIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
PrepareForBailoutForId(key->id(), NO_REGISTERS);
}
@ -1650,16 +1646,14 @@ void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
SetSourcePosition(prop->position());
Literal* key = prop->key()->AsLiteral();
__ Move(rcx, key->handle());
Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::LoadIC_Initialize));
Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
}
void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
SetSourcePosition(prop->position());
Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::KeyedLoadIC_Initialize));
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
}
@ -1765,9 +1759,9 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, int bailout_ast_id) {
__ movq(rdx, rax);
__ pop(rax); // Restore value.
__ Move(rcx, prop->key()->AsLiteral()->handle());
Handle<Code> ic(isolate()->builtins()->builtin(
is_strict_mode() ? Builtins::StoreIC_Initialize_Strict
: Builtins::StoreIC_Initialize));
Handle<Code> ic = is_strict_mode()
? isolate()->builtins()->StoreIC_Initialize_Strict()
: isolate()->builtins()->StoreIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
break;
}
@ -1788,9 +1782,9 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, int bailout_ast_id) {
__ pop(rdx);
}
__ pop(rax); // Restore value.
Handle<Code> ic(isolate()->builtins()->builtin(
is_strict_mode() ? Builtins::KeyedStoreIC_Initialize_Strict
: Builtins::KeyedStoreIC_Initialize));
Handle<Code> ic = is_strict_mode()
? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
: isolate()->builtins()->KeyedStoreIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
break;
}
@ -1814,9 +1808,9 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var,
// rcx, and the global object on the stack.
__ Move(rcx, var->name());
__ movq(rdx, GlobalObjectOperand());
Handle<Code> ic(isolate()->builtins()->builtin(is_strict_mode()
? Builtins::StoreIC_Initialize_Strict
: Builtins::StoreIC_Initialize));
Handle<Code> ic = is_strict_mode()
? isolate()->builtins()->StoreIC_Initialize_Strict()
: isolate()->builtins()->StoreIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET_CONTEXT);
} else if (op == Token::INIT_CONST) {
@ -1917,9 +1911,9 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
} else {
__ pop(rdx);
}
Handle<Code> ic(isolate()->builtins()->builtin(
is_strict_mode() ? Builtins::StoreIC_Initialize_Strict
: Builtins::StoreIC_Initialize));
Handle<Code> ic = is_strict_mode()
? isolate()->builtins()->StoreIC_Initialize_Strict()
: isolate()->builtins()->StoreIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
// If the assignment ends an initialization block, revert to fast case.
@ -1957,9 +1951,9 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
}
// Record source code position before IC call.
SetSourcePosition(expr->position());
Handle<Code> ic(isolate()->builtins()->builtin(
is_strict_mode() ? Builtins::KeyedStoreIC_Initialize_Strict
: Builtins::KeyedStoreIC_Initialize));
Handle<Code> ic = is_strict_mode()
? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
: isolate()->builtins()->KeyedStoreIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
// If the assignment ends an initialization block, revert to fast case.
@ -2238,8 +2232,7 @@ void FullCodeGenerator::VisitCall(Call* expr) {
// Record source code position for IC call.
SetSourcePosition(prop->position());
Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::KeyedLoadIC_Initialize));
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
// Push result (function).
__ push(rax);
@ -2307,8 +2300,8 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
__ Set(rax, arg_count);
__ movq(rdi, Operand(rsp, arg_count * kPointerSize));
Handle<Code> construct_builtin(isolate()->builtins()->builtin(
Builtins::JSConstructCall));
Handle<Code> construct_builtin =
isolate()->builtins()->JSConstructCall();
__ Call(construct_builtin, RelocInfo::CONSTRUCT_CALL);
context()->Plug(rax);
}
@ -3575,9 +3568,9 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
case NAMED_PROPERTY: {
__ Move(rcx, prop->key()->AsLiteral()->handle());
__ pop(rdx);
Handle<Code> ic(isolate()->builtins()->builtin(
is_strict_mode() ? Builtins::StoreIC_Initialize_Strict
: Builtins::StoreIC_Initialize));
Handle<Code> ic = is_strict_mode()
? isolate()->builtins()->StoreIC_Initialize_Strict()
: isolate()->builtins()->StoreIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
if (expr->is_postfix()) {
@ -3592,9 +3585,9 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
case KEYED_PROPERTY: {
__ pop(rcx);
__ pop(rdx);
Handle<Code> ic(isolate()->builtins()->builtin(
is_strict_mode() ? Builtins::KeyedStoreIC_Initialize_Strict
: Builtins::KeyedStoreIC_Initialize));
Handle<Code> ic = is_strict_mode()
? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
: isolate()->builtins()->KeyedStoreIC_Initialize();
EmitCallIC(ic, RelocInfo::CODE_TARGET);
PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
if (expr->is_postfix()) {
@ -3619,8 +3612,7 @@ void FullCodeGenerator::VisitForTypeofValue(Expression* expr) {
Comment cmnt(masm_, "Global variable");
__ Move(rcx, proxy->name());
__ movq(rax, GlobalObjectOperand());
Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::LoadIC_Initialize));
Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize();
// Use a regular load, not a contextual load, to avoid a reference
// error.
EmitCallIC(ic, RelocInfo::CODE_TARGET);

View File

@ -2101,7 +2101,7 @@ void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
ASSERT(ToRegister(instr->result()).is(rax));
__ Move(rcx, instr->name());
Handle<Code> ic(isolate()->builtins()->builtin(Builtins::LoadIC_Initialize));
Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
@ -2227,8 +2227,7 @@ void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
ASSERT(ToRegister(instr->object()).is(rdx));
ASSERT(ToRegister(instr->key()).is(rax));
Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::KeyedLoadIC_Initialize));
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
@ -2782,8 +2781,7 @@ void LCodeGen::DoCallNew(LCallNew* instr) {
ASSERT(ToRegister(instr->InputAt(0)).is(rdi));
ASSERT(ToRegister(instr->result()).is(rax));
Handle<Code> builtin(isolate()->builtins()->builtin(
Builtins::JSConstructCall));
Handle<Code> builtin = isolate()->builtins()->JSConstructCall();
__ Set(rax, instr->arity());
CallCode(builtin, RelocInfo::CONSTRUCT_CALL, instr);
}
@ -2829,9 +2827,9 @@ void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
ASSERT(ToRegister(instr->value()).is(rax));
__ Move(rcx, instr->hydrogen()->name());
Handle<Code> ic(isolate()->builtins()->builtin(
info_->is_strict() ? Builtins::StoreIC_Initialize_Strict
: Builtins::StoreIC_Initialize));
Handle<Code> ic = info_->is_strict()
? isolate()->builtins()->StoreIC_Initialize_Strict()
: isolate()->builtins()->StoreIC_Initialize();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
@ -2900,9 +2898,9 @@ void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
ASSERT(ToRegister(instr->key()).is(rcx));
ASSERT(ToRegister(instr->value()).is(rax));
Handle<Code> ic(isolate()->builtins()->builtin(
info_->is_strict() ? Builtins::KeyedStoreIC_Initialize_Strict
: Builtins::KeyedStoreIC_Initialize));
Handle<Code> ic = info_->is_strict()
? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
: isolate()->builtins()->KeyedStoreIC_Initialize();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}

View File

@ -1910,9 +1910,7 @@ void MacroAssembler::InvokePrologue(const ParameterCount& expected,
}
if (!definitely_matches) {
Handle<Code> adaptor =
Handle<Code>(Isolate::Current()->builtins()->builtin(
Builtins::ArgumentsAdaptorTrampoline));
Handle<Code> adaptor = isolate()->builtins()->ArgumentsAdaptorTrampoline();
if (!code_constant.is_null()) {
movq(rdx, code_constant, RelocInfo::EMBEDDED_OBJECT);
addq(rdx, Immediate(Code::kHeaderSize - kHeapObjectTag));

View File

@ -185,7 +185,7 @@ void StubCache::GenerateProbe(MacroAssembler* masm,
Register scratch,
Register extra,
Register extra2) {
Isolate* isolate = Isolate::Current();
Isolate* isolate = masm->isolate();
Label miss;
USE(extra); // The register extra is not used on the X64 platform.
USE(extra2); // The register extra2 is not used on the X64 platform.
@ -256,14 +256,15 @@ void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm,
void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype(
MacroAssembler* masm, int index, Register prototype, Label* miss) {
Isolate* isolate = masm->isolate();
// Check we're still in the same context.
__ Move(prototype, Isolate::Current()->global());
__ Move(prototype, isolate->global());
__ cmpq(Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX)),
prototype);
__ j(not_equal, miss);
// Get the global function with the given index.
JSFunction* function = JSFunction::cast(
Isolate::Current()->global_context()->get(index));
JSFunction* function =
JSFunction::cast(isolate->global_context()->get(index));
// Load its initial map. The global functions all have initial maps.
__ Move(prototype, Handle<Map>(function->initial_map()));
// Load the prototype from the initial map.
@ -736,9 +737,9 @@ void StubCompiler::GenerateLoadMiss(MacroAssembler* masm, Code::Kind kind) {
ASSERT(kind == Code::LOAD_IC || kind == Code::KEYED_LOAD_IC);
Code* code = NULL;
if (kind == Code::LOAD_IC) {
code = Isolate::Current()->builtins()->builtin(Builtins::LoadIC_Miss);
code = masm->isolate()->builtins()->builtin(Builtins::kLoadIC_Miss);
} else {
code = Isolate::Current()->builtins()->builtin(Builtins::KeyedLoadIC_Miss);
code = masm->isolate()->builtins()->builtin(Builtins::kKeyedLoadIC_Miss);
}
Handle<Code> ic(code);
@ -1324,7 +1325,7 @@ void CallStubCompiler::GenerateLoadFunctionFromCell(JSGlobalPropertyCell* cell,
MaybeObject* CallStubCompiler::GenerateMissBranch() {
MaybeObject* maybe_obj = Isolate::Current()->stub_cache()->ComputeCallMiss(
MaybeObject* maybe_obj = masm()->isolate()->stub_cache()->ComputeCallMiss(
arguments().immediate(), kind_);
Object* obj;
if (!maybe_obj->ToObject(&obj)) return maybe_obj;
@ -2334,8 +2335,7 @@ MaybeObject* StoreStubCompiler::CompileStoreField(JSObject* object,
// Handle store cache miss.
__ bind(&miss);
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
Builtins::StoreIC_Miss));
Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss();
__ Jump(ic, RelocInfo::CODE_TARGET);
// Return the generated code.
@ -2386,8 +2386,7 @@ MaybeObject* StoreStubCompiler::CompileStoreCallback(JSObject* object,
// Handle store cache miss.
__ bind(&miss);
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
Builtins::StoreIC_Miss));
Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss();
__ Jump(ic, RelocInfo::CODE_TARGET);
// Return the generated code.
@ -2437,8 +2436,7 @@ MaybeObject* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver,
// Handle store cache miss.
__ bind(&miss);
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
Builtins::StoreIC_Miss));
Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss();
__ Jump(ic, RelocInfo::CODE_TARGET);
// Return the generated code.
@ -2482,8 +2480,7 @@ MaybeObject* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object,
// Handle store cache miss.
__ bind(&miss);
__ IncrementCounter(counters->named_store_global_inline_miss(), 1);
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
Builtins::StoreIC_Miss));
Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss();
__ Jump(ic, RelocInfo::CODE_TARGET);
// Return the generated code.
@ -2521,8 +2518,7 @@ MaybeObject* KeyedStoreStubCompiler::CompileStoreField(JSObject* object,
// Handle store cache miss.
__ bind(&miss);
__ DecrementCounter(counters->keyed_store_field(), 1);
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
Builtins::KeyedStoreIC_Miss));
Handle<Code> ic = masm()->isolate()->builtins()->KeyedStoreIC_Miss();
__ Jump(ic, RelocInfo::CODE_TARGET);
// Return the generated code.
@ -2579,8 +2575,7 @@ MaybeObject* KeyedStoreStubCompiler::CompileStoreSpecialized(
// Handle store cache miss.
__ bind(&miss);
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
Builtins::KeyedStoreIC_Miss));
Handle<Code> ic = masm()->isolate()->builtins()->KeyedStoreIC_Miss();
__ jmp(ic, RelocInfo::CODE_TARGET);
// Return the generated code.
@ -3158,8 +3153,8 @@ MaybeObject* ConstructStubCompiler::CompileConstructStub(JSFunction* function) {
// Jump to the generic stub in case the specialized code cannot handle the
// construction.
__ bind(&generic_stub_call);
Code* code = Isolate::Current()->builtins()->builtin(
Builtins::JSConstructStubGeneric);
Code* code =
masm()->isolate()->builtins()->builtin(Builtins::kJSConstructStubGeneric);
Handle<Code> generic_construct_stub(code);
__ Jump(generic_construct_stub, RelocInfo::CODE_TARGET);

View File

@ -1116,7 +1116,7 @@ Result VirtualFrame::CallLoadIC(RelocInfo::Mode mode) {
// Name and receiver are on the top of the frame. Both are dropped.
// The IC expects name in rcx and receiver in rax.
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
Builtins::LoadIC_Initialize));
Builtins::kLoadIC_Initialize));
Result name = Pop();
Result receiver = Pop();
PrepareForCall(0, 0);
@ -1134,7 +1134,7 @@ Result VirtualFrame::CallKeyedLoadIC(RelocInfo::Mode mode) {
MoveResultsToRegisters(&key, &receiver, rax, rdx);
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
Builtins::KeyedLoadIC_Initialize));
Builtins::kKeyedLoadIC_Initialize));
return RawCallCodeObject(ic, mode);
}
@ -1145,8 +1145,8 @@ Result VirtualFrame::CallStoreIC(Handle<String> name,
// Value and (if not contextual) receiver are on top of the frame.
// The IC expects name in rcx, value in rax, and receiver in rdx.
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
(strict_mode == kStrictMode) ? Builtins::StoreIC_Initialize_Strict
: Builtins::StoreIC_Initialize));
(strict_mode == kStrictMode) ? Builtins::kStoreIC_Initialize_Strict
: Builtins::kStoreIC_Initialize));
Result value = Pop();
RelocInfo::Mode mode;
if (is_contextual) {
@ -1211,8 +1211,8 @@ Result VirtualFrame::CallKeyedStoreIC(StrictModeFlag strict_mode) {
}
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
(strict_mode == kStrictMode) ? Builtins::KeyedStoreIC_Initialize_Strict
: Builtins::KeyedStoreIC_Initialize));
(strict_mode == kStrictMode) ? Builtins::kKeyedStoreIC_Initialize_Strict
: Builtins::kKeyedStoreIC_Initialize));
return RawCallCodeObject(ic, RelocInfo::CODE_TARGET);
}
@ -1260,7 +1260,7 @@ Result VirtualFrame::CallConstructor(int arg_count) {
// IC expects arg count in rax, function in rdi, and the arguments
// and receiver on the stack.
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
Builtins::JSConstructCall));
Builtins::kJSConstructCall));
// Duplicate the function before preparing the frame.
PushElementAt(arg_count);
Result function = Pop();

View File

@ -91,7 +91,7 @@ static MaybeObject* AllocateAfterFailures() {
// Test that we can allocate in old pointer space and code space.
CHECK(!heap->AllocateFixedArray(100, TENURED)->IsFailure());
CHECK(!heap->CopyCode(Isolate::Current()->builtins()->builtin(
Builtins::Illegal))->IsFailure());
Builtins::kIllegal))->IsFailure());
// Return success.
return Smi::FromInt(42);
@ -135,7 +135,7 @@ TEST(StressJS) {
// something empty.
FACTORY->NewJSObject(function);
function->ReplaceCode(Isolate::Current()->builtins()->builtin(
Builtins::EmptyFunction));
Builtins::kEmptyFunction));
// Patch the map to have an accessor for "get".
Handle<Map> map(function->initial_map());
Handle<DescriptorArray> instance_descriptors(map->instance_descriptors());

View File

@ -1022,13 +1022,13 @@ TEST(DebugStub) {
0,
v8::internal::RelocInfo::CODE_TARGET_CONTEXT,
Isolate::Current()->builtins()->builtin(
Builtins::StoreIC_DebugBreak));
Builtins::kStoreIC_DebugBreak));
CheckDebugBreakFunction(&env,
"function f3(){var a=x;}", "f3",
0,
v8::internal::RelocInfo::CODE_TARGET_CONTEXT,
Isolate::Current()->builtins()->builtin(
Builtins::LoadIC_DebugBreak));
Builtins::kLoadIC_DebugBreak));
// TODO(1240753): Make the test architecture independent or split
// parts of the debugger into architecture dependent files. This
@ -1042,7 +1042,7 @@ TEST(DebugStub) {
0,
v8::internal::RelocInfo::CODE_TARGET,
Isolate::Current()->builtins()->builtin(
Builtins::KeyedStoreIC_DebugBreak));
Builtins::kKeyedStoreIC_DebugBreak));
CheckDebugBreakFunction(
&env,
"function f5(){var index='propertyName'; var a={}; return a[index];}",
@ -1050,7 +1050,7 @@ TEST(DebugStub) {
0,
v8::internal::RelocInfo::CODE_TARGET,
Isolate::Current()->builtins()->builtin(
Builtins::KeyedLoadIC_DebugBreak));
Builtins::kKeyedLoadIC_DebugBreak));
#endif
// Check the debug break code stubs for call ICs with different number of

View File

@ -273,7 +273,7 @@ TEST(DisasmIa320) {
__ call(Operand(ebx, ecx, times_4, 10000));
__ nop();
Handle<Code> ic(Isolate::Current()->builtins()->builtin(
Builtins::LoadIC_Initialize));
Builtins::kLoadIC_Initialize));
__ call(ic, RelocInfo::CODE_TARGET);
__ nop();
__ call(FUNCTION_ADDR(DummyStaticFunction), RelocInfo::RUNTIME_ENTRY);

View File

@ -104,8 +104,8 @@ TEST(ExternalReferenceEncoder) {
isolate->stats_table()->SetCounterFunction(counter_function);
HEAP->Setup(false);
ExternalReferenceEncoder encoder;
CHECK_EQ(make_code(BUILTIN, Builtins::ArrayCode),
Encode(encoder, Builtins::ArrayCode));
CHECK_EQ(make_code(BUILTIN, Builtins::kArrayCode),
Encode(encoder, Builtins::kArrayCode));
CHECK_EQ(make_code(v8::internal::RUNTIME_FUNCTION, Runtime::kAbort),
Encode(encoder, Runtime::kAbort));
CHECK_EQ(make_code(IC_UTILITY, IC::kLoadCallbackProperty),
@ -144,8 +144,8 @@ TEST(ExternalReferenceDecoder) {
isolate->stats_table()->SetCounterFunction(counter_function);
HEAP->Setup(false);
ExternalReferenceDecoder decoder;
CHECK_EQ(AddressOf(Builtins::ArrayCode),
decoder.Decode(make_code(BUILTIN, Builtins::ArrayCode)));
CHECK_EQ(AddressOf(Builtins::kArrayCode),
decoder.Decode(make_code(BUILTIN, Builtins::kArrayCode)));
CHECK_EQ(AddressOf(Runtime::kAbort),
decoder.Decode(make_code(v8::internal::RUNTIME_FUNCTION,
Runtime::kAbort)));