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

Side by Side Diff: src/ic.cc

Issue 442763002: Load constants from the DescriptorArray (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Also removed from arm64 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/lookup.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 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 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after
1057 return isolate()->builtins()->LoadIC_Normal(); 1057 return isolate()->builtins()->LoadIC_Normal();
1058 } 1058 }
1059 1059
1060 // -------------- Fields -------------- 1060 // -------------- Fields --------------
1061 DCHECK(lookup->property_encoding() == LookupIterator::DESCRIPTOR); 1061 DCHECK(lookup->property_encoding() == LookupIterator::DESCRIPTOR);
1062 if (lookup->property_details().type() == FIELD) { 1062 if (lookup->property_details().type() == FIELD) {
1063 FieldIndex field = lookup->GetFieldIndex(); 1063 FieldIndex field = lookup->GetFieldIndex();
1064 if (receiver_is_holder) { 1064 if (receiver_is_holder) {
1065 return SimpleFieldLoad(field); 1065 return SimpleFieldLoad(field);
1066 } 1066 }
1067 return compiler.CompileLoadField(name, field, lookup->representation()); 1067 return compiler.CompileLoadField(name, field);
1068 } 1068 }
1069 1069
1070 // -------------- Constant properties -------------- 1070 // -------------- Constant properties --------------
1071 DCHECK(lookup->property_details().type() == CONSTANT); 1071 DCHECK(lookup->property_details().type() == CONSTANT);
1072 Handle<Object> constant = lookup->GetDataValue(); 1072 if (receiver_is_holder) {
1073 return compiler.CompileLoadConstant(name, constant); 1073 LoadConstantStub stub(isolate(), lookup->GetConstantIndex());
1074 return stub.GetCode();
1075 }
1076 return compiler.CompileLoadConstant(name, lookup->GetConstantIndex());
1074 } 1077 }
1075 1078
1076 1079
1077 static Handle<Object> TryConvertKey(Handle<Object> key, Isolate* isolate) { 1080 static Handle<Object> TryConvertKey(Handle<Object> key, Isolate* isolate) {
1078 // This helper implements a few common fast cases for converting 1081 // This helper implements a few common fast cases for converting
1079 // non-smi keys of keyed loads/stores to a smi or a string. 1082 // non-smi keys of keyed loads/stores to a smi or a string.
1080 if (key->IsHeapNumber()) { 1083 if (key->IsHeapNumber()) {
1081 double value = Handle<HeapNumber>::cast(key)->value(); 1084 double value = Handle<HeapNumber>::cast(key)->value();
1082 if (std::isnan(value)) { 1085 if (std::isnan(value)) {
1083 key = isolate->factory()->nan_string(); 1086 key = isolate->factory()->nan_string();
(...skipping 1980 matching lines...) Expand 10 before | Expand all | Expand 10 after
3064 #undef ADDR 3067 #undef ADDR
3065 }; 3068 };
3066 3069
3067 3070
3068 Address IC::AddressFromUtilityId(IC::UtilityId id) { 3071 Address IC::AddressFromUtilityId(IC::UtilityId id) {
3069 return IC_utilities[id]; 3072 return IC_utilities[id];
3070 } 3073 }
3071 3074
3072 3075
3073 } } // namespace v8::internal 3076 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | src/lookup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698