Chromium Code Reviews

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

Issue 1168093002: [strong] Implement strong mode restrictions on property access (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: slim down, improve tests Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved.7 1 // Copyright 2012 the V8 project authors. All rights reserved.7
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 2943 matching lines...)
2954 2954
2955 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { 2955 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
2956 DCHECK(ToRegister(instr->context()).is(cp)); 2956 DCHECK(ToRegister(instr->context()).is(cp));
2957 DCHECK(ToRegister(instr->global_object()) 2957 DCHECK(ToRegister(instr->global_object())
2958 .is(LoadDescriptor::ReceiverRegister())); 2958 .is(LoadDescriptor::ReceiverRegister()));
2959 DCHECK(ToRegister(instr->result()).is(v0)); 2959 DCHECK(ToRegister(instr->result()).is(v0));
2960 2960
2961 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); 2961 __ li(LoadDescriptor::NameRegister(), Operand(instr->name()));
2962 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); 2962 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
2963 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; 2963 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL;
2964 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, 2964 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, SLOPPY,
2965 PREMONOMORPHIC).code(); 2965 PREMONOMORPHIC).code();
2966 CallCode(ic, RelocInfo::CODE_TARGET, instr); 2966 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2967 } 2967 }
2968 2968
2969 2969
2970 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { 2970 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
2971 Register context = ToRegister(instr->context()); 2971 Register context = ToRegister(instr->context());
2972 Register result = ToRegister(instr->result()); 2972 Register result = ToRegister(instr->result());
2973 2973
2974 __ lw(result, ContextOperand(context, instr->slot_index())); 2974 __ lw(result, ContextOperand(context, instr->slot_index()));
(...skipping 79 matching lines...)
3054 3054
3055 3055
3056 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { 3056 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
3057 DCHECK(ToRegister(instr->context()).is(cp)); 3057 DCHECK(ToRegister(instr->context()).is(cp));
3058 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); 3058 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister()));
3059 DCHECK(ToRegister(instr->result()).is(v0)); 3059 DCHECK(ToRegister(instr->result()).is(v0));
3060 3060
3061 // Name is always in a2. 3061 // Name is always in a2.
3062 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); 3062 __ li(LoadDescriptor::NameRegister(), Operand(instr->name()));
3063 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); 3063 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr);
3064 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( 3064 Handle<Code> ic =
3065 isolate(), NOT_CONTEXTUAL, 3065 CodeFactory::LoadICInOptimizedCode(
3066 instr->hydrogen()->initialization_state()).code(); 3066 isolate(), NOT_CONTEXTUAL, instr->hydrogen()->language_mode(),
3067 instr->hydrogen()->initialization_state()).code();
3067 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3068 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3068 } 3069 }
3069 3070
3070 3071
3071 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { 3072 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
3072 Register scratch = scratch0(); 3073 Register scratch = scratch0();
3073 Register function = ToRegister(instr->function()); 3074 Register function = ToRegister(instr->function());
3074 Register result = ToRegister(instr->result()); 3075 Register result = ToRegister(instr->result());
3075 3076
3076 // Get the prototype or initial map from the function. 3077 // Get the prototype or initial map from the function.
(...skipping 306 matching lines...)
3383 DCHECK(ToRegister(instr->context()).is(cp)); 3384 DCHECK(ToRegister(instr->context()).is(cp));
3384 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); 3385 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister()));
3385 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); 3386 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister()));
3386 3387
3387 if (instr->hydrogen()->HasVectorAndSlot()) { 3388 if (instr->hydrogen()->HasVectorAndSlot()) {
3388 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); 3389 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr);
3389 } 3390 }
3390 3391
3391 Handle<Code> ic = 3392 Handle<Code> ic =
3392 CodeFactory::KeyedLoadICInOptimizedCode( 3393 CodeFactory::KeyedLoadICInOptimizedCode(
3393 isolate(), instr->hydrogen()->initialization_state()).code(); 3394 isolate(), instr->hydrogen()->language_mode(),
3395 instr->hydrogen()->initialization_state()).code();
3394 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3396 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3395 } 3397 }
3396 3398
3397 3399
3398 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { 3400 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) {
3399 Register scratch = scratch0(); 3401 Register scratch = scratch0();
3400 Register temp = scratch1(); 3402 Register temp = scratch1();
3401 Register result = ToRegister(instr->result()); 3403 Register result = ToRegister(instr->result());
3402 3404
3403 if (instr->hydrogen()->from_inlined()) { 3405 if (instr->hydrogen()->from_inlined()) {
(...skipping 2694 matching lines...)
6098 __ Push(at, ToRegister(instr->function())); 6100 __ Push(at, ToRegister(instr->function()));
6099 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6101 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6100 RecordSafepoint(Safepoint::kNoLazyDeopt); 6102 RecordSafepoint(Safepoint::kNoLazyDeopt);
6101 } 6103 }
6102 6104
6103 6105
6104 #undef __ 6106 #undef __
6105 6107
6106 } // namespace internal 6108 } // namespace internal
6107 } // namespace v8 6109 } // namespace v8
OLDNEW

Powered by Google App Engine