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

Side by Side Diff: src/ic/ic.cc

Issue 1220283009: Debugger: do not compile IC for accessors when debugging. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix crash Created 5 years, 5 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/debug.cc ('k') | no next file » | 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 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/arguments.h" 9 #include "src/arguments.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after
1203 } 1203 }
1204 if (!holder->HasFastProperties()) break; 1204 if (!holder->HasFastProperties()) break;
1205 NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder); 1205 NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder);
1206 return compiler.CompileLoadCallback(lookup->name(), info); 1206 return compiler.CompileLoadCallback(lookup->name(), info);
1207 } 1207 }
1208 if (accessors->IsAccessorPair()) { 1208 if (accessors->IsAccessorPair()) {
1209 Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(), 1209 Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(),
1210 isolate()); 1210 isolate());
1211 if (!getter->IsJSFunction()) break; 1211 if (!getter->IsJSFunction()) break;
1212 if (!holder->HasFastProperties()) break; 1212 if (!holder->HasFastProperties()) break;
1213 // When debugging we need to go the slow path to flood the accessor.
1214 if (!GetSharedFunctionInfo()->debug_info()->IsUndefined()) break;
1213 Handle<JSFunction> function = Handle<JSFunction>::cast(getter); 1215 Handle<JSFunction> function = Handle<JSFunction>::cast(getter);
1214 if (!receiver->IsJSObject() && !function->IsBuiltin() && 1216 if (!receiver->IsJSObject() && !function->IsBuiltin() &&
1215 is_sloppy(function->shared()->language_mode())) { 1217 is_sloppy(function->shared()->language_mode())) {
1216 // Calling sloppy non-builtins with a value as the receiver 1218 // Calling sloppy non-builtins with a value as the receiver
1217 // requires boxing. 1219 // requires boxing.
1218 break; 1220 break;
1219 } 1221 }
1220 CallOptimization call_optimization(function); 1222 CallOptimization call_optimization(function);
1221 NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder); 1223 NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder);
1222 if (call_optimization.is_simple_api_call()) { 1224 if (call_optimization.is_simple_api_call()) {
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
1779 } 1781 }
1780 NamedStoreHandlerCompiler compiler(isolate(), receiver_map(), holder); 1782 NamedStoreHandlerCompiler compiler(isolate(), receiver_map(), holder);
1781 return compiler.CompileStoreCallback(receiver, lookup->name(), info); 1783 return compiler.CompileStoreCallback(receiver, lookup->name(), info);
1782 } else if (accessors->IsAccessorPair()) { 1784 } else if (accessors->IsAccessorPair()) {
1783 Handle<Object> setter(Handle<AccessorPair>::cast(accessors)->setter(), 1785 Handle<Object> setter(Handle<AccessorPair>::cast(accessors)->setter(),
1784 isolate()); 1786 isolate());
1785 if (!setter->IsJSFunction()) { 1787 if (!setter->IsJSFunction()) {
1786 TRACE_GENERIC_IC(isolate(), "StoreIC", "setter not a function"); 1788 TRACE_GENERIC_IC(isolate(), "StoreIC", "setter not a function");
1787 break; 1789 break;
1788 } 1790 }
1791 // When debugging we need to go the slow path to flood the accessor.
1792 if (!GetSharedFunctionInfo()->debug_info()->IsUndefined()) break;
1789 Handle<JSFunction> function = Handle<JSFunction>::cast(setter); 1793 Handle<JSFunction> function = Handle<JSFunction>::cast(setter);
1790 CallOptimization call_optimization(function); 1794 CallOptimization call_optimization(function);
1791 NamedStoreHandlerCompiler compiler(isolate(), receiver_map(), holder); 1795 NamedStoreHandlerCompiler compiler(isolate(), receiver_map(), holder);
1792 if (call_optimization.is_simple_api_call() && 1796 if (call_optimization.is_simple_api_call() &&
1793 call_optimization.IsCompatibleReceiver(receiver, holder)) { 1797 call_optimization.IsCompatibleReceiver(receiver, holder)) {
1794 return compiler.CompileStoreCallback(receiver, lookup->name(), 1798 return compiler.CompileStoreCallback(receiver, lookup->name(),
1795 call_optimization, 1799 call_optimization,
1796 lookup->GetAccessorIndex()); 1800 lookup->GetAccessorIndex());
1797 } 1801 }
1798 int expected_arguments = 1802 int expected_arguments =
(...skipping 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after
3101 static const Address IC_utilities[] = { 3105 static const Address IC_utilities[] = {
3102 #define ADDR(name) FUNCTION_ADDR(name), 3106 #define ADDR(name) FUNCTION_ADDR(name),
3103 IC_UTIL_LIST(ADDR) NULL 3107 IC_UTIL_LIST(ADDR) NULL
3104 #undef ADDR 3108 #undef ADDR
3105 }; 3109 };
3106 3110
3107 3111
3108 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } 3112 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; }
3109 } // namespace internal 3113 } // namespace internal
3110 } // namespace v8 3114 } // namespace v8
OLDNEW
« no previous file with comments | « src/debug.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698