diff options
author | Fedor Indutny <fedor.indutny@gmail.com> | 2014-03-18 00:33:01 +0400 |
---|---|---|
committer | Fedor Indutny <fedor.indutny@gmail.com> | 2014-03-18 00:33:01 +0400 |
commit | 4d140746f0978da2a6493b92d3b6de4b18f3394d (patch) | |
tree | 69d76bb397ca1dde203a5d7535ecc33c58c85f25 /deps/v8/src/mips/stub-cache-mips.cc | |
parent | ee4b9b552dee37ed5844da6c261e4d28a33d3c13 (diff) | |
download | node-new-4d140746f0978da2a6493b92d3b6de4b18f3394d.tar.gz |
deps: update v8 to 3.24.35.17
Diffstat (limited to 'deps/v8/src/mips/stub-cache-mips.cc')
-rw-r--r-- | deps/v8/src/mips/stub-cache-mips.cc | 73 |
1 files changed, 61 insertions, 12 deletions
diff --git a/deps/v8/src/mips/stub-cache-mips.cc b/deps/v8/src/mips/stub-cache-mips.cc index 7e3c801399..d1b428a345 100644 --- a/deps/v8/src/mips/stub-cache-mips.cc +++ b/deps/v8/src/mips/stub-cache-mips.cc @@ -770,14 +770,13 @@ static void CompileCallLoadPropertyWithInterceptor( // Generate call to api function. -void StubCompiler::GenerateFastApiCall(MacroAssembler* masm, - const CallOptimization& optimization, - Handle<Map> receiver_map, - Register receiver, - Register scratch_in, - bool is_store, - int argc, - Register* values) { +static void GenerateFastApiCall(MacroAssembler* masm, + const CallOptimization& optimization, + Handle<Map> receiver_map, + Register receiver, + Register scratch_in, + int argc, + Register* values) { ASSERT(!receiver.is(scratch_in)); // Preparing to push, adjust sp. __ Subu(sp, sp, Operand((argc + 1) * kPointerSize)); @@ -844,7 +843,7 @@ void StubCompiler::GenerateFastApiCall(MacroAssembler* masm, __ li(api_function_address, Operand(ref)); // Jump to stub. - CallApiFunctionStub stub(is_store, call_data_undefined, argc); + CallApiFunctionStub stub(true, call_data_undefined, argc); __ TailCallStub(&stub); } @@ -1065,6 +1064,15 @@ void LoadStubCompiler::GenerateLoadConstant(Handle<Object> value) { void LoadStubCompiler::GenerateLoadCallback( + const CallOptimization& call_optimization, + Handle<Map> receiver_map) { + GenerateFastApiCall( + masm(), call_optimization, receiver_map, + receiver(), scratch3(), 0, NULL); +} + + +void LoadStubCompiler::GenerateLoadCallback( Register reg, Handle<ExecutableAccessorInfo> callback) { // Build AccessorInfo::args_ list on the stack and push property name below @@ -1238,6 +1246,24 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback( } +Handle<Code> StoreStubCompiler::CompileStoreCallback( + Handle<JSObject> object, + Handle<JSObject> holder, + Handle<Name> name, + const CallOptimization& call_optimization) { + HandlerFrontend(IC::CurrentTypeOf(object, isolate()), + receiver(), holder, name); + + Register values[] = { value() }; + GenerateFastApiCall( + masm(), call_optimization, handle(object->map()), + receiver(), scratch3(), 1, values); + + // Return the generated code. + return GetCode(kind(), Code::FAST, name); +} + + #undef __ #define __ ACCESS_MASM(masm) @@ -1296,6 +1322,21 @@ void StoreStubCompiler::GenerateStoreViaSetter( Handle<Code> StoreStubCompiler::CompileStoreInterceptor( Handle<JSObject> object, Handle<Name> name) { + Label miss; + + // Check that the map of the object hasn't changed. + __ CheckMap(receiver(), scratch1(), Handle<Map>(object->map()), &miss, + DO_SMI_CHECK); + + // Perform global security token check if needed. + if (object->IsJSGlobalProxy()) { + __ CheckAccessGlobalProxy(receiver(), scratch1(), &miss); + } + + // Stub is never generated for non-global objects that require access + // checks. + ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded()); + __ Push(receiver(), this->name(), value()); // Do tail-call to the runtime system. @@ -1303,6 +1344,10 @@ Handle<Code> StoreStubCompiler::CompileStoreInterceptor( ExternalReference(IC_Utility(IC::kStoreInterceptorProperty), isolate()); __ TailCallExternalReference(store_ic_property, 3, 1); + // Handle store cache miss. + __ bind(&miss); + TailCallBuiltin(masm(), MissBuiltin(kind())); + // Return the generated code. return GetCode(kind(), Code::FAST, name); } @@ -1442,10 +1487,11 @@ Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC( } Label number_case; + Register match = scratch1(); Label* smi_target = IncludesNumberType(types) ? &number_case : &miss; - __ JumpIfSmi(receiver(), smi_target); + __ JumpIfSmi(receiver(), smi_target, match); // Reg match is 0 if Smi. - Register map_reg = scratch1(); + Register map_reg = scratch2(); int receiver_count = types->length(); int number_of_handled_maps = 0; @@ -1455,12 +1501,15 @@ Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC( Handle<Map> map = IC::TypeToMap(*type, isolate()); if (!map->is_deprecated()) { number_of_handled_maps++; + // Check map and tail call if there's a match. + // Separate compare from branch, to provide path for above JumpIfSmi(). + __ Subu(match, map_reg, Operand(map)); if (type->Is(HeapType::Number())) { ASSERT(!number_case.is_unused()); __ bind(&number_case); } __ Jump(handlers->at(current), RelocInfo::CODE_TARGET, - eq, map_reg, Operand(map)); + eq, match, Operand(zero_reg)); } } ASSERT(number_of_handled_maps != 0); |