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

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

Issue 1168093002: [strong] Implement strong mode restrictions on property access (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 5 years, 6 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
« no previous file with comments | « src/mips64/code-stubs-mips64.cc ('k') | src/mips64/lithium-codegen-mips64.cc » ('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 // 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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
8 8
9 // Note on Mips implementation: 9 // Note on Mips implementation:
10 // 10 //
(...skipping 2208 matching lines...) Expand 10 before | Expand all | Expand 10 after
2219 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next" 2219 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next"
2220 __ ld(a3, MemOperand(sp, 1 * kPointerSize)); // iter 2220 __ ld(a3, MemOperand(sp, 1 * kPointerSize)); // iter
2221 __ Push(load_name, a3, a0); // "next", iter, received 2221 __ Push(load_name, a3, a0); // "next", iter, received
2222 2222
2223 // result = receiver[f](arg); 2223 // result = receiver[f](arg);
2224 __ bind(&l_call); 2224 __ bind(&l_call);
2225 __ ld(load_receiver, MemOperand(sp, kPointerSize)); 2225 __ ld(load_receiver, MemOperand(sp, kPointerSize));
2226 __ ld(load_name, MemOperand(sp, 2 * kPointerSize)); 2226 __ ld(load_name, MemOperand(sp, 2 * kPointerSize));
2227 __ li(LoadDescriptor::SlotRegister(), 2227 __ li(LoadDescriptor::SlotRegister(),
2228 Operand(SmiFromSlot(expr->KeyedLoadFeedbackSlot()))); 2228 Operand(SmiFromSlot(expr->KeyedLoadFeedbackSlot())));
2229 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); 2229 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), SLOPPY).code();
2230 CallIC(ic, TypeFeedbackId::None()); 2230 CallIC(ic, TypeFeedbackId::None());
2231 __ mov(a0, v0); 2231 __ mov(a0, v0);
2232 __ mov(a1, a0); 2232 __ mov(a1, a0);
2233 __ sd(a1, MemOperand(sp, 2 * kPointerSize)); 2233 __ sd(a1, MemOperand(sp, 2 * kPointerSize));
2234 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); 2234 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD);
2235 __ CallStub(&stub); 2235 __ CallStub(&stub);
2236 2236
2237 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 2237 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
2238 __ Drop(1); // The function is still on the stack; drop it. 2238 __ Drop(1); // The function is still on the stack; drop it.
2239 2239
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
2392 2392
2393 2393
2394 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { 2394 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
2395 SetSourcePosition(prop->position()); 2395 SetSourcePosition(prop->position());
2396 Literal* key = prop->key()->AsLiteral(); 2396 Literal* key = prop->key()->AsLiteral();
2397 DCHECK(!prop->IsSuperAccess()); 2397 DCHECK(!prop->IsSuperAccess());
2398 2398
2399 __ li(LoadDescriptor::NameRegister(), Operand(key->value())); 2399 __ li(LoadDescriptor::NameRegister(), Operand(key->value()));
2400 __ li(LoadDescriptor::SlotRegister(), 2400 __ li(LoadDescriptor::SlotRegister(),
2401 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); 2401 Operand(SmiFromSlot(prop->PropertyFeedbackSlot())));
2402 CallLoadIC(NOT_CONTEXTUAL); 2402 CallLoadIC(NOT_CONTEXTUAL, language_mode());
2403 } 2403 }
2404 2404
2405 2405
2406 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { 2406 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) {
2407 // Stack: receiver, home_object. 2407 // Stack: receiver, home_object.
2408 SetSourcePosition(prop->position()); 2408 SetSourcePosition(prop->position());
2409 Literal* key = prop->key()->AsLiteral(); 2409 Literal* key = prop->key()->AsLiteral();
2410 DCHECK(!key->value()->IsSmi()); 2410 DCHECK(!key->value()->IsSmi());
2411 DCHECK(prop->IsSuperAccess()); 2411 DCHECK(prop->IsSuperAccess());
2412 2412
2413 __ Push(key->value()); 2413 __ Push(key->value());
2414 __ CallRuntime(Runtime::kLoadFromSuper, 3); 2414 __ Push(Smi::FromInt(language_mode()));
2415 __ CallRuntime(Runtime::kLoadFromSuper, 4);
2415 } 2416 }
2416 2417
2417 2418
2418 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { 2419 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
2419 SetSourcePosition(prop->position()); 2420 SetSourcePosition(prop->position());
2420 // Call keyed load IC. It has register arguments receiver and key. 2421 // Call keyed load IC. It has register arguments receiver and key.
2421 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); 2422 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), language_mode()).code();
2422 __ li(LoadDescriptor::SlotRegister(), 2423 __ li(LoadDescriptor::SlotRegister(),
2423 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); 2424 Operand(SmiFromSlot(prop->PropertyFeedbackSlot())));
2424 CallIC(ic); 2425 CallIC(ic);
2425 } 2426 }
2426 2427
2427 2428
2428 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { 2429 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) {
2429 // Stack: receiver, home_object, key. 2430 // Stack: receiver, home_object, key.
2431 __ Push(Smi::FromInt(language_mode()));
2430 SetSourcePosition(prop->position()); 2432 SetSourcePosition(prop->position());
2431 2433
2432 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3); 2434 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 4);
2433 } 2435 }
2434 2436
2435 2437
2436 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, 2438 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
2437 Token::Value op, 2439 Token::Value op,
2438 Expression* left_expr, 2440 Expression* left_expr,
2439 Expression* right_expr) { 2441 Expression* right_expr) {
2440 Label done, smi_case, stub_call; 2442 Label done, smi_case, stub_call;
2441 2443
2442 Register scratch1 = a2; 2444 Register scratch1 = a2;
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
2971 Literal* key = prop->key()->AsLiteral(); 2973 Literal* key = prop->key()->AsLiteral();
2972 DCHECK(!key->value()->IsSmi()); 2974 DCHECK(!key->value()->IsSmi());
2973 // Load the function from the receiver. 2975 // Load the function from the receiver.
2974 const Register scratch = a1; 2976 const Register scratch = a1;
2975 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); 2977 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference();
2976 VisitForAccumulatorValue(super_ref->home_object()); 2978 VisitForAccumulatorValue(super_ref->home_object());
2977 __ mov(scratch, v0); 2979 __ mov(scratch, v0);
2978 VisitForAccumulatorValue(super_ref->this_var()); 2980 VisitForAccumulatorValue(super_ref->this_var());
2979 __ Push(scratch, v0, v0, scratch); 2981 __ Push(scratch, v0, v0, scratch);
2980 __ Push(key->value()); 2982 __ Push(key->value());
2983 __ Push(Smi::FromInt(language_mode()));
2981 2984
2982 // Stack here: 2985 // Stack here:
2983 // - home_object 2986 // - home_object
2984 // - this (receiver) 2987 // - this (receiver)
2985 // - this (receiver) <-- LoadFromSuper will pop here and below. 2988 // - this (receiver) <-- LoadFromSuper will pop here and below.
2986 // - home_object 2989 // - home_object
2987 // - key 2990 // - key
2988 __ CallRuntime(Runtime::kLoadFromSuper, 3); 2991 // - language_mode
2992 __ CallRuntime(Runtime::kLoadFromSuper, 4);
2989 2993
2990 // Replace home_object with target function. 2994 // Replace home_object with target function.
2991 __ sd(v0, MemOperand(sp, kPointerSize)); 2995 __ sd(v0, MemOperand(sp, kPointerSize));
2992 2996
2993 // Stack here: 2997 // Stack here:
2994 // - target function 2998 // - target function
2995 // - this (receiver) 2999 // - this (receiver)
2996 EmitCall(expr, CallICState::METHOD); 3000 EmitCall(expr, CallICState::METHOD);
2997 } 3001 }
2998 3002
(...skipping 30 matching lines...) Expand all
3029 3033
3030 SetSourcePosition(prop->position()); 3034 SetSourcePosition(prop->position());
3031 // Load the function from the receiver. 3035 // Load the function from the receiver.
3032 const Register scratch = a1; 3036 const Register scratch = a1;
3033 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); 3037 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference();
3034 VisitForAccumulatorValue(super_ref->home_object()); 3038 VisitForAccumulatorValue(super_ref->home_object());
3035 __ Move(scratch, v0); 3039 __ Move(scratch, v0);
3036 VisitForAccumulatorValue(super_ref->this_var()); 3040 VisitForAccumulatorValue(super_ref->this_var());
3037 __ Push(scratch, v0, v0, scratch); 3041 __ Push(scratch, v0, v0, scratch);
3038 VisitForStackValue(prop->key()); 3042 VisitForStackValue(prop->key());
3043 __ Push(Smi::FromInt(language_mode()));
3039 3044
3040 // Stack here: 3045 // Stack here:
3041 // - home_object 3046 // - home_object
3042 // - this (receiver) 3047 // - this (receiver)
3043 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. 3048 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below.
3044 // - home_object 3049 // - home_object
3045 // - key 3050 // - key
3046 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3); 3051 // - language_mode
3052 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 4);
3047 3053
3048 // Replace home_object with target function. 3054 // Replace home_object with target function.
3049 __ sd(v0, MemOperand(sp, kPointerSize)); 3055 __ sd(v0, MemOperand(sp, kPointerSize));
3050 3056
3051 // Stack here: 3057 // Stack here:
3052 // - target function 3058 // - target function
3053 // - this (receiver) 3059 // - this (receiver)
3054 EmitCall(expr, CallICState::METHOD); 3060 EmitCall(expr, CallICState::METHOD);
3055 } 3061 }
3056 3062
(...skipping 2510 matching lines...) Expand 10 before | Expand all | Expand 10 after
5567 reinterpret_cast<uint64_t>( 5573 reinterpret_cast<uint64_t>(
5568 isolate->builtins()->OsrAfterStackCheck()->entry())); 5574 isolate->builtins()->OsrAfterStackCheck()->entry()));
5569 return OSR_AFTER_STACK_CHECK; 5575 return OSR_AFTER_STACK_CHECK;
5570 } 5576 }
5571 5577
5572 5578
5573 } // namespace internal 5579 } // namespace internal
5574 } // namespace v8 5580 } // namespace v8
5575 5581
5576 #endif // V8_TARGET_ARCH_MIPS64 5582 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips64/code-stubs-mips64.cc ('k') | src/mips64/lithium-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698