Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: src/arm/stub-cache-arm.cc

Issue 12210083: Renamed "symbols" to "internalized strings" throughout the code base, (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed Yang's comments Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/ast.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 // Miss: fall through. 124 // Miss: fall through.
125 __ bind(&miss); 125 __ bind(&miss);
126 } 126 }
127 127
128 128
129 // Helper function used to check that the dictionary doesn't contain 129 // Helper function used to check that the dictionary doesn't contain
130 // the property. This function may return false negatives, so miss_label 130 // the property. This function may return false negatives, so miss_label
131 // must always call a backup property check that is complete. 131 // must always call a backup property check that is complete.
132 // This function is safe to call if the receiver has fast properties. 132 // This function is safe to call if the receiver has fast properties.
133 // Name must be a symbol and receiver must be a heap object. 133 // Name must be internalized and receiver must be a heap object.
134 static void GenerateDictionaryNegativeLookup(MacroAssembler* masm, 134 static void GenerateDictionaryNegativeLookup(MacroAssembler* masm,
135 Label* miss_label, 135 Label* miss_label,
136 Register receiver, 136 Register receiver,
137 Handle<String> name, 137 Handle<String> name,
138 Register scratch0, 138 Register scratch0,
139 Register scratch1) { 139 Register scratch1) {
140 ASSERT(name->IsSymbol()); 140 ASSERT(name->IsInternalizedString());
141 Counters* counters = masm->isolate()->counters(); 141 Counters* counters = masm->isolate()->counters();
142 __ IncrementCounter(counters->negative_lookups(), 1, scratch0, scratch1); 142 __ IncrementCounter(counters->negative_lookups(), 1, scratch0, scratch1);
143 __ IncrementCounter(counters->negative_lookups_miss(), 1, scratch0, scratch1); 143 __ IncrementCounter(counters->negative_lookups_miss(), 1, scratch0, scratch1);
144 144
145 Label done; 145 Label done;
146 146
147 const int kInterceptorOrAccessCheckNeededMask = 147 const int kInterceptorOrAccessCheckNeededMask =
148 (1 << Map::kHasNamedInterceptor) | (1 << Map::kIsAccessCheckNeeded); 148 (1 << Map::kHasNamedInterceptor) | (1 << Map::kIsAccessCheckNeeded);
149 149
150 // Bail out if the receiver has a named interceptor or requires access checks. 150 // Bail out if the receiver has a named interceptor or requires access checks.
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after
1095 ++depth; 1095 ++depth;
1096 1096
1097 // Only global objects and objects that do not require access 1097 // Only global objects and objects that do not require access
1098 // checks are allowed in stubs. 1098 // checks are allowed in stubs.
1099 ASSERT(current->IsJSGlobalProxy() || !current->IsAccessCheckNeeded()); 1099 ASSERT(current->IsJSGlobalProxy() || !current->IsAccessCheckNeeded());
1100 1100
1101 Handle<JSObject> prototype(JSObject::cast(current->GetPrototype())); 1101 Handle<JSObject> prototype(JSObject::cast(current->GetPrototype()));
1102 if (!current->HasFastProperties() && 1102 if (!current->HasFastProperties() &&
1103 !current->IsJSGlobalObject() && 1103 !current->IsJSGlobalObject() &&
1104 !current->IsJSGlobalProxy()) { 1104 !current->IsJSGlobalProxy()) {
1105 if (!name->IsSymbol()) { 1105 if (!name->IsInternalizedString()) {
1106 name = factory()->LookupSymbol(name); 1106 name = factory()->InternalizeString(name);
1107 } 1107 }
1108 ASSERT(current->property_dictionary()->FindEntry(*name) == 1108 ASSERT(current->property_dictionary()->FindEntry(*name) ==
1109 StringDictionary::kNotFound); 1109 StringDictionary::kNotFound);
1110 1110
1111 GenerateDictionaryNegativeLookup(masm(), miss, reg, name, 1111 GenerateDictionaryNegativeLookup(masm(), miss, reg, name,
1112 scratch1, scratch2); 1112 scratch1, scratch2);
1113 1113
1114 __ ldr(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset)); 1114 __ ldr(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset));
1115 reg = holder_reg; // From now on the object will be in holder_reg. 1115 reg = holder_reg; // From now on the object will be in holder_reg.
1116 __ ldr(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset)); 1116 __ ldr(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset));
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after
2045 STRING_INDEX_IS_NUMBER); 2045 STRING_INDEX_IS_NUMBER);
2046 generator.GenerateFast(masm()); 2046 generator.GenerateFast(masm());
2047 __ Drop(argc + 1); 2047 __ Drop(argc + 1);
2048 __ Ret(); 2048 __ Ret();
2049 2049
2050 StubRuntimeCallHelper call_helper; 2050 StubRuntimeCallHelper call_helper;
2051 generator.GenerateSlow(masm(), call_helper); 2051 generator.GenerateSlow(masm(), call_helper);
2052 2052
2053 if (index_out_of_range.is_linked()) { 2053 if (index_out_of_range.is_linked()) {
2054 __ bind(&index_out_of_range); 2054 __ bind(&index_out_of_range);
2055 __ LoadRoot(r0, Heap::kEmptyStringRootIndex); 2055 __ LoadRoot(r0, Heap::kempty_stringRootIndex);
2056 __ Drop(argc + 1); 2056 __ Drop(argc + 1);
2057 __ Ret(); 2057 __ Ret();
2058 } 2058 }
2059 2059
2060 __ bind(&miss); 2060 __ bind(&miss);
2061 // Restore function name in r2. 2061 // Restore function name in r2.
2062 __ Move(r2, name); 2062 __ Move(r2, name);
2063 __ bind(&name_miss); 2063 __ bind(&name_miss);
2064 GenerateMissBranch(); 2064 GenerateMissBranch();
2065 2065
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
2481 // Patch the receiver on the stack with the global proxy if 2481 // Patch the receiver on the stack with the global proxy if
2482 // necessary. 2482 // necessary.
2483 if (object->IsGlobalObject()) { 2483 if (object->IsGlobalObject()) {
2484 __ ldr(r3, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset)); 2484 __ ldr(r3, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset));
2485 __ str(r3, MemOperand(sp, argc * kPointerSize)); 2485 __ str(r3, MemOperand(sp, argc * kPointerSize));
2486 } 2486 }
2487 break; 2487 break;
2488 2488
2489 case STRING_CHECK: 2489 case STRING_CHECK:
2490 if (function->IsBuiltin() || !function->shared()->is_classic_mode()) { 2490 if (function->IsBuiltin() || !function->shared()->is_classic_mode()) {
2491 // Check that the object is a two-byte string or a symbol. 2491 // Check that the object is a two-byte string (internalized or not).
2492 __ CompareObjectType(r1, r3, r3, FIRST_NONSTRING_TYPE); 2492 __ CompareObjectType(r1, r3, r3, FIRST_NONSTRING_TYPE);
2493 __ b(ge, &miss); 2493 __ b(ge, &miss);
2494 // Check that the maps starting from the prototype haven't changed. 2494 // Check that the maps starting from the prototype haven't changed.
2495 GenerateDirectLoadGlobalFunctionPrototype( 2495 GenerateDirectLoadGlobalFunctionPrototype(
2496 masm(), Context::STRING_FUNCTION_INDEX, r0, &miss); 2496 masm(), Context::STRING_FUNCTION_INDEX, r0, &miss);
2497 CheckPrototypes( 2497 CheckPrototypes(
2498 Handle<JSObject>(JSObject::cast(object->GetPrototype())), 2498 Handle<JSObject>(JSObject::cast(object->GetPrototype())),
2499 r0, holder, r3, r1, r4, name, &miss); 2499 r0, holder, r3, r1, r4, name, &miss);
2500 } else { 2500 } else {
2501 // Calling non-strict non-builtins with a value as the receiver 2501 // Calling non-strict non-builtins with a value as the receiver
(...skipping 1663 matching lines...) Expand 10 before | Expand all | Expand 10 after
4165 __ Jump(ic_slow, RelocInfo::CODE_TARGET); 4165 __ Jump(ic_slow, RelocInfo::CODE_TARGET);
4166 } 4166 }
4167 } 4167 }
4168 4168
4169 4169
4170 #undef __ 4170 #undef __
4171 4171
4172 } } // namespace v8::internal 4172 } } // namespace v8::internal
4173 4173
4174 #endif // V8_TARGET_ARCH_ARM 4174 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/ast.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698