| Index: src/arm/full-codegen-arm.cc
|
| ===================================================================
|
| --- src/arm/full-codegen-arm.cc (revision 7563)
|
| +++ src/arm/full-codegen-arm.cc (working copy)
|
| @@ -565,7 +565,7 @@
|
| void FullCodeGenerator::DoTest(Label* if_true,
|
| Label* if_false,
|
| Label* fall_through) {
|
| - if (CpuFeatures::IsSupported(VFP3)) {
|
| + if (Isolate::Current()->cpu_features()->IsSupported(VFP3)) {
|
| CpuFeatures::Scope scope(VFP3);
|
| // Emit the inlined tests assumed by the stub.
|
| __ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
|
| @@ -790,9 +790,9 @@
|
| prop->key()->AsLiteral()->handle()->IsSmi());
|
| __ mov(r1, Operand(prop->key()->AsLiteral()->handle()));
|
|
|
| - Handle<Code> ic(Builtins::builtin(
|
| - is_strict_mode() ? Builtins::KeyedStoreIC_Initialize_Strict
|
| - : Builtins::KeyedStoreIC_Initialize));
|
| + Handle<Code> ic(isolate()->builtins()->builtin(is_strict_mode()
|
| + ? Builtins::KeyedStoreIC_Initialize_Strict
|
| + : Builtins::KeyedStoreIC_Initialize));
|
| EmitCallIC(ic, RelocInfo::CODE_TARGET);
|
| // Value in r0 is ignored (declarations are statements).
|
| }
|
| @@ -1195,7 +1195,8 @@
|
| ContextSlotOperandCheckExtensions(obj_proxy->var()->AsSlot(),
|
| slow));
|
| __ mov(r0, Operand(key_literal->handle()));
|
| - Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
|
| + Handle<Code> ic(isolate()->builtins()->builtin(
|
| + Builtins::KeyedLoadIC_Initialize));
|
| EmitCallIC(ic, RelocInfo::CODE_TARGET);
|
| __ jmp(done);
|
| }
|
| @@ -1261,7 +1262,8 @@
|
| RelocInfo::Mode mode = (typeof_state == INSIDE_TYPEOF)
|
| ? RelocInfo::CODE_TARGET
|
| : RelocInfo::CODE_TARGET_CONTEXT;
|
| - Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
|
| + Handle<Code> ic(isolate()->builtins()->builtin(
|
| + Builtins::LoadIC_Initialize));
|
| EmitCallIC(ic, mode);
|
| }
|
|
|
| @@ -1279,7 +1281,8 @@
|
| // object (receiver) in r0.
|
| __ ldr(r0, GlobalObjectOperand());
|
| __ mov(r2, Operand(var->name()));
|
| - Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
|
| + Handle<Code> ic(isolate()->builtins()->builtin(
|
| + Builtins::LoadIC_Initialize));
|
| EmitCallIC(ic, RelocInfo::CODE_TARGET_CONTEXT);
|
| context()->Plug(r0);
|
|
|
| @@ -1338,7 +1341,8 @@
|
| __ mov(r0, Operand(key_literal->handle()));
|
|
|
| // Call keyed load IC. It has arguments key and receiver in r0 and r1.
|
| - Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
|
| + Handle<Code> ic(isolate()->builtins()->builtin(
|
| + Builtins::KeyedLoadIC_Initialize));
|
| EmitCallIC(ic, RelocInfo::CODE_TARGET);
|
| context()->Plug(r0);
|
| }
|
| @@ -1441,7 +1445,8 @@
|
| VisitForAccumulatorValue(value);
|
| __ mov(r2, Operand(key->handle()));
|
| __ ldr(r1, MemOperand(sp));
|
| - Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
|
| + Handle<Code> ic(isolate()->builtins()->builtin(
|
| + Builtins::StoreIC_Initialize));
|
| EmitCallIC(ic, RelocInfo::CODE_TARGET);
|
| PrepareForBailoutForId(key->id(), NO_REGISTERS);
|
| } else {
|
| @@ -1499,11 +1504,13 @@
|
| __ 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) {
|
| @@ -1689,7 +1696,8 @@
|
| 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(Builtins::builtin(Builtins::LoadIC_Initialize));
|
| + Handle<Code> ic(isolate()->builtins()->builtin(
|
| + Builtins::LoadIC_Initialize));
|
| EmitCallIC(ic, RelocInfo::CODE_TARGET);
|
| }
|
|
|
| @@ -1697,7 +1705,8 @@
|
| 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(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
|
| + Handle<Code> ic(isolate()->builtins()->builtin(
|
| + Builtins::KeyedLoadIC_Initialize));
|
| EmitCallIC(ic, RelocInfo::CODE_TARGET);
|
| }
|
|
|
| @@ -1842,7 +1851,7 @@
|
| __ mov(r1, r0);
|
| __ pop(r0); // Restore value.
|
| __ mov(r2, Operand(prop->key()->AsLiteral()->handle()));
|
| - Handle<Code> ic(Builtins::builtin(
|
| + Handle<Code> ic(isolate()->builtins()->builtin(
|
| is_strict_mode() ? Builtins::StoreIC_Initialize_Strict
|
| : Builtins::StoreIC_Initialize));
|
| EmitCallIC(ic, RelocInfo::CODE_TARGET);
|
| @@ -1865,7 +1874,7 @@
|
| __ pop(r2);
|
| }
|
| __ pop(r0); // Restore value.
|
| - Handle<Code> ic(Builtins::builtin(
|
| + Handle<Code> ic(isolate()->builtins()->builtin(
|
| is_strict_mode() ? Builtins::KeyedStoreIC_Initialize_Strict
|
| : Builtins::KeyedStoreIC_Initialize));
|
| EmitCallIC(ic, RelocInfo::CODE_TARGET);
|
| @@ -1891,7 +1900,7 @@
|
| // r2, and the global object in r1.
|
| __ mov(r2, Operand(var->name()));
|
| __ ldr(r1, GlobalObjectOperand());
|
| - Handle<Code> ic(Builtins::builtin(
|
| + Handle<Code> ic(isolate()->builtins()->builtin(
|
| is_strict_mode() ? Builtins::StoreIC_Initialize_Strict
|
| : Builtins::StoreIC_Initialize));
|
| EmitCallIC(ic, RelocInfo::CODE_TARGET_CONTEXT);
|
| @@ -2002,7 +2011,7 @@
|
| __ pop(r1);
|
| }
|
|
|
| - Handle<Code> ic(Builtins::builtin(
|
| + Handle<Code> ic(isolate()->builtins()->builtin(
|
| is_strict_mode() ? Builtins::StoreIC_Initialize_Strict
|
| : Builtins::StoreIC_Initialize));
|
| EmitCallIC(ic, RelocInfo::CODE_TARGET);
|
| @@ -2048,7 +2057,7 @@
|
| __ pop(r2);
|
| }
|
|
|
| - Handle<Code> ic(Builtins::builtin(
|
| + Handle<Code> ic(isolate()->builtins()->builtin(
|
| is_strict_mode() ? Builtins::KeyedStoreIC_Initialize_Strict
|
| : Builtins::KeyedStoreIC_Initialize));
|
| EmitCallIC(ic, RelocInfo::CODE_TARGET);
|
| @@ -2101,7 +2110,8 @@
|
| SetSourcePosition(expr->position());
|
| // Call the IC initialization code.
|
| InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP;
|
| - Handle<Code> ic = StubCache::ComputeCallInitialize(arg_count, in_loop);
|
| + Handle<Code> ic =
|
| + isolate()->stub_cache()->ComputeCallInitialize(arg_count, in_loop);
|
| EmitCallIC(ic, mode);
|
| RecordJSReturnSite(expr);
|
| // Restore context register.
|
| @@ -2134,7 +2144,8 @@
|
| SetSourcePosition(expr->position());
|
| // Call the IC initialization code.
|
| InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP;
|
| - Handle<Code> ic = StubCache::ComputeKeyedCallInitialize(arg_count, in_loop);
|
| + Handle<Code> ic =
|
| + isolate()->stub_cache()->ComputeKeyedCallInitialize(arg_count, in_loop);
|
| __ ldr(r2, MemOperand(sp, (arg_count + 1) * kPointerSize)); // Key.
|
| EmitCallIC(ic, mode);
|
| RecordJSReturnSite(expr);
|
| @@ -2333,7 +2344,8 @@
|
| // Record source code position for IC call.
|
| SetSourcePosition(prop->position());
|
|
|
| - Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
|
| + Handle<Code> ic(isolate()->builtins()->builtin(
|
| + Builtins::KeyedLoadIC_Initialize));
|
| EmitCallIC(ic, RelocInfo::CODE_TARGET);
|
| __ ldr(r1, GlobalObjectOperand());
|
| __ ldr(r1, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset));
|
| @@ -2352,7 +2364,7 @@
|
| // 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);
|
| }
|
| @@ -2401,7 +2413,8 @@
|
| __ mov(r0, Operand(arg_count));
|
| __ ldr(r1, MemOperand(sp, arg_count * kPointerSize));
|
|
|
| - Handle<Code> construct_builtin(Builtins::builtin(Builtins::JSConstructCall));
|
| + Handle<Code> construct_builtin(isolate()->builtins()->builtin(
|
| + Builtins::JSConstructCall));
|
| __ Call(construct_builtin, RelocInfo::CONSTRUCT_CALL);
|
| context()->Plug(r0);
|
| }
|
| @@ -2796,7 +2809,7 @@
|
| // 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 (CpuFeatures::IsSupported(VFP3)) {
|
| + if (isolate()->cpu_features()->IsSupported(VFP3)) {
|
| __ PrepareCallCFunction(0, r1);
|
| __ CallCFunction(ExternalReference::random_uint32_function(), 0);
|
|
|
| @@ -3219,7 +3232,7 @@
|
| int cache_id = Smi::cast(*(args->at(0)->AsLiteral()->handle()))->value();
|
|
|
| Handle<FixedArray> jsfunction_result_caches(
|
| - Top::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);
|
| @@ -3598,7 +3611,8 @@
|
| if (expr->is_jsruntime()) {
|
| // Call the JS runtime function.
|
| __ mov(r2, Operand(expr->name()));
|
| - Handle<Code> ic = StubCache::ComputeCallInitialize(arg_count, NOT_IN_LOOP);
|
| + Handle<Code> ic =
|
| + isolate()->stub_cache()->ComputeCallInitialize(arg_count, NOT_IN_LOOP);
|
| EmitCallIC(ic, RelocInfo::CODE_TARGET);
|
| // Restore context register.
|
| __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
|
| @@ -3902,7 +3916,7 @@
|
| case NAMED_PROPERTY: {
|
| __ mov(r2, Operand(prop->key()->AsLiteral()->handle()));
|
| __ pop(r1);
|
| - Handle<Code> ic(Builtins::builtin(
|
| + Handle<Code> ic(isolate()->builtins()->builtin(
|
| is_strict_mode() ? Builtins::StoreIC_Initialize_Strict
|
| : Builtins::StoreIC_Initialize));
|
| EmitCallIC(ic, RelocInfo::CODE_TARGET);
|
| @@ -3919,7 +3933,7 @@
|
| case KEYED_PROPERTY: {
|
| __ pop(r1); // Key.
|
| __ pop(r2); // Receiver.
|
| - Handle<Code> ic(Builtins::builtin(
|
| + Handle<Code> ic(isolate()->builtins()->builtin(
|
| is_strict_mode() ? Builtins::KeyedStoreIC_Initialize_Strict
|
| : Builtins::KeyedStoreIC_Initialize));
|
| EmitCallIC(ic, RelocInfo::CODE_TARGET);
|
| @@ -3945,7 +3959,8 @@
|
| Comment cmnt(masm_, "Global variable");
|
| __ ldr(r0, GlobalObjectOperand());
|
| __ mov(r2, Operand(proxy->name()));
|
| - Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
|
| + Handle<Code> ic(isolate()->builtins()->builtin(
|
| + Builtins::LoadIC_Initialize));
|
| // Use a regular load, not a contextual load, to avoid a reference
|
| // error.
|
| EmitCallIC(ic, RelocInfo::CODE_TARGET);
|
| @@ -3998,13 +4013,13 @@
|
| }
|
| PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
|
|
|
| - if (check->Equals(Heap::number_symbol())) {
|
| + if (check->Equals(isolate()->heap()->number_symbol())) {
|
| __ JumpIfSmi(r0, 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())) {
|
| __ JumpIfSmi(r0, if_false);
|
| // Check for undetectable objects => false.
|
| __ CompareObjectType(r0, r0, r1, FIRST_NONSTRING_TYPE);
|
| @@ -4012,12 +4027,12 @@
|
| __ ldrb(r1, FieldMemOperand(r0, Map::kBitFieldOffset));
|
| __ tst(r1, Operand(1 << Map::kIsUndetectable));
|
| Split(eq, if_true, if_false, fall_through);
|
| - } else if (check->Equals(Heap::boolean_symbol())) {
|
| + } else if (check->Equals(isolate()->heap()->boolean_symbol())) {
|
| __ CompareRoot(r0, Heap::kTrueValueRootIndex);
|
| __ b(eq, if_true);
|
| __ CompareRoot(r0, Heap::kFalseValueRootIndex);
|
| Split(eq, if_true, if_false, fall_through);
|
| - } else if (check->Equals(Heap::undefined_symbol())) {
|
| + } else if (check->Equals(isolate()->heap()->undefined_symbol())) {
|
| __ CompareRoot(r0, Heap::kUndefinedValueRootIndex);
|
| __ b(eq, if_true);
|
| __ JumpIfSmi(r0, if_false);
|
| @@ -4027,12 +4042,12 @@
|
| __ tst(r1, Operand(1 << Map::kIsUndetectable));
|
| Split(ne, if_true, if_false, fall_through);
|
|
|
| - } else if (check->Equals(Heap::function_symbol())) {
|
| + } else if (check->Equals(isolate()->heap()->function_symbol())) {
|
| __ JumpIfSmi(r0, if_false);
|
| __ CompareObjectType(r0, r1, r0, FIRST_FUNCTION_CLASS_TYPE);
|
| Split(ge, if_true, if_false, fall_through);
|
|
|
| - } else if (check->Equals(Heap::object_symbol())) {
|
| + } else if (check->Equals(isolate()->heap()->object_symbol())) {
|
| __ JumpIfSmi(r0, if_false);
|
| __ CompareRoot(r0, Heap::kNullValueRootIndex);
|
| __ b(eq, if_true);
|
| @@ -4218,16 +4233,16 @@
|
| mode == RelocInfo::CODE_TARGET_CONTEXT);
|
| switch (ic->kind()) {
|
| case Code::LOAD_IC:
|
| - __ IncrementCounter(&Counters::named_load_full, 1, r1, r2);
|
| + __ IncrementCounter(COUNTERS->named_load_full(), 1, r1, r2);
|
| break;
|
| case Code::KEYED_LOAD_IC:
|
| - __ IncrementCounter(&Counters::keyed_load_full, 1, r1, r2);
|
| + __ IncrementCounter(COUNTERS->keyed_load_full(), 1, r1, r2);
|
| break;
|
| case Code::STORE_IC:
|
| - __ IncrementCounter(&Counters::named_store_full, 1, r1, r2);
|
| + __ IncrementCounter(COUNTERS->named_store_full(), 1, r1, r2);
|
| break;
|
| case Code::KEYED_STORE_IC:
|
| - __ IncrementCounter(&Counters::keyed_store_full, 1, r1, r2);
|
| + __ IncrementCounter(COUNTERS->keyed_store_full(), 1, r1, r2);
|
| default:
|
| break;
|
| }
|
| @@ -4239,16 +4254,16 @@
|
| void FullCodeGenerator::EmitCallIC(Handle<Code> ic, JumpPatchSite* patch_site) {
|
| switch (ic->kind()) {
|
| case Code::LOAD_IC:
|
| - __ IncrementCounter(&Counters::named_load_full, 1, r1, r2);
|
| + __ IncrementCounter(COUNTERS->named_load_full(), 1, r1, r2);
|
| break;
|
| case Code::KEYED_LOAD_IC:
|
| - __ IncrementCounter(&Counters::keyed_load_full, 1, r1, r2);
|
| + __ IncrementCounter(COUNTERS->keyed_load_full(), 1, r1, r2);
|
| break;
|
| case Code::STORE_IC:
|
| - __ IncrementCounter(&Counters::named_store_full, 1, r1, r2);
|
| + __ IncrementCounter(COUNTERS->named_store_full(), 1, r1, r2);
|
| break;
|
| case Code::KEYED_STORE_IC:
|
| - __ IncrementCounter(&Counters::keyed_store_full, 1, r1, r2);
|
| + __ IncrementCounter(COUNTERS->keyed_store_full(), 1, r1, r2);
|
| default:
|
| break;
|
| }
|
|
|