| Index: src/mips/stub-cache-mips.cc
|
| diff --git a/src/mips/stub-cache-mips.cc b/src/mips/stub-cache-mips.cc
|
| index be32744b2e8fd7b5ac9fa3467995545915c88efc..51df45224abdb33a3d2e1d7cf4d758cf06b6e2d9 100644
|
| --- a/src/mips/stub-cache-mips.cc
|
| +++ b/src/mips/stub-cache-mips.cc
|
| @@ -420,12 +420,10 @@ static void GenerateCheckPropertyCell(MacroAssembler* masm,
|
| Handle<Name> name,
|
| Register scratch,
|
| Label* miss) {
|
| - Handle<JSGlobalPropertyCell> cell =
|
| - GlobalObject::EnsurePropertyCell(global, name);
|
| + Handle<Cell> cell = GlobalObject::EnsurePropertyCell(global, name);
|
| ASSERT(cell->value()->IsTheHole());
|
| __ li(scratch, Operand(cell));
|
| - __ lw(scratch,
|
| - FieldMemOperand(scratch, JSGlobalPropertyCell::kValueOffset));
|
| + __ lw(scratch, FieldMemOperand(scratch, Cell::kValueOffset));
|
| __ LoadRoot(at, Heap::kTheHoleValueRootIndex);
|
| __ Branch(miss, ne, scratch, Operand(at));
|
| }
|
| @@ -505,7 +503,12 @@ void StubCompiler::GenerateStoreTransition(MacroAssembler* masm,
|
|
|
| Register storage_reg = name_reg;
|
|
|
| - if (FLAG_track_fields && representation.IsSmi()) {
|
| + if (details.type() == CONSTANT_FUNCTION) {
|
| + Handle<HeapObject> constant(
|
| + HeapObject::cast(descriptors->GetValue(descriptor)));
|
| + __ LoadHeapObject(scratch1, constant);
|
| + __ Branch(miss_restore_name, ne, value_reg, Operand(scratch1));
|
| + } else if (FLAG_track_fields && representation.IsSmi()) {
|
| __ JumpIfNotSmi(value_reg, miss_restore_name);
|
| } else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) {
|
| __ JumpIfSmi(value_reg, miss_restore_name);
|
| @@ -534,7 +537,8 @@ void StubCompiler::GenerateStoreTransition(MacroAssembler* masm,
|
| ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded());
|
|
|
| // Perform map transition for the receiver if necessary.
|
| - if (object->map()->unused_property_fields() == 0) {
|
| + if (details.type() == FIELD &&
|
| + object->map()->unused_property_fields() == 0) {
|
| // The properties must be extended before we can store the value.
|
| // We jump to a runtime call that extends the properties array.
|
| __ push(receiver_reg);
|
| @@ -562,6 +566,13 @@ void StubCompiler::GenerateStoreTransition(MacroAssembler* masm,
|
| OMIT_REMEMBERED_SET,
|
| OMIT_SMI_CHECK);
|
|
|
| + if (details.type() == CONSTANT_FUNCTION) {
|
| + ASSERT(value_reg.is(a0));
|
| + __ Ret(USE_DELAY_SLOT);
|
| + __ mov(v0, a0);
|
| + return;
|
| + }
|
| +
|
| int index = transition->instance_descriptors()->GetFieldIndex(
|
| transition->LastAdded());
|
|
|
| @@ -934,6 +945,7 @@ static void GenerateFastApiDirectCall(MacroAssembler* masm,
|
| !CallbackTable::ReturnsVoid(masm->isolate(), function_address);
|
|
|
| Register first_arg = returns_handle ? a1 : a0;
|
| + Register second_arg = returns_handle ? a2 : a1;
|
|
|
| // first_arg = v8::Arguments&
|
| // Arguments is built at sp + 1 (sp is a reserved spot for ra).
|
| @@ -960,8 +972,23 @@ static void GenerateFastApiDirectCall(MacroAssembler* masm,
|
| ExternalReference(&fun,
|
| type,
|
| masm->isolate());
|
| +
|
| + Address thunk_address = returns_handle
|
| + ? FUNCTION_ADDR(&InvokeInvocationCallback)
|
| + : FUNCTION_ADDR(&InvokeFunctionCallback);
|
| + ExternalReference::Type thunk_type =
|
| + returns_handle ?
|
| + ExternalReference::PROFILING_API_CALL :
|
| + ExternalReference::PROFILING_API_CALL_NEW;
|
| + ApiFunction thunk_fun(thunk_address);
|
| + ExternalReference thunk_ref = ExternalReference(&thunk_fun, thunk_type,
|
| + masm->isolate());
|
| +
|
| AllowExternalCallThatCantCauseGC scope(masm);
|
| __ CallApiFunctionAndReturn(ref,
|
| + function_address,
|
| + thunk_ref,
|
| + second_arg,
|
| kStackUnwindSpace,
|
| returns_handle,
|
| kFastApiCallArguments + 1);
|
| @@ -1454,6 +1481,7 @@ void BaseLoadStubCompiler::GenerateLoadCallback(
|
|
|
| Register first_arg = returns_handle ? a1 : a0;
|
| Register second_arg = returns_handle ? a2 : a1;
|
| + Register third_arg = returns_handle ? a3 : a2;
|
|
|
| __ mov(a2, scratch2()); // Saved in case scratch2 == a1.
|
| __ mov(first_arg, sp); // (first argument - see note below) = Handle<Name>
|
| @@ -1474,14 +1502,28 @@ void BaseLoadStubCompiler::GenerateLoadCallback(
|
| __ Addu(second_arg, sp, kPointerSize);
|
|
|
| const int kStackUnwindSpace = kFastApiCallArguments + 1;
|
| +
|
| ApiFunction fun(getter_address);
|
| ExternalReference::Type type =
|
| returns_handle ?
|
| ExternalReference::DIRECT_GETTER_CALL :
|
| ExternalReference::DIRECT_GETTER_CALL_NEW;
|
| -
|
| ExternalReference ref = ExternalReference(&fun, type, isolate());
|
| +
|
| + Address thunk_address = returns_handle
|
| + ? FUNCTION_ADDR(&InvokeAccessorGetter)
|
| + : FUNCTION_ADDR(&InvokeAccessorGetterCallback);
|
| + ExternalReference::Type thunk_type =
|
| + returns_handle ?
|
| + ExternalReference::PROFILING_GETTER_CALL :
|
| + ExternalReference::PROFILING_GETTER_CALL_NEW;
|
| + ApiFunction thunk_fun(thunk_address);
|
| + ExternalReference thunk_ref = ExternalReference(&thunk_fun, thunk_type,
|
| + isolate());
|
| __ CallApiFunctionAndReturn(ref,
|
| + getter_address,
|
| + thunk_ref,
|
| + third_arg,
|
| kStackUnwindSpace,
|
| returns_handle,
|
| 5);
|
| @@ -1600,12 +1642,12 @@ void CallStubCompiler::GenerateGlobalReceiverCheck(Handle<JSObject> object,
|
|
|
|
|
| void CallStubCompiler::GenerateLoadFunctionFromCell(
|
| - Handle<JSGlobalPropertyCell> cell,
|
| + Handle<Cell> cell,
|
| Handle<JSFunction> function,
|
| Label* miss) {
|
| // Get the value from the cell.
|
| __ li(a3, Operand(cell));
|
| - __ lw(a1, FieldMemOperand(a3, JSGlobalPropertyCell::kValueOffset));
|
| + __ lw(a1, FieldMemOperand(a3, Cell::kValueOffset));
|
|
|
| // Check that the cell contains the same function.
|
| if (heap()->InNewSpace(*function)) {
|
| @@ -1675,7 +1717,7 @@ Handle<Code> CallStubCompiler::CompileCallField(Handle<JSObject> object,
|
| Handle<Code> CallStubCompiler::CompileArrayPushCall(
|
| Handle<Object> object,
|
| Handle<JSObject> holder,
|
| - Handle<JSGlobalPropertyCell> cell,
|
| + Handle<Cell> cell,
|
| Handle<JSFunction> function,
|
| Handle<String> name) {
|
| // ----------- S t a t e -------------
|
| @@ -1929,7 +1971,7 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall(
|
| Handle<Code> CallStubCompiler::CompileArrayPopCall(
|
| Handle<Object> object,
|
| Handle<JSObject> holder,
|
| - Handle<JSGlobalPropertyCell> cell,
|
| + Handle<Cell> cell,
|
| Handle<JSFunction> function,
|
| Handle<String> name) {
|
| // ----------- S t a t e -------------
|
| @@ -2011,7 +2053,7 @@ Handle<Code> CallStubCompiler::CompileArrayPopCall(
|
| Handle<Code> CallStubCompiler::CompileStringCharCodeAtCall(
|
| Handle<Object> object,
|
| Handle<JSObject> holder,
|
| - Handle<JSGlobalPropertyCell> cell,
|
| + Handle<Cell> cell,
|
| Handle<JSFunction> function,
|
| Handle<String> name) {
|
| // ----------- S t a t e -------------
|
| @@ -2093,7 +2135,7 @@ Handle<Code> CallStubCompiler::CompileStringCharCodeAtCall(
|
| Handle<Code> CallStubCompiler::CompileStringCharAtCall(
|
| Handle<Object> object,
|
| Handle<JSObject> holder,
|
| - Handle<JSGlobalPropertyCell> cell,
|
| + Handle<Cell> cell,
|
| Handle<JSFunction> function,
|
| Handle<String> name) {
|
| // ----------- S t a t e -------------
|
| @@ -2174,7 +2216,7 @@ Handle<Code> CallStubCompiler::CompileStringCharAtCall(
|
| Handle<Code> CallStubCompiler::CompileStringFromCharCodeCall(
|
| Handle<Object> object,
|
| Handle<JSObject> holder,
|
| - Handle<JSGlobalPropertyCell> cell,
|
| + Handle<Cell> cell,
|
| Handle<JSFunction> function,
|
| Handle<String> name) {
|
| // ----------- S t a t e -------------
|
| @@ -2247,7 +2289,7 @@ Handle<Code> CallStubCompiler::CompileStringFromCharCodeCall(
|
| Handle<Code> CallStubCompiler::CompileMathFloorCall(
|
| Handle<Object> object,
|
| Handle<JSObject> holder,
|
| - Handle<JSGlobalPropertyCell> cell,
|
| + Handle<Cell> cell,
|
| Handle<JSFunction> function,
|
| Handle<String> name) {
|
| // ----------- S t a t e -------------
|
| @@ -2376,7 +2418,7 @@ Handle<Code> CallStubCompiler::CompileMathFloorCall(
|
| Handle<Code> CallStubCompiler::CompileMathAbsCall(
|
| Handle<Object> object,
|
| Handle<JSObject> holder,
|
| - Handle<JSGlobalPropertyCell> cell,
|
| + Handle<Cell> cell,
|
| Handle<JSFunction> function,
|
| Handle<String> name) {
|
| // ----------- S t a t e -------------
|
| @@ -2476,7 +2518,7 @@ Handle<Code> CallStubCompiler::CompileFastApiCall(
|
| const CallOptimization& optimization,
|
| Handle<Object> object,
|
| Handle<JSObject> holder,
|
| - Handle<JSGlobalPropertyCell> cell,
|
| + Handle<Cell> cell,
|
| Handle<JSFunction> function,
|
| Handle<String> name) {
|
|
|
| @@ -2649,7 +2691,7 @@ Handle<Code> CallStubCompiler::CompileCallConstant(
|
| Handle<JSFunction> function) {
|
| if (HasCustomCallGenerator(function)) {
|
| Handle<Code> code = CompileCustomCall(object, holder,
|
| - Handle<JSGlobalPropertyCell>::null(),
|
| + Handle<Cell>::null(),
|
| function, Handle<String>::cast(name));
|
| // A null handle means bail out to the regular compiler code below.
|
| if (!code.is_null()) return code;
|
| @@ -2709,7 +2751,7 @@ Handle<Code> CallStubCompiler::CompileCallInterceptor(Handle<JSObject> object,
|
| Handle<Code> CallStubCompiler::CompileCallGlobal(
|
| Handle<JSObject> object,
|
| Handle<GlobalObject> holder,
|
| - Handle<JSGlobalPropertyCell> cell,
|
| + Handle<PropertyCell> cell,
|
| Handle<JSFunction> function,
|
| Handle<Name> name) {
|
| // ----------- S t a t e -------------
|
| @@ -2885,7 +2927,7 @@ Handle<Code> StoreStubCompiler::CompileStoreInterceptor(
|
|
|
| Handle<Code> StoreStubCompiler::CompileStoreGlobal(
|
| Handle<GlobalObject> object,
|
| - Handle<JSGlobalPropertyCell> cell,
|
| + Handle<PropertyCell> cell,
|
| Handle<Name> name) {
|
| Label miss;
|
|
|
| @@ -2899,13 +2941,11 @@ Handle<Code> StoreStubCompiler::CompileStoreGlobal(
|
| // global object. We bail out to the runtime system to do that.
|
| __ li(scratch1(), Operand(cell));
|
| __ LoadRoot(scratch2(), Heap::kTheHoleValueRootIndex);
|
| - __ lw(scratch3(),
|
| - FieldMemOperand(scratch1(), JSGlobalPropertyCell::kValueOffset));
|
| + __ lw(scratch3(), FieldMemOperand(scratch1(), Cell::kValueOffset));
|
| __ Branch(&miss, eq, scratch3(), Operand(scratch2()));
|
|
|
| // Store the value in the cell.
|
| - __ sw(value(),
|
| - FieldMemOperand(scratch1(), JSGlobalPropertyCell::kValueOffset));
|
| + __ sw(value(), FieldMemOperand(scratch1(), Cell::kValueOffset));
|
| __ mov(v0, a0); // Stored value must be returned in v0.
|
| // Cells are always rescanned, so no write barrier here.
|
|
|
| @@ -3027,7 +3067,7 @@ void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm,
|
| Handle<Code> LoadStubCompiler::CompileLoadGlobal(
|
| Handle<JSObject> object,
|
| Handle<GlobalObject> global,
|
| - Handle<JSGlobalPropertyCell> cell,
|
| + Handle<PropertyCell> cell,
|
| Handle<Name> name,
|
| bool is_dont_delete) {
|
| Label success, miss;
|
| @@ -3039,7 +3079,7 @@ Handle<Code> LoadStubCompiler::CompileLoadGlobal(
|
|
|
| // Get the value from the cell.
|
| __ li(a3, Operand(cell));
|
| - __ lw(t0, FieldMemOperand(a3, JSGlobalPropertyCell::kValueOffset));
|
| + __ lw(t0, FieldMemOperand(a3, Cell::kValueOffset));
|
|
|
| // Check for deleted property if property can actually be deleted.
|
| if (!is_dont_delete) {
|
|
|