Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Unified Diff: src/arm/full-codegen-arm.cc

Issue 6542061: [Isolates] Less TLS reads in parser and full codegens. (Closed)
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/full-codegen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/full-codegen-arm.cc
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc
index c97c5a4679978d3a905925074bb0c1bd3478b441..8a66ebc88bf71b858fd4c50d9b90c0fbd3fb9fb0 100644
--- a/src/arm/full-codegen-arm.cc
+++ b/src/arm/full-codegen-arm.cc
@@ -680,7 +680,7 @@ void FullCodeGenerator::EmitDeclaration(Variable* variable,
}
__ pop(r2); // Receiver.
- Handle<Code> ic(Isolate::Current()->builtins()->builtin(
+ Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::KeyedStoreIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET);
// Value in r0 is ignored (declarations are statements).
@@ -1017,7 +1017,7 @@ void FullCodeGenerator::EmitDynamicLoadFromSlotFastCase(
ContextSlotOperandCheckExtensions(obj_proxy->var()->AsSlot(),
slow));
__ mov(r0, Operand(key_literal->handle()));
- Handle<Code> ic(Isolate::Current()->builtins()->builtin(
+ Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::KeyedLoadIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET);
__ jmp(done);
@@ -1084,7 +1084,7 @@ void FullCodeGenerator::EmitLoadGlobalSlotCheckExtensions(
RelocInfo::Mode mode = (typeof_state == INSIDE_TYPEOF)
? RelocInfo::CODE_TARGET
: RelocInfo::CODE_TARGET_CONTEXT;
- Handle<Code> ic(Isolate::Current()->builtins()->builtin(
+ Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::LoadIC_Initialize));
EmitCallIC(ic, mode);
}
@@ -1103,7 +1103,7 @@ void FullCodeGenerator::EmitVariableLoad(Variable* var) {
// object (receiver) in r0.
__ ldr(r0, GlobalObjectOperand());
__ mov(r2, Operand(var->name()));
- Handle<Code> ic(Isolate::Current()->builtins()->builtin(
+ Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::LoadIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET_CONTEXT);
context()->Plug(r0);
@@ -1163,7 +1163,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::Current()->builtins()->builtin(
+ Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::KeyedLoadIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET);
context()->Plug(r0);
@@ -1259,7 +1259,7 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
VisitForAccumulatorValue(value);
__ mov(r2, Operand(key->handle()));
__ ldr(r1, MemOperand(sp));
- Handle<Code> ic(Isolate::Current()->builtins()->builtin(
+ Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::StoreIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET);
PrepareForBailoutForId(key->id(), NO_REGISTERS);
@@ -1316,11 +1316,13 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
__ mov(r2, Operand(Smi::FromInt(expr->literal_index())));
__ mov(r1, Operand(expr->constant_elements()));
__ Push(r3, r2, r1);
- if (expr->constant_elements()->map() == HEAP->fixed_cow_array_map()) {
+ if (expr->constant_elements()->map() ==
+ isolate()->heap()->fixed_cow_array_map()) {
FastCloneShallowArrayStub stub(
FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, length);
__ CallStub(&stub);
- __ IncrementCounter(COUNTERS->cow_arrays_created_stub(), 1, r1, r2);
+ __ IncrementCounter(
+ isolate()->counters()->cow_arrays_created_stub(), 1, r1, r2);
} else if (expr->depth() > 1) {
__ CallRuntime(Runtime::kCreateArrayLiteral, 3);
} else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) {
@@ -1509,7 +1511,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::Current()->builtins()->builtin(
+ Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::LoadIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET);
}
@@ -1518,7 +1520,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::Current()->builtins()->builtin(
+ Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::KeyedLoadIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET);
}
@@ -1576,7 +1578,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) {
__ mov(r1, r0);
__ pop(r0); // Restore value.
__ mov(r2, Operand(prop->key()->AsLiteral()->handle()));
- Handle<Code> ic(Isolate::Current()->builtins()->builtin(
+ Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::StoreIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET);
break;
@@ -1588,7 +1590,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) {
__ mov(r1, r0);
__ pop(r2);
__ pop(r0); // Restore value.
- Handle<Code> ic(Isolate::Current()->builtins()->builtin(
+ Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::KeyedStoreIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET);
break;
@@ -1611,7 +1613,7 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var,
// r2, and the global object in r1.
__ mov(r2, Operand(var->name()));
__ ldr(r1, GlobalObjectOperand());
- Handle<Code> ic(Isolate::Current()->builtins()->builtin(
+ Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::StoreIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET);
@@ -1701,7 +1703,7 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
__ pop(r1);
}
- Handle<Code> ic(Isolate::Current()->builtins()->builtin(
+ Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::StoreIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET);
@@ -1746,7 +1748,7 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
__ pop(r2);
}
- Handle<Code> ic(Isolate::Current()->builtins()->builtin(
+ Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::KeyedStoreIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET);
@@ -1799,7 +1801,7 @@ void FullCodeGenerator::EmitCallWithIC(Call* expr,
// Call the IC initialization code.
InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP;
Handle<Code> ic =
- ISOLATE->stub_cache()->ComputeCallInitialize(arg_count, in_loop);
+ isolate()->stub_cache()->ComputeCallInitialize(arg_count, in_loop);
EmitCallIC(ic, mode);
RecordJSReturnSite(expr);
// Restore context register.
@@ -1833,7 +1835,7 @@ void FullCodeGenerator::EmitKeyedCallWithIC(Call* expr,
// Call the IC initialization code.
InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP;
Handle<Code> ic =
- ISOLATE->stub_cache()->ComputeKeyedCallInitialize(arg_count, in_loop);
+ isolate()->stub_cache()->ComputeKeyedCallInitialize(arg_count, in_loop);
__ ldr(r2, MemOperand(sp, (arg_count + 1) * kPointerSize)); // Key.
EmitCallIC(ic, mode);
RecordJSReturnSite(expr);
@@ -1996,7 +1998,7 @@ void FullCodeGenerator::VisitCall(Call* expr) {
SetSourcePosition(prop->position());
__ pop(r1); // We do not need to keep the receiver.
- Handle<Code> ic(Isolate::Current()->builtins()->builtin(
+ Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::KeyedLoadIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET);
__ ldr(r1, GlobalObjectOperand());
@@ -2013,7 +2015,7 @@ void FullCodeGenerator::VisitCall(Call* expr) {
// also use the fast code generator.
FunctionLiteral* lit = fun->AsFunctionLiteral();
if (lit != NULL &&
- lit->name()->Equals(HEAP->empty_string()) &&
+ lit->name()->Equals(isolate()->heap()->empty_string()) &&
loop_depth() == 0) {
lit->set_try_full_codegen(true);
}
@@ -2062,7 +2064,7 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
__ mov(r0, Operand(arg_count));
__ ldr(r1, MemOperand(sp, arg_count * kPointerSize));
- Handle<Code> construct_builtin(Isolate::Current()->builtins()->builtin(
+ Handle<Code> construct_builtin(isolate()->builtins()->builtin(
Builtins::JSConstructCall));
__ Call(construct_builtin, RelocInfo::CONSTRUCT_CALL);
context()->Plug(r0);
@@ -2458,7 +2460,7 @@ void FullCodeGenerator::EmitRandomHeapNumber(ZoneList<Expression*>* args) {
// Convert 32 random bits in r0 to 0.(32 random bits) in a double
// by computing:
// ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)).
- if (Isolate::Current()->cpu_features()->IsSupported(VFP3)) {
+ if (isolate()->cpu_features()->IsSupported(VFP3)) {
__ PrepareCallCFunction(0, r1);
__ CallCFunction(ExternalReference::random_uint32_function(), 0);
@@ -2800,7 +2802,7 @@ void FullCodeGenerator::EmitGetFromCache(ZoneList<Expression*>* args) {
int cache_id = Smi::cast(*(args->at(0)->AsLiteral()->handle()))->value();
Handle<FixedArray> jsfunction_result_caches(
- Isolate::Current()->global_context()->jsfunction_result_caches());
+ isolate()->global_context()->jsfunction_result_caches());
if (jsfunction_result_caches->length() <= cache_id) {
__ Abort("Attempt to use undefined cache.");
__ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
@@ -2948,7 +2950,7 @@ void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
// Call the JS runtime function.
__ mov(r2, Operand(expr->name()));
Handle<Code> ic =
- ISOLATE->stub_cache()->ComputeCallInitialize(arg_count, NOT_IN_LOOP);
+ isolate()->stub_cache()->ComputeCallInitialize(arg_count, NOT_IN_LOOP);
EmitCallIC(ic, RelocInfo::CODE_TARGET);
// Restore context register.
__ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
@@ -3232,7 +3234,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
case NAMED_PROPERTY: {
__ mov(r2, Operand(prop->key()->AsLiteral()->handle()));
__ pop(r1);
- Handle<Code> ic(Isolate::Current()->builtins()->builtin(
+ Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::StoreIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET);
if (expr->is_postfix()) {
@@ -3247,7 +3249,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
case KEYED_PROPERTY: {
__ pop(r1); // Key.
__ pop(r2); // Receiver.
- Handle<Code> ic(Isolate::Current()->builtins()->builtin(
+ Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::KeyedStoreIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET);
if (expr->is_postfix()) {
@@ -3271,7 +3273,7 @@ void FullCodeGenerator::VisitForTypeofValue(Expression* expr) {
Comment cmnt(masm_, "Global variable");
__ ldr(r0, GlobalObjectOperand());
__ mov(r2, Operand(proxy->name()));
- Handle<Code> ic(Isolate::Current()->builtins()->builtin(
+ Handle<Code> ic(isolate()->builtins()->builtin(
Builtins::LoadIC_Initialize));
// Use a regular load, not a contextual load, to avoid a reference
// error.
@@ -3325,14 +3327,14 @@ bool FullCodeGenerator::TryLiteralCompare(Token::Value op,
}
PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
- if (check->Equals(HEAP->number_symbol())) {
+ if (check->Equals(isolate()->heap()->number_symbol())) {
__ tst(r0, Operand(kSmiTagMask));
__ b(eq, if_true);
__ ldr(r0, FieldMemOperand(r0, HeapObject::kMapOffset));
__ LoadRoot(ip, Heap::kHeapNumberMapRootIndex);
__ cmp(r0, ip);
Split(eq, if_true, if_false, fall_through);
- } else if (check->Equals(HEAP->string_symbol())) {
+ } else if (check->Equals(isolate()->heap()->string_symbol())) {
__ tst(r0, Operand(kSmiTagMask));
__ b(eq, if_false);
// Check for undetectable objects => false.
@@ -3344,14 +3346,14 @@ bool FullCodeGenerator::TryLiteralCompare(Token::Value op,
__ ldrb(r1, FieldMemOperand(r0, Map::kInstanceTypeOffset));
__ cmp(r1, Operand(FIRST_NONSTRING_TYPE));
Split(lt, if_true, if_false, fall_through);
- } else if (check->Equals(HEAP->boolean_symbol())) {
+ } else if (check->Equals(isolate()->heap()->boolean_symbol())) {
__ LoadRoot(ip, Heap::kTrueValueRootIndex);
__ cmp(r0, ip);
__ b(eq, if_true);
__ LoadRoot(ip, Heap::kFalseValueRootIndex);
__ cmp(r0, ip);
Split(eq, if_true, if_false, fall_through);
- } else if (check->Equals(HEAP->undefined_symbol())) {
+ } else if (check->Equals(isolate()->heap()->undefined_symbol())) {
__ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
__ cmp(r0, ip);
__ b(eq, if_true);
@@ -3363,7 +3365,7 @@ bool FullCodeGenerator::TryLiteralCompare(Token::Value op,
__ and_(r1, r1, Operand(1 << Map::kIsUndetectable));
__ cmp(r1, Operand(1 << Map::kIsUndetectable));
Split(eq, if_true, if_false, fall_through);
- } else if (check->Equals(HEAP->function_symbol())) {
+ } else if (check->Equals(isolate()->heap()->function_symbol())) {
__ tst(r0, Operand(kSmiTagMask));
__ b(eq, if_false);
__ CompareObjectType(r0, r1, r0, JS_FUNCTION_TYPE);
@@ -3371,7 +3373,7 @@ bool FullCodeGenerator::TryLiteralCompare(Token::Value op,
// Regular expressions => 'function' (they are callable).
__ CompareInstanceType(r1, r0, JS_REGEXP_TYPE);
Split(eq, if_true, if_false, fall_through);
- } else if (check->Equals(HEAP->object_symbol())) {
+ } else if (check->Equals(isolate()->heap()->object_symbol())) {
__ tst(r0, Operand(kSmiTagMask));
__ b(eq, if_false);
__ LoadRoot(ip, Heap::kNullValueRootIndex);
« no previous file with comments | « no previous file | src/full-codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698