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/ic.cc

Issue 443963002: Always use the StoreFieldStub to do the actual storing. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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/ia32/stub-cache-ia32.cc ('k') | src/isolate.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 #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/codegen.h" 10 #include "src/codegen.h"
(...skipping 1455 matching lines...) Expand 10 before | Expand all | Expand 10 after
1466 // stored something else than the receiver in the holder. 1466 // stored something else than the receiver in the holder.
1467 Handle<Map> transition(lookup->GetTransitionTarget()); 1467 Handle<Map> transition(lookup->GetTransitionTarget());
1468 PropertyDetails details = lookup->GetPropertyDetails(); 1468 PropertyDetails details = lookup->GetPropertyDetails();
1469 1469
1470 if (details.type() != CALLBACKS && details.attributes() == NONE && 1470 if (details.type() != CALLBACKS && details.attributes() == NONE &&
1471 holder->HasFastProperties()) { 1471 holder->HasFastProperties()) {
1472 return compiler.CompileStoreTransition(transition, name); 1472 return compiler.CompileStoreTransition(transition, name);
1473 } 1473 }
1474 } else { 1474 } else {
1475 switch (lookup->type()) { 1475 switch (lookup->type()) {
1476 case FIELD: 1476 case FIELD: {
1477 if (!lookup->representation().IsHeapObject()) { 1477 bool use_stub = true;
1478 if (lookup->representation().IsHeapObject()) {
1479 // Only use a generic stub if no types need to be tracked.
1480 HeapType* field_type = lookup->GetFieldType();
1481 HeapType::Iterator<Map> it = field_type->Classes();
1482 use_stub = it.Done();
1483 }
1484 if (use_stub) {
1478 StoreFieldStub stub(isolate(), lookup->GetFieldIndex(), 1485 StoreFieldStub stub(isolate(), lookup->GetFieldIndex(),
1479 lookup->representation()); 1486 lookup->representation());
1480 return stub.GetCode(); 1487 return stub.GetCode();
1481 } 1488 }
1482 return compiler.CompileStoreField(lookup, name); 1489 return compiler.CompileStoreField(lookup, name);
1490 }
1483 case NORMAL: 1491 case NORMAL:
1484 if (receiver->IsJSGlobalProxy() || receiver->IsGlobalObject()) { 1492 if (receiver->IsJSGlobalProxy() || receiver->IsGlobalObject()) {
1485 // The stub generated for the global object picks the value directly 1493 // The stub generated for the global object picks the value directly
1486 // from the property cell. So the property must be directly on the 1494 // from the property cell. So the property must be directly on the
1487 // global object. 1495 // global object.
1488 PrototypeIterator iter(isolate(), receiver); 1496 PrototypeIterator iter(isolate(), receiver);
1489 Handle<GlobalObject> global = 1497 Handle<GlobalObject> global =
1490 receiver->IsJSGlobalProxy() 1498 receiver->IsJSGlobalProxy()
1491 ? Handle<GlobalObject>::cast( 1499 ? Handle<GlobalObject>::cast(
1492 PrototypeIterator::GetCurrent(iter)) 1500 PrototypeIterator::GetCurrent(iter))
(...skipping 1604 matching lines...) Expand 10 before | Expand all | Expand 10 after
3097 #undef ADDR 3105 #undef ADDR
3098 }; 3106 };
3099 3107
3100 3108
3101 Address IC::AddressFromUtilityId(IC::UtilityId id) { 3109 Address IC::AddressFromUtilityId(IC::UtilityId id) {
3102 return IC_utilities[id]; 3110 return IC_utilities[id];
3103 } 3111 }
3104 3112
3105 3113
3106 } } // namespace v8::internal 3114 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698