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

Side by Side Diff: src/full-codegen/mips/full-codegen-mips.cc

Issue 1679813002: [compiler] Remove the special case "prototype" load in class literals. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix mips. Created 4 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_MIPS 5 #if V8_TARGET_ARCH_MIPS
6 6
7 // Note on Mips implementation: 7 // Note on Mips implementation:
8 // 8 //
9 // The result_register() for mips is the 'v0' register, which is defined 9 // The result_register() for mips is the 'v0' register, which is defined
10 // by the ABI to contain function return values. However, the first 10 // by the ABI to contain function return values. However, the first
(...skipping 2211 matching lines...) Expand 10 before | Expand all | Expand 10 after
2222 default: 2222 default:
2223 UNREACHABLE(); 2223 UNREACHABLE();
2224 } 2224 }
2225 2225
2226 __ bind(&done); 2226 __ bind(&done);
2227 context()->Plug(v0); 2227 context()->Plug(v0);
2228 } 2228 }
2229 2229
2230 2230
2231 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { 2231 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) {
2232 // Constructor is in v0.
2233 DCHECK(lit != NULL);
2234 __ push(v0);
2235
2236 // No access check is needed here since the constructor is created by the
2237 // class literal.
2238 Register scratch = a1;
2239 __ lw(scratch,
2240 FieldMemOperand(v0, JSFunction::kPrototypeOrInitialMapOffset));
2241 __ push(scratch);
2242
2243 for (int i = 0; i < lit->properties()->length(); i++) { 2232 for (int i = 0; i < lit->properties()->length(); i++) {
2244 ObjectLiteral::Property* property = lit->properties()->at(i); 2233 ObjectLiteral::Property* property = lit->properties()->at(i);
2245 Expression* value = property->value(); 2234 Expression* value = property->value();
2246 2235
2236 Register scratch = a1;
2247 if (property->is_static()) { 2237 if (property->is_static()) {
2248 __ lw(scratch, MemOperand(sp, kPointerSize)); // constructor 2238 __ lw(scratch, MemOperand(sp, kPointerSize)); // constructor
2249 } else { 2239 } else {
2250 __ lw(scratch, MemOperand(sp, 0)); // prototype 2240 __ lw(scratch, MemOperand(sp, 0)); // prototype
2251 } 2241 }
2252 __ push(scratch); 2242 __ push(scratch);
2253 EmitPropertyKey(property, lit->GetIdForProperty(i)); 2243 EmitPropertyKey(property, lit->GetIdForProperty(i));
2254 2244
2255 // The static prototype property is read only. We handle the non computed 2245 // The static prototype property is read only. We handle the non computed
2256 // property name case in the parser. Since this is the only case where we 2246 // property name case in the parser. Since this is the only case where we
(...skipping 27 matching lines...) Expand all
2284 2274
2285 case ObjectLiteral::Property::SETTER: 2275 case ObjectLiteral::Property::SETTER:
2286 __ Push(Smi::FromInt(DONT_ENUM)); 2276 __ Push(Smi::FromInt(DONT_ENUM));
2287 __ CallRuntime(Runtime::kDefineSetterPropertyUnchecked); 2277 __ CallRuntime(Runtime::kDefineSetterPropertyUnchecked);
2288 break; 2278 break;
2289 2279
2290 default: 2280 default:
2291 UNREACHABLE(); 2281 UNREACHABLE();
2292 } 2282 }
2293 } 2283 }
2294
2295 // Set both the prototype and constructor to have fast properties, and also
2296 // freeze them in strong mode.
2297 __ CallRuntime(Runtime::kFinalizeClassDefinition);
2298 } 2284 }
2299 2285
2300 2286
2301 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { 2287 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) {
2302 __ mov(a0, result_register()); 2288 __ mov(a0, result_register());
2303 __ pop(a1); 2289 __ pop(a1);
2304 Handle<Code> code = 2290 Handle<Code> code =
2305 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); 2291 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code();
2306 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. 2292 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
2307 CallIC(code, expr->BinaryOperationFeedbackId()); 2293 CallIC(code, expr->BinaryOperationFeedbackId());
(...skipping 2381 matching lines...) Expand 10 before | Expand all | Expand 10 after
4689 reinterpret_cast<uint32_t>( 4675 reinterpret_cast<uint32_t>(
4690 isolate->builtins()->OsrAfterStackCheck()->entry())); 4676 isolate->builtins()->OsrAfterStackCheck()->entry()));
4691 return OSR_AFTER_STACK_CHECK; 4677 return OSR_AFTER_STACK_CHECK;
4692 } 4678 }
4693 4679
4694 4680
4695 } // namespace internal 4681 } // namespace internal
4696 } // namespace v8 4682 } // namespace v8
4697 4683
4698 #endif // V8_TARGET_ARCH_MIPS 4684 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/full-codegen/ia32/full-codegen-ia32.cc ('k') | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698