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

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

Issue 6576024: (early draft) Strict mode - throw exception on assignment to read only property. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Assign to read only property in strict mode. Created 9 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/arm/virtual-frame-arm.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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 2653 matching lines...) Expand 10 before | Expand all | Expand 10 after
2664 if (receiver->IsJSGlobalProxy()) { 2664 if (receiver->IsJSGlobalProxy()) {
2665 __ CheckAccessGlobalProxy(r1, r3, &miss); 2665 __ CheckAccessGlobalProxy(r1, r3, &miss);
2666 } 2666 }
2667 2667
2668 // Stub is never generated for non-global objects that require access 2668 // Stub is never generated for non-global objects that require access
2669 // checks. 2669 // checks.
2670 ASSERT(receiver->IsJSGlobalProxy() || !receiver->IsAccessCheckNeeded()); 2670 ASSERT(receiver->IsJSGlobalProxy() || !receiver->IsAccessCheckNeeded());
2671 2671
2672 __ Push(r1, r2, r0); // Receiver, name, value. 2672 __ Push(r1, r2, r0); // Receiver, name, value.
2673 2673
2674 __ mov(r0, Operand(Smi::FromInt(strict_mode_)));
2675 __ push(r0); // strict mode
2676
2674 // Do tail-call to the runtime system. 2677 // Do tail-call to the runtime system.
2675 ExternalReference store_ic_property = 2678 ExternalReference store_ic_property =
2676 ExternalReference(IC_Utility(IC::kStoreInterceptorProperty)); 2679 ExternalReference(IC_Utility(IC::kStoreInterceptorProperty));
2677 __ TailCallExternalReference(store_ic_property, 3, 1); 2680 __ TailCallExternalReference(store_ic_property, 4, 1);
2678 2681
2679 // Handle store cache miss. 2682 // Handle store cache miss.
2680 __ bind(&miss); 2683 __ bind(&miss);
2681 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); 2684 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
2682 __ Jump(ic, RelocInfo::CODE_TARGET); 2685 __ Jump(ic, RelocInfo::CODE_TARGET);
2683 2686
2684 // Return the generated code. 2687 // Return the generated code.
2685 return GetCode(INTERCEPTOR, name); 2688 return GetCode(INTERCEPTOR, name);
2686 } 2689 }
2687 2690
(...skipping 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after
4049 // ---------- S t a t e -------------- 4052 // ---------- S t a t e --------------
4050 // -- r0 : value 4053 // -- r0 : value
4051 // -- r1 : key 4054 // -- r1 : key
4052 // -- r2 : receiver 4055 // -- r2 : receiver
4053 // -- lr : return address 4056 // -- lr : return address
4054 // ----------------------------------- 4057 // -----------------------------------
4055 4058
4056 // Push receiver, key and value for runtime call. 4059 // Push receiver, key and value for runtime call.
4057 __ Push(r2, r1, r0); 4060 __ Push(r2, r1, r0);
4058 4061
4059 __ TailCallRuntime(Runtime::kSetProperty, 3, 1); 4062 __ mov(r1, Operand(Smi::FromInt(NONE))); // PropertyAttributes
4063 __ mov(r0, Operand(Smi::FromInt(
4064 Code::ExtractExtraICStateFromFlags(flags) == kStrictMode
4065 ? kStrictMode
4066 : kNonStrictMode)));
4067 __ Push(r1, r0);
4068
4069 __ TailCallRuntime(Runtime::kSetProperty, 5, 1);
4060 4070
4061 return GetCode(flags); 4071 return GetCode(flags);
4062 } 4072 }
4063 4073
4064 4074
4065 #undef __ 4075 #undef __
4066 4076
4067 } } // namespace v8::internal 4077 } } // namespace v8::internal
4068 4078
4069 #endif // V8_TARGET_ARCH_ARM 4079 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/arm/virtual-frame-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698