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

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

Issue 1189153002: Revert of [strong] Implement strong mode restrictions on property access (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/x87/code-stubs-x87.cc ('k') | src/x87/lithium-codegen-x87.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_X87 7 #if V8_TARGET_ARCH_X87
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 2139 matching lines...) Expand 10 before | Expand all | Expand 10 after
2150 __ mov(load_name, isolate()->factory()->next_string()); 2150 __ mov(load_name, isolate()->factory()->next_string());
2151 __ push(load_name); // "next" 2151 __ push(load_name); // "next"
2152 __ push(Operand(esp, 2 * kPointerSize)); // iter 2152 __ push(Operand(esp, 2 * kPointerSize)); // iter
2153 __ push(eax); // received 2153 __ push(eax); // received
2154 2154
2155 // result = receiver[f](arg); 2155 // result = receiver[f](arg);
2156 __ bind(&l_call); 2156 __ bind(&l_call);
2157 __ mov(load_receiver, Operand(esp, kPointerSize)); 2157 __ mov(load_receiver, Operand(esp, kPointerSize));
2158 __ mov(LoadDescriptor::SlotRegister(), 2158 __ mov(LoadDescriptor::SlotRegister(),
2159 Immediate(SmiFromSlot(expr->KeyedLoadFeedbackSlot()))); 2159 Immediate(SmiFromSlot(expr->KeyedLoadFeedbackSlot())));
2160 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), SLOPPY).code(); 2160 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code();
2161 CallIC(ic, TypeFeedbackId::None()); 2161 CallIC(ic, TypeFeedbackId::None());
2162 __ mov(edi, eax); 2162 __ mov(edi, eax);
2163 __ mov(Operand(esp, 2 * kPointerSize), edi); 2163 __ mov(Operand(esp, 2 * kPointerSize), edi);
2164 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); 2164 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD);
2165 __ CallStub(&stub); 2165 __ CallStub(&stub);
2166 2166
2167 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); 2167 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
2168 __ Drop(1); // The function is still on the stack; drop it. 2168 __ Drop(1); // The function is still on the stack; drop it.
2169 2169
2170 // if (!result.done) goto l_try; 2170 // if (!result.done) goto l_try;
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
2319 2319
2320 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { 2320 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
2321 SetSourcePosition(prop->position()); 2321 SetSourcePosition(prop->position());
2322 Literal* key = prop->key()->AsLiteral(); 2322 Literal* key = prop->key()->AsLiteral();
2323 DCHECK(!key->value()->IsSmi()); 2323 DCHECK(!key->value()->IsSmi());
2324 DCHECK(!prop->IsSuperAccess()); 2324 DCHECK(!prop->IsSuperAccess());
2325 2325
2326 __ mov(LoadDescriptor::NameRegister(), Immediate(key->value())); 2326 __ mov(LoadDescriptor::NameRegister(), Immediate(key->value()));
2327 __ mov(LoadDescriptor::SlotRegister(), 2327 __ mov(LoadDescriptor::SlotRegister(),
2328 Immediate(SmiFromSlot(prop->PropertyFeedbackSlot()))); 2328 Immediate(SmiFromSlot(prop->PropertyFeedbackSlot())));
2329 CallLoadIC(NOT_CONTEXTUAL, language_mode()); 2329 CallLoadIC(NOT_CONTEXTUAL);
2330 } 2330 }
2331 2331
2332 2332
2333 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { 2333 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) {
2334 // Stack: receiver, home_object. 2334 // Stack: receiver, home_object.
2335 SetSourcePosition(prop->position()); 2335 SetSourcePosition(prop->position());
2336 Literal* key = prop->key()->AsLiteral(); 2336 Literal* key = prop->key()->AsLiteral();
2337 DCHECK(!key->value()->IsSmi()); 2337 DCHECK(!key->value()->IsSmi());
2338 DCHECK(prop->IsSuperAccess()); 2338 DCHECK(prop->IsSuperAccess());
2339 2339
2340 __ push(Immediate(key->value())); 2340 __ push(Immediate(key->value()));
2341 __ push(Immediate(Smi::FromInt(language_mode()))); 2341 __ CallRuntime(Runtime::kLoadFromSuper, 3);
2342 __ CallRuntime(Runtime::kLoadFromSuper, 4);
2343 } 2342 }
2344 2343
2345 2344
2346 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { 2345 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
2347 SetSourcePosition(prop->position()); 2346 SetSourcePosition(prop->position());
2348 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), language_mode()).code(); 2347 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code();
2349 __ mov(LoadDescriptor::SlotRegister(), 2348 __ mov(LoadDescriptor::SlotRegister(),
2350 Immediate(SmiFromSlot(prop->PropertyFeedbackSlot()))); 2349 Immediate(SmiFromSlot(prop->PropertyFeedbackSlot())));
2351 CallIC(ic); 2350 CallIC(ic);
2352 } 2351 }
2353 2352
2354 2353
2355 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { 2354 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) {
2356 // Stack: receiver, home_object, key. 2355 // Stack: receiver, home_object, key.
2357 __ push(Immediate(Smi::FromInt(language_mode())));
2358 SetSourcePosition(prop->position()); 2356 SetSourcePosition(prop->position());
2359 2357
2360 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 4); 2358 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3);
2361 } 2359 }
2362 2360
2363 2361
2364 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, 2362 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
2365 Token::Value op, 2363 Token::Value op,
2366 Expression* left, 2364 Expression* left,
2367 Expression* right) { 2365 Expression* right) {
2368 // Do combined smi check of the operands. Left operand is on the 2366 // Do combined smi check of the operands. Left operand is on the
2369 // stack. Right operand is in eax. 2367 // stack. Right operand is in eax.
2370 Label smi_case, done, stub_call; 2368 Label smi_case, done, stub_call;
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
2880 Literal* key = prop->key()->AsLiteral(); 2878 Literal* key = prop->key()->AsLiteral();
2881 DCHECK(!key->value()->IsSmi()); 2879 DCHECK(!key->value()->IsSmi());
2882 // Load the function from the receiver. 2880 // Load the function from the receiver.
2883 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); 2881 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference();
2884 VisitForStackValue(super_ref->home_object()); 2882 VisitForStackValue(super_ref->home_object());
2885 VisitForAccumulatorValue(super_ref->this_var()); 2883 VisitForAccumulatorValue(super_ref->this_var());
2886 __ push(eax); 2884 __ push(eax);
2887 __ push(eax); 2885 __ push(eax);
2888 __ push(Operand(esp, kPointerSize * 2)); 2886 __ push(Operand(esp, kPointerSize * 2));
2889 __ push(Immediate(key->value())); 2887 __ push(Immediate(key->value()));
2890 __ push(Immediate(Smi::FromInt(language_mode())));
2891 // Stack here: 2888 // Stack here:
2892 // - home_object 2889 // - home_object
2893 // - this (receiver) 2890 // - this (receiver)
2894 // - this (receiver) <-- LoadFromSuper will pop here and below. 2891 // - this (receiver) <-- LoadFromSuper will pop here and below.
2895 // - home_object 2892 // - home_object
2896 // - key 2893 // - key
2897 // - language_mode 2894 __ CallRuntime(Runtime::kLoadFromSuper, 3);
2898 __ CallRuntime(Runtime::kLoadFromSuper, 4);
2899 2895
2900 // Replace home_object with target function. 2896 // Replace home_object with target function.
2901 __ mov(Operand(esp, kPointerSize), eax); 2897 __ mov(Operand(esp, kPointerSize), eax);
2902 2898
2903 // Stack here: 2899 // Stack here:
2904 // - target function 2900 // - target function
2905 // - this (receiver) 2901 // - this (receiver)
2906 EmitCall(expr, CallICState::METHOD); 2902 EmitCall(expr, CallICState::METHOD);
2907 } 2903 }
2908 2904
(...skipping 29 matching lines...) Expand all
2938 2934
2939 SetSourcePosition(prop->position()); 2935 SetSourcePosition(prop->position());
2940 // Load the function from the receiver. 2936 // Load the function from the receiver.
2941 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); 2937 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference();
2942 VisitForStackValue(super_ref->home_object()); 2938 VisitForStackValue(super_ref->home_object());
2943 VisitForAccumulatorValue(super_ref->this_var()); 2939 VisitForAccumulatorValue(super_ref->this_var());
2944 __ push(eax); 2940 __ push(eax);
2945 __ push(eax); 2941 __ push(eax);
2946 __ push(Operand(esp, kPointerSize * 2)); 2942 __ push(Operand(esp, kPointerSize * 2));
2947 VisitForStackValue(prop->key()); 2943 VisitForStackValue(prop->key());
2948 __ push(Immediate(Smi::FromInt(language_mode())));
2949 // Stack here: 2944 // Stack here:
2950 // - home_object 2945 // - home_object
2951 // - this (receiver) 2946 // - this (receiver)
2952 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. 2947 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below.
2953 // - home_object 2948 // - home_object
2954 // - key 2949 // - key
2955 // - language_mode 2950 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3);
2956 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 4);
2957 2951
2958 // Replace home_object with target function. 2952 // Replace home_object with target function.
2959 __ mov(Operand(esp, kPointerSize), eax); 2953 __ mov(Operand(esp, kPointerSize), eax);
2960 2954
2961 // Stack here: 2955 // Stack here:
2962 // - target function 2956 // - target function
2963 // - this (receiver) 2957 // - this (receiver)
2964 EmitCall(expr, CallICState::METHOD); 2958 EmitCall(expr, CallICState::METHOD);
2965 } 2959 }
2966 2960
(...skipping 2511 matching lines...) Expand 10 before | Expand all | Expand 10 after
5478 Assembler::target_address_at(call_target_address, 5472 Assembler::target_address_at(call_target_address,
5479 unoptimized_code)); 5473 unoptimized_code));
5480 return OSR_AFTER_STACK_CHECK; 5474 return OSR_AFTER_STACK_CHECK;
5481 } 5475 }
5482 5476
5483 5477
5484 } // namespace internal 5478 } // namespace internal
5485 } // namespace v8 5479 } // namespace v8
5486 5480
5487 #endif // V8_TARGET_ARCH_X87 5481 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/x87/code-stubs-x87.cc ('k') | src/x87/lithium-codegen-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698