| Index: src/ia32/stub-cache-ia32.cc
|
| diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc
|
| index a5243a8790642b900dbcdf9e310f310a00e08643..3134baf928d0dc9450af73ef9d882a5698bc2c46 100644
|
| --- a/src/ia32/stub-cache-ia32.cc
|
| +++ b/src/ia32/stub-cache-ia32.cc
|
| @@ -274,13 +274,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.
|
| @@ -746,9 +747,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::LoadIC_Miss);
|
| } else {
|
| - code = Isolate::Current()->builtins()->builtin(Builtins::KeyedLoadIC_Miss);
|
| + code = masm->isolate()->builtins()->builtin(Builtins::KeyedLoadIC_Miss);
|
| }
|
|
|
| Handle<Code> ic(code);
|
| @@ -1358,8 +1359,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);
|
| @@ -1911,7 +1912,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);
|
|
|
| @@ -2479,8 +2480,8 @@ 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 =
|
| + Builtins::builtin(Builtins::StoreIC_Miss, masm()->isolate());
|
| __ jmp(ic, RelocInfo::CODE_TARGET);
|
|
|
| // Return the generated code.
|
| @@ -2532,7 +2533,7 @@ MaybeObject* StoreStubCompiler::CompileStoreCallback(JSObject* object,
|
|
|
| // Handle store cache miss.
|
| __ bind(&miss);
|
| - Handle<Code> ic(isolate->builtins()->builtin(Builtins::StoreIC_Miss));
|
| + Handle<Code> ic = Builtins::builtin(Builtins::StoreIC_Miss, isolate);
|
| __ jmp(ic, RelocInfo::CODE_TARGET);
|
|
|
| // Return the generated code.
|
| @@ -2583,7 +2584,7 @@ MaybeObject* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver,
|
|
|
| // Handle store cache miss.
|
| __ bind(&miss);
|
| - Handle<Code> ic(isolate->builtins()->builtin(Builtins::StoreIC_Miss));
|
| + Handle<Code> ic = Builtins::builtin(Builtins::StoreIC_Miss, isolate);
|
| __ jmp(ic, RelocInfo::CODE_TARGET);
|
|
|
| // Return the generated code.
|
| @@ -2632,8 +2633,8 @@ 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 =
|
| + Builtins::builtin(Builtins::StoreIC_Miss, masm()->isolate());
|
| __ jmp(ic, RelocInfo::CODE_TARGET);
|
|
|
| // Return the generated code.
|
| @@ -2670,8 +2671,8 @@ 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 =
|
| + Builtins::builtin(Builtins::KeyedStoreIC_Miss, masm()->isolate());
|
| __ jmp(ic, RelocInfo::CODE_TARGET);
|
|
|
| // Return the generated code.
|
| @@ -2728,8 +2729,8 @@ MaybeObject* KeyedStoreStubCompiler::CompileStoreSpecialized(
|
|
|
| // Handle store cache miss.
|
| __ bind(&miss);
|
| - Handle<Code> ic(
|
| - Isolate::Current()->builtins()->builtin(Builtins::KeyedStoreIC_Miss));
|
| + Handle<Code> ic =
|
| + Builtins::builtin(Builtins::KeyedStoreIC_Miss, masm()->isolate());
|
| __ jmp(ic, RelocInfo::CODE_TARGET);
|
|
|
| // Return the generated code.
|
| @@ -3270,7 +3271,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 {
|
| @@ -3312,9 +3313,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 =
|
| + Builtins::builtin(Builtins::JSConstructStubGeneric, masm()->isolate());
|
| __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET);
|
|
|
| // Return the generated code.
|
| @@ -3588,10 +3588,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
|
| @@ -3619,7 +3619,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
|
| @@ -3632,7 +3632,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,
|
|
|