| Index: src/a64/stub-cache-a64.cc
|
| diff --git a/src/a64/stub-cache-a64.cc b/src/a64/stub-cache-a64.cc
|
| index e29494b3a98e00771bcedb519fb9b30b9a696640..a9c76e1bd49c677b2d41ba9cefc068a2fae29e35 100644
|
| --- a/src/a64/stub-cache-a64.cc
|
| +++ b/src/a64/stub-cache-a64.cc
|
| @@ -704,28 +704,6 @@ void StoreStubCompiler::GenerateRestoreName(MacroAssembler* masm,
|
| }
|
|
|
|
|
| -void StubCompiler::GenerateCheckPropertyCells(MacroAssembler* masm,
|
| - Handle<JSObject> object,
|
| - Handle<JSObject> holder,
|
| - Handle<Name> name,
|
| - Register scratch1,
|
| - Label* miss) {
|
| - Handle<JSObject> current = object;
|
| - while (!current.is_identical_to(holder)) {
|
| - if (current->IsJSGlobalObject()) {
|
| - // TODO(all): GenerateCheckPropertyCell loads the hole (root value) every
|
| - // time. Hoist that out, and load it once at the start.
|
| - GenerateCheckPropertyCell(masm,
|
| - Handle<JSGlobalObject>::cast(current),
|
| - name,
|
| - scratch1,
|
| - miss);
|
| - }
|
| - current = Handle<JSObject>(JSObject::cast(current->GetPrototype()));
|
| - }
|
| -}
|
| -
|
| -
|
| // The function to called must be passed in x1.
|
| static void GenerateCallFunction(MacroAssembler* masm,
|
| Handle<Object> object,
|
| @@ -783,19 +761,13 @@ static void CompileCallLoadPropertyWithInterceptor(
|
| Register receiver,
|
| Register holder,
|
| Register name,
|
| - Handle<JSObject> holder_obj) {
|
| + Handle<JSObject> holder_obj,
|
| + IC::UtilityId id) {
|
| PushInterceptorArguments(masm, receiver, holder, name, holder_obj);
|
|
|
| - ExternalReference ref =
|
| - ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptorOnly),
|
| - masm->isolate());
|
| - // Put the number of on-stack arguments for runtime call in x0.
|
| - // These arguemnts have been pushed by PushInterceptorArguments.
|
| - __ Mov(x0, StubCache::kInterceptorArgsLength);
|
| - __ Mov(x1, Operand(ref));
|
| -
|
| - CEntryStub stub(1);
|
| - __ CallStub(&stub);
|
| + __ CallExternalReference(
|
| + ExternalReference(IC_Utility(id), masm->isolate()),
|
| + StubCache::kInterceptorArgsLength);
|
| }
|
|
|
|
|
| @@ -1046,9 +1018,10 @@ class CallInterceptorCompiler BASE_EMBEDDED {
|
| Label miss_cleanup;
|
| Label* miss = can_do_fast_api_call ? &miss_cleanup : miss_label;
|
| Register holder =
|
| - stub_compiler_->CheckPrototypes(object, receiver, interceptor_holder,
|
| - scratch1, scratch2, scratch3,
|
| - name, depth1, miss);
|
| + stub_compiler_->CheckPrototypes(
|
| + IC::CurrentTypeOf(object, masm->isolate()), receiver,
|
| + interceptor_holder, scratch1, scratch2, scratch3,
|
| + name, depth1, miss);
|
|
|
| // Invoke an interceptor and if it provides a value,
|
| // branch to |regular_invoke|.
|
| @@ -1062,10 +1035,10 @@ class CallInterceptorCompiler BASE_EMBEDDED {
|
| // Check that the maps from interceptor's holder to constant function's
|
| // holder haven't changed and thus we can use cached constant function.
|
| if (*interceptor_holder != lookup->holder()) {
|
| - stub_compiler_->CheckPrototypes(interceptor_holder, receiver,
|
| - Handle<JSObject>(lookup->holder()),
|
| - scratch1, scratch2, scratch3,
|
| - name, depth2, miss);
|
| + stub_compiler_->CheckPrototypes(
|
| + IC::CurrentTypeOf(interceptor_holder, masm->isolate()), receiver,
|
| + handle(lookup->holder()), scratch1, scratch2, scratch3,
|
| + name, depth2, miss);
|
| } else {
|
| // CheckPrototypes has a side effect of fetching a 'holder'
|
| // for API (object which is instanceof for the signature). It's
|
| @@ -1112,19 +1085,19 @@ class CallInterceptorCompiler BASE_EMBEDDED {
|
| Handle<JSObject> interceptor_holder,
|
| Label* miss_label) {
|
| Register holder =
|
| - stub_compiler_->CheckPrototypes(object, receiver, interceptor_holder,
|
| - scratch1, scratch2, scratch3,
|
| - name, miss_label);
|
| + stub_compiler_->CheckPrototypes(
|
| + IC::CurrentTypeOf(object, masm->isolate()), receiver,
|
| + interceptor_holder, scratch1, scratch2, scratch3, name, miss_label);
|
|
|
| // Call a runtime function to load the interceptor property.
|
| FrameScope scope(masm, StackFrame::INTERNAL);
|
| // The name_ register must be preserved across the call.
|
| __ Push(name_);
|
| - PushInterceptorArguments(masm, receiver, holder, name_, interceptor_holder);
|
| - __ CallExternalReference(
|
| - ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptorForCall),
|
| - masm->isolate()),
|
| - StubCache::kInterceptorArgsLength);
|
| +
|
| + CompileCallLoadPropertyWithInterceptor(
|
| + masm, receiver, holder, name_, interceptor_holder,
|
| + IC::kLoadPropertyWithInterceptorForCall);
|
| +
|
| __ Pop(name_);
|
| }
|
|
|
| @@ -1138,11 +1111,9 @@ class CallInterceptorCompiler BASE_EMBEDDED {
|
| {
|
| FrameScope scope(masm, StackFrame::INTERNAL);
|
| __ Push(holder, name_);
|
| - CompileCallLoadPropertyWithInterceptor(masm,
|
| - receiver,
|
| - holder,
|
| - name_,
|
| - holder_obj);
|
| + CompileCallLoadPropertyWithInterceptor(
|
| + masm, receiver, holder, name_, holder_obj,
|
| + IC::kLoadPropertyWithInterceptorOnly);
|
| __ Pop(name_, receiver);
|
| }
|
|
|
| @@ -1168,7 +1139,7 @@ void StubCompiler::GenerateTailCall(MacroAssembler* masm, Handle<Code> code) {
|
| #define __ ACCESS_MASM(masm())
|
|
|
|
|
| -Register StubCompiler::CheckPrototypes(Handle<JSObject> object,
|
| +Register StubCompiler::CheckPrototypes(Handle<Type> type,
|
| Register object_reg,
|
| Handle<JSObject> holder,
|
| Register holder_reg,
|
| @@ -1178,11 +1149,10 @@ Register StubCompiler::CheckPrototypes(Handle<JSObject> object,
|
| int save_at_depth,
|
| Label* miss,
|
| PrototypeCheckType check) {
|
| + Handle<Map> receiver_map(IC::TypeToMap(*type, isolate()));
|
| // Make sure that the type feedback oracle harvests the receiver map.
|
| // TODO(svenpanne) Remove this hack when all ICs are reworked.
|
| - __ Mov(scratch1, Operand(Handle<Map>(object->map())));
|
| -
|
| - Handle<JSObject> first = object;
|
| + __ Mov(scratch1, Operand(receiver_map));
|
|
|
| // object_reg and holder_reg registers can alias.
|
| ASSERT(!AreAliased(object_reg, scratch1, scratch2));
|
| @@ -1197,26 +1167,34 @@ Register StubCompiler::CheckPrototypes(Handle<JSObject> object,
|
| __ Poke(reg, FCA::kHolderIndex * kPointerSize);
|
| }
|
|
|
| - // Check the maps in the prototype chain.
|
| - // Traverse the prototype chain from the object and do map checks.
|
| - Handle<JSObject> current = object;
|
| - while (!current.is_identical_to(holder)) {
|
| + Handle<JSObject> current = Handle<JSObject>::null();
|
| + if (type->IsConstant()) {
|
| + current = Handle<JSObject>::cast(type->AsConstant());
|
| + }
|
| + Handle<JSObject> prototype = Handle<JSObject>::null();
|
| + Handle<Map> current_map = receiver_map;
|
| + Handle<Map> holder_map(holder->map());
|
| + // Traverse the prototype chain and check the maps in the prototype chain for
|
| + // fast and global objects or do negative lookup for normal objects.
|
| + while (!current_map.is_identical_to(holder_map)) {
|
| ++depth;
|
|
|
| // Only global objects and objects that do not require access
|
| // checks are allowed in stubs.
|
| - ASSERT(current->IsJSGlobalProxy() || !current->IsAccessCheckNeeded());
|
| + ASSERT(current_map->IsJSGlobalProxyMap() ||
|
| + !current_map->is_access_check_needed());
|
|
|
| - Handle<JSObject> prototype(JSObject::cast(current->GetPrototype()));
|
| - if (!current->HasFastProperties() &&
|
| - !current->IsJSGlobalObject() &&
|
| - !current->IsJSGlobalProxy()) {
|
| + prototype = handle(JSObject::cast(current_map->prototype()));
|
| + if (current_map->is_dictionary_map() &&
|
| + !current_map->IsJSGlobalObjectMap() &&
|
| + !current_map->IsJSGlobalProxyMap()) {
|
| if (!name->IsUniqueName()) {
|
| ASSERT(name->IsString());
|
| name = factory()->InternalizeString(Handle<String>::cast(name));
|
| }
|
| - ASSERT(current->property_dictionary()->FindEntry(*name) ==
|
| - NameDictionary::kNotFound);
|
| + ASSERT(current.is_null() ||
|
| + (current->property_dictionary()->FindEntry(*name) ==
|
| + NameDictionary::kNotFound));
|
|
|
| GenerateDictionaryNegativeLookup(masm(), miss, reg, name,
|
| scratch1, scratch2);
|
| @@ -1229,17 +1207,21 @@ Register StubCompiler::CheckPrototypes(Handle<JSObject> object,
|
| // TODO(jbramley): Skip this load when we don't need the map.
|
| __ Ldr(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset));
|
|
|
| - if (!current.is_identical_to(first) || (check == CHECK_ALL_MAPS)) {
|
| - Handle<Map> current_map(current->map());
|
| + if (depth != 1 || check == CHECK_ALL_MAPS) {
|
| __ CheckMap(map_reg, current_map, miss, DONT_DO_SMI_CHECK);
|
| }
|
|
|
| // Check access rights to the global object. This has to happen after
|
| // the map check so that we know that the object is actually a global
|
| // object.
|
| - if (current->IsJSGlobalProxy()) {
|
| + if (current_map->IsJSGlobalProxyMap()) {
|
| __ CheckAccessGlobalProxy(reg, scratch2, miss);
|
| + } else if (current_map->IsJSGlobalObjectMap()) {
|
| + GenerateCheckPropertyCell(
|
| + masm(), Handle<JSGlobalObject>::cast(current), name,
|
| + scratch2, miss);
|
| }
|
| +
|
| reg = holder_reg; // From now on the object will be in holder_reg.
|
|
|
| if (heap()->InNewSpace(*prototype)) {
|
| @@ -1258,29 +1240,25 @@ Register StubCompiler::CheckPrototypes(Handle<JSObject> object,
|
|
|
| // Go to the next object in the prototype chain.
|
| current = prototype;
|
| + current_map = handle(current->map());
|
| }
|
|
|
| // Log the check depth.
|
| LOG(isolate(), IntEvent("check-maps-depth", depth + 1));
|
|
|
| // Check the holder map.
|
| - if (!holder.is_identical_to(first) || check == CHECK_ALL_MAPS) {
|
| + if (depth != 0 || check == CHECK_ALL_MAPS) {
|
| // Check the holder map.
|
| - __ CheckMap(reg, scratch1, Handle<Map>(current->map()), miss,
|
| - DONT_DO_SMI_CHECK);
|
| + __ CheckMap(reg, scratch1, current_map, miss, DONT_DO_SMI_CHECK);
|
| }
|
|
|
| // Perform security check for access to the global object.
|
| - ASSERT(holder->IsJSGlobalProxy() || !holder->IsAccessCheckNeeded());
|
| - if (holder->IsJSGlobalProxy()) {
|
| + ASSERT(current_map->IsJSGlobalProxyMap() ||
|
| + !current_map->is_access_check_needed());
|
| + if (current_map->IsJSGlobalProxyMap()) {
|
| __ CheckAccessGlobalProxy(reg, scratch1, miss);
|
| }
|
|
|
| - // If we've skipped any global objects, it's not enough to verify that
|
| - // their maps haven't changed. We also need to check that the property
|
| - // cell for the property is still empty.
|
| - GenerateCheckPropertyCells(masm(), object, holder, name, scratch1, miss);
|
| -
|
| // Return the register containing the holder.
|
| return reg;
|
| }
|
| @@ -1312,14 +1290,14 @@ void StoreStubCompiler::HandlerFrontendFooter(Handle<Name> name, Label* miss) {
|
| }
|
|
|
|
|
| -Register LoadStubCompiler::CallbackHandlerFrontend(Handle<Object> object,
|
| +Register LoadStubCompiler::CallbackHandlerFrontend(Handle<Type> type,
|
| Register object_reg,
|
| Handle<JSObject> holder,
|
| Handle<Name> name,
|
| Handle<Object> callback) {
|
| Label miss;
|
|
|
| - Register reg = HandlerFrontendHeader(object, object_reg, holder, name, &miss);
|
| + Register reg = HandlerFrontendHeader(type, object_reg, holder, name, &miss);
|
|
|
| // TODO(jbramely): HandlerFrontendHeader returns its result in scratch1(), so
|
| // we can't use it below, but that isn't very obvious. Is there a better way
|
| @@ -1544,11 +1522,10 @@ void LoadStubCompiler::GenerateLoadInterceptor(
|
| // Invoke an interceptor. Note: map checks from receiver to
|
| // interceptor's holder has been compiled before (see a caller
|
| // of this method.)
|
| - CompileCallLoadPropertyWithInterceptor(masm(),
|
| - receiver(),
|
| - holder_reg,
|
| - this->name(),
|
| - interceptor_holder);
|
| + CompileCallLoadPropertyWithInterceptor(
|
| + masm(), receiver(), holder_reg, this->name(), interceptor_holder,
|
| + IC::kLoadPropertyWithInterceptorOnly);
|
| +
|
| // Check if interceptor provided a value for property. If it's
|
| // the case, return immediately.
|
| Label interceptor_failed;
|
| @@ -1606,7 +1583,8 @@ void CallStubCompiler::GenerateGlobalReceiverCheck(Handle<JSObject> object,
|
|
|
| // Check that the maps haven't changed.
|
| __ JumpIfSmi(receiver, miss);
|
| - CheckPrototypes(object, receiver, holder, x3, x1, x4, name, miss);
|
| + CheckPrototypes(IC::CurrentTypeOf(object, isolate()),
|
| + receiver, holder, x3, x1, x4, name, miss);
|
| }
|
|
|
|
|
| @@ -1672,7 +1650,8 @@ Handle<Code> CallStubCompiler::CompileCallField(Handle<JSObject> object,
|
|
|
| // Do the right check and compute the holder register.
|
| Register holder_reg = CheckPrototypes(
|
| - object, receiver, holder, x1, x3, x4, name, &miss);
|
| + IC::CurrentTypeOf(object, isolate()),
|
| + receiver, holder, x1, x3, x4, name, &miss);
|
| Register function = x1;
|
| GenerateFastPropertyLoad(masm(), function, holder_reg,
|
| index.is_inobject(holder),
|
| @@ -1719,8 +1698,8 @@ Handle<Code> CallStubCompiler::CompileArrayCodeCall(
|
| __ JumpIfSmi(receiver, &miss);
|
|
|
| // Check that the maps haven't changed.
|
| - CheckPrototypes(Handle<JSObject>::cast(object), receiver, holder, x3, x0,
|
| - x4, name, &miss);
|
| + CheckPrototypes(IC::CurrentTypeOf(object, isolate()),
|
| + receiver, holder, x3, x0, x4, name, &miss);
|
| } else {
|
| ASSERT(cell->value() == *function);
|
| GenerateGlobalReceiverCheck(Handle<JSObject>::cast(object), holder, name,
|
| @@ -1782,8 +1761,8 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall(
|
| __ JumpIfSmi(receiver, &miss);
|
|
|
| // Check that the maps haven't changed.
|
| - CheckPrototypes(Handle<JSObject>::cast(object), receiver, holder, x3, x0, x4,
|
| - name, &miss);
|
| + CheckPrototypes(IC::CurrentTypeOf(object, isolate()),
|
| + receiver, holder, x3, x0, x4, name, &miss);
|
|
|
| if (argc == 0) {
|
| // Nothing to do, just return the length.
|
| @@ -2055,8 +2034,8 @@ Handle<Code> CallStubCompiler::CompileArrayPopCall(
|
| __ JumpIfSmi(receiver, &miss);
|
|
|
| // Check that the maps haven't changed.
|
| - CheckPrototypes(Handle<JSObject>::cast(object), receiver, holder,
|
| - x3, x4, x0, name, &miss);
|
| + CheckPrototypes(IC::CurrentTypeOf(object, isolate()),
|
| + receiver, holder, x3, x4, x0, name, &miss);
|
|
|
| // Get the elements array of the object.
|
| Register elements = x3;
|
| @@ -2141,15 +2120,15 @@ Handle<Code> CallStubCompiler::CompileStringCharCodeAtCall(
|
| GenerateNameCheck(name, &name_miss);
|
|
|
| // Check that the maps starting from the prototype haven't changed.
|
| - Register prototype = x0;
|
| + Register prototype_reg = x0;
|
| GenerateDirectLoadGlobalFunctionPrototype(masm(),
|
| Context::STRING_FUNCTION_INDEX,
|
| - prototype,
|
| + prototype_reg,
|
| &miss);
|
| ASSERT(!object.is_identical_to(holder));
|
| - CheckPrototypes(
|
| - Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))),
|
| - prototype, holder, x1, x3, x4, name, &miss);
|
| + Handle<JSObject> prototype(JSObject::cast(object->GetPrototype(isolate())));
|
| + CheckPrototypes(IC::CurrentTypeOf(prototype, isolate()),
|
| + prototype_reg, holder, x1, x3, x4, name, &miss);
|
|
|
| Register result = x0;
|
| Register receiver = x1;
|
| @@ -2226,15 +2205,15 @@ Handle<Code> CallStubCompiler::CompileStringCharAtCall(
|
| GenerateNameCheck(name, &name_miss);
|
|
|
| // Check that the maps starting from the prototype haven't changed.
|
| - Register prototype = x0;
|
| + Register prototype_reg = x0;
|
| GenerateDirectLoadGlobalFunctionPrototype(masm(),
|
| Context::STRING_FUNCTION_INDEX,
|
| - prototype,
|
| + prototype_reg,
|
| &miss);
|
| ASSERT(!object.is_identical_to(holder));
|
| - CheckPrototypes(
|
| - Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))),
|
| - prototype, holder, x1, x3, x4, name, &miss);
|
| + Handle<JSObject> prototype(JSObject::cast(object->GetPrototype(isolate())));
|
| + CheckPrototypes(IC::CurrentTypeOf(prototype, isolate()),
|
| + prototype_reg, holder, x1, x3, x4, name, &miss);
|
|
|
| Register receiver = x0;
|
| Register index = x4;
|
| @@ -2309,8 +2288,8 @@ Handle<Code> CallStubCompiler::CompileStringFromCharCodeCall(
|
| __ Peek(receiver, kPointerSize);
|
| __ JumpIfSmi(receiver, &miss);
|
|
|
| - CheckPrototypes(Handle<JSObject>::cast(object), receiver, holder,
|
| - x0, x3, x4, name, &miss);
|
| + CheckPrototypes(IC::CurrentTypeOf(object, isolate()),
|
| + receiver, holder, x0, x3, x4, name, &miss);
|
| } else {
|
| ASSERT(cell->value() == *function);
|
| GenerateGlobalReceiverCheck(Handle<JSObject>::cast(object), holder, name,
|
| @@ -2382,8 +2361,8 @@ Handle<Code> CallStubCompiler::CompileMathFloorCall(
|
| Register receiver = x1;
|
| __ Peek(receiver, kPointerSize);
|
| __ JumpIfSmi(receiver, &miss);
|
| - CheckPrototypes(Handle<JSObject>::cast(object), receiver, holder,
|
| - x0, x3, x4, name, &miss);
|
| + CheckPrototypes(IC::CurrentTypeOf(object, isolate()),
|
| + receiver, holder, x0, x3, x4, name, &miss);
|
| } else {
|
| ASSERT(cell->value() == *function);
|
| GenerateGlobalReceiverCheck(
|
| @@ -2498,8 +2477,8 @@ Handle<Code> CallStubCompiler::CompileMathAbsCall(
|
| Register receiver = x1;
|
| __ Peek(receiver, kPointerSize);
|
| __ JumpIfSmi(receiver, &miss);
|
| - CheckPrototypes(Handle<JSObject>::cast(object), receiver, holder,
|
| - x0, x3, x4, name, &miss);
|
| + CheckPrototypes(IC::CurrentTypeOf(object, isolate()),
|
| + receiver, holder, x0, x3, x4, name, &miss);
|
| } else {
|
| ASSERT(cell->value() == *function);
|
| GenerateGlobalReceiverCheck(Handle<JSObject>::cast(object), holder, name,
|
| @@ -2593,8 +2572,8 @@ Handle<Code> CallStubCompiler::CompileFastApiCall(
|
| ReserveSpaceForFastApiCall(masm(), x0);
|
|
|
| // Check that the maps haven't changed and find a Holder as a side effect.
|
| - CheckPrototypes(Handle<JSObject>::cast(object), receiver, holder, x0, x3, x4,
|
| - name, depth, &miss);
|
| + CheckPrototypes(IC::CurrentTypeOf(object, isolate()),
|
| + receiver, holder, x0, x3, x4, name, depth, &miss);
|
|
|
| GenerateFastApiDirectCall(masm(), optimization, argc, false);
|
|
|
| @@ -2649,8 +2628,8 @@ void CallStubCompiler::CompileHandlerFrontend(Handle<Object> object,
|
| __ IncrementCounter(isolate()->counters()->call_const(), 1, x0, x3);
|
|
|
| // Check that the maps haven't changed.
|
| - CheckPrototypes(Handle<JSObject>::cast(object), receiver, holder,
|
| - x0, x3, x4, name, &miss);
|
| + CheckPrototypes(IC::CurrentTypeOf(object, isolate()),
|
| + receiver, holder, x0, x3, x4, name, &miss);
|
|
|
| // Patch the receiver on the stack with the global proxy if necessary.
|
| if (object->IsGlobalObject()) {
|
| @@ -2664,24 +2643,26 @@ void CallStubCompiler::CompileHandlerFrontend(Handle<Object> object,
|
| // Check that the object is a string.
|
| __ JumpIfObjectType(receiver, x3, x3, FIRST_NONSTRING_TYPE, &miss, ge);
|
| // Check that the maps starting from the prototype haven't changed.
|
| - Register prototype = x0;
|
| + Register prototype_reg = x0;
|
| GenerateDirectLoadGlobalFunctionPrototype(
|
| - masm(), Context::STRING_FUNCTION_INDEX, prototype, &miss);
|
| + masm(), Context::STRING_FUNCTION_INDEX, prototype_reg, &miss);
|
| + Handle<Object> prototype(object->GetPrototype(isolate()), isolate());
|
| CheckPrototypes(
|
| - Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))),
|
| - prototype, holder, x3, x1, x4, name, &miss);
|
| + IC::CurrentTypeOf(prototype, isolate()),
|
| + prototype_reg, holder, x3, x1, x4, name, &miss);
|
| break;
|
| }
|
| case SYMBOL_CHECK: {
|
| // Check that the object is a symbol.
|
| __ JumpIfNotObjectType(receiver, x3, x3, SYMBOL_TYPE, &miss);
|
| // Check that the maps starting from the prototype haven't changed.
|
| - Register prototype = x0;
|
| + Register prototype_reg = x0;
|
| GenerateDirectLoadGlobalFunctionPrototype(
|
| - masm(), Context::SYMBOL_FUNCTION_INDEX, prototype, &miss);
|
| + masm(), Context::SYMBOL_FUNCTION_INDEX, prototype_reg, &miss);
|
| + Handle<Object> prototype(object->GetPrototype(isolate()), isolate());
|
| CheckPrototypes(
|
| - Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))),
|
| - prototype, holder, x3, x1, x4, name, &miss);
|
| + IC::CurrentTypeOf(prototype, isolate()),
|
| + prototype_reg, holder, x3, x1, x4, name, &miss);
|
| break;
|
| }
|
| case NUMBER_CHECK: {
|
| @@ -2692,24 +2673,26 @@ void CallStubCompiler::CompileHandlerFrontend(Handle<Object> object,
|
|
|
| __ Bind(&fast);
|
| // Check that the maps starting from the prototype haven't changed.
|
| - Register prototype = x0;
|
| + Register prototype_reg = x0;
|
| GenerateDirectLoadGlobalFunctionPrototype(
|
| - masm(), Context::NUMBER_FUNCTION_INDEX, prototype, &miss);
|
| + masm(), Context::NUMBER_FUNCTION_INDEX, prototype_reg, &miss);
|
| + Handle<Object> prototype(object->GetPrototype(isolate()), isolate());
|
| CheckPrototypes(
|
| - Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))),
|
| - prototype, holder, x3, x1, x4, name, &miss);
|
| + IC::CurrentTypeOf(prototype, isolate()),
|
| + prototype_reg, holder, x3, x1, x4, name, &miss);
|
| break;
|
| }
|
| case BOOLEAN_CHECK: {
|
| GenerateBooleanCheck(receiver, &miss);
|
|
|
| // Check that the maps starting from the prototype haven't changed.
|
| - Register prototype = x0;
|
| + Register prototype_reg = x0;
|
| GenerateDirectLoadGlobalFunctionPrototype(
|
| - masm(), Context::BOOLEAN_FUNCTION_INDEX, prototype, &miss);
|
| + masm(), Context::BOOLEAN_FUNCTION_INDEX, prototype_reg, &miss);
|
| + Handle<Object> prototype(object->GetPrototype(isolate()), isolate());
|
| CheckPrototypes(
|
| - Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))),
|
| - prototype, holder, x3, x1, x4, name, &miss);
|
| + IC::CurrentTypeOf(prototype, isolate()),
|
| + prototype_reg, holder, x3, x1, x4, name, &miss);
|
| break;
|
| }
|
| }
|
| @@ -2872,7 +2855,8 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback(
|
| Handle<Name> name,
|
| Handle<ExecutableAccessorInfo> callback) {
|
| ASM_LOCATION("StoreStubCompiler::CompileStoreCallback");
|
| - HandlerFrontend(object, receiver(), holder, name);
|
| + HandlerFrontend(IC::CurrentTypeOf(object, isolate()),
|
| + receiver(), holder, name);
|
|
|
| // Stub never generated for non-global objects that require access checks.
|
| ASSERT(holder->IsJSGlobalProxy() || !holder->IsAccessCheckNeeded());
|
| @@ -2977,12 +2961,10 @@ Handle<Code> StoreStubCompiler::CompileStoreInterceptor(
|
| }
|
|
|
|
|
| -Handle<Code> LoadStubCompiler::CompileLoadNonexistent(
|
| - Handle<Object> object,
|
| - Handle<JSObject> last,
|
| - Handle<Name> name,
|
| - Handle<JSGlobalObject> global) {
|
| - NonexistentHandlerFrontend(object, last, name, global);
|
| +Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<Type> type,
|
| + Handle<JSObject> last,
|
| + Handle<Name> name) {
|
| + NonexistentHandlerFrontend(type, last, name);
|
|
|
| // Return undefined if maps of the full prototype chain are still the
|
| // same and no global property with this name contains a value.
|
| @@ -3078,14 +3060,14 @@ void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm,
|
|
|
|
|
| Handle<Code> LoadStubCompiler::CompileLoadGlobal(
|
| - Handle<Object> object,
|
| + Handle<Type> type,
|
| Handle<GlobalObject> global,
|
| Handle<PropertyCell> cell,
|
| Handle<Name> name,
|
| bool is_dont_delete) {
|
| Label miss;
|
|
|
| - HandlerFrontendHeader(object, receiver(), global, name, &miss);
|
| + HandlerFrontendHeader(type, receiver(), global, name, &miss);
|
|
|
| // Get the value from the cell.
|
| __ Mov(x3, Operand(cell));
|
| @@ -3195,7 +3177,8 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback(
|
| Handle<JSObject> holder,
|
| Handle<Name> name,
|
| const CallOptimization& call_optimization) {
|
| - HandlerFrontend(object, receiver(), holder, name);
|
| + HandlerFrontend(IC::CurrentTypeOf(object, isolate()),
|
| + receiver(), holder, name);
|
|
|
| Register values[] = { value() };
|
| GenerateFastApiCall(
|
|
|