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

Side by Side Diff: src/bootstrapper.cc

Issue 300283002: Introduce FieldIndex to unify and abstract property/field offset (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix mutable boxed double runtime function Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/arm64/stub-cache-arm64.cc ('k') | src/code-stubs.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/bootstrapper.h" 5 #include "src/bootstrapper.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/isolate-inl.h" 8 #include "src/isolate-inl.h"
9 #include "src/natives.h" 9 #include "src/natives.h"
10 #include "src/snapshot.h" 10 #include "src/snapshot.h"
(...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after
1138 Object::FORCE_TAGGED, FORCE_FIELD).Check(); 1138 Object::FORCE_TAGGED, FORCE_FIELD).Check();
1139 JSObject::SetOwnPropertyIgnoreAttributes( 1139 JSObject::SetOwnPropertyIgnoreAttributes(
1140 result, factory->callee_string(), 1140 result, factory->callee_string(),
1141 factory->undefined_value(), DONT_ENUM, 1141 factory->undefined_value(), DONT_ENUM,
1142 Object::FORCE_TAGGED, FORCE_FIELD).Check(); 1142 Object::FORCE_TAGGED, FORCE_FIELD).Check();
1143 1143
1144 #ifdef DEBUG 1144 #ifdef DEBUG
1145 LookupResult lookup(isolate); 1145 LookupResult lookup(isolate);
1146 result->LookupOwn(factory->callee_string(), &lookup); 1146 result->LookupOwn(factory->callee_string(), &lookup);
1147 ASSERT(lookup.IsField()); 1147 ASSERT(lookup.IsField());
1148 ASSERT(lookup.GetFieldIndex().field_index() == Heap::kArgumentsCalleeIndex); 1148 ASSERT(lookup.GetFieldIndex().property_index() ==
1149 Heap::kArgumentsCalleeIndex);
1149 1150
1150 result->LookupOwn(factory->length_string(), &lookup); 1151 result->LookupOwn(factory->length_string(), &lookup);
1151 ASSERT(lookup.IsField()); 1152 ASSERT(lookup.IsField());
1152 ASSERT(lookup.GetFieldIndex().field_index() == Heap::kArgumentsLengthIndex); 1153 ASSERT(lookup.GetFieldIndex().property_index() ==
1154 Heap::kArgumentsLengthIndex);
1153 1155
1154 ASSERT(result->map()->inobject_properties() > Heap::kArgumentsCalleeIndex); 1156 ASSERT(result->map()->inobject_properties() > Heap::kArgumentsCalleeIndex);
1155 ASSERT(result->map()->inobject_properties() > Heap::kArgumentsLengthIndex); 1157 ASSERT(result->map()->inobject_properties() > Heap::kArgumentsLengthIndex);
1156 1158
1157 // Check the state of the object. 1159 // Check the state of the object.
1158 ASSERT(result->HasFastProperties()); 1160 ASSERT(result->HasFastProperties());
1159 ASSERT(result->HasFastObjectElements()); 1161 ASSERT(result->HasFastObjectElements());
1160 #endif 1162 #endif
1161 } 1163 }
1162 1164
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
1238 1240
1239 // Add length property only for strict mode boilerplate. 1241 // Add length property only for strict mode boilerplate.
1240 JSObject::SetOwnPropertyIgnoreAttributes( 1242 JSObject::SetOwnPropertyIgnoreAttributes(
1241 result, factory->length_string(), 1243 result, factory->length_string(),
1242 factory->undefined_value(), DONT_ENUM).Check(); 1244 factory->undefined_value(), DONT_ENUM).Check();
1243 1245
1244 #ifdef DEBUG 1246 #ifdef DEBUG
1245 LookupResult lookup(isolate); 1247 LookupResult lookup(isolate);
1246 result->LookupOwn(factory->length_string(), &lookup); 1248 result->LookupOwn(factory->length_string(), &lookup);
1247 ASSERT(lookup.IsField()); 1249 ASSERT(lookup.IsField());
1248 ASSERT(lookup.GetFieldIndex().field_index() == Heap::kArgumentsLengthIndex); 1250 ASSERT(lookup.GetFieldIndex().property_index() ==
1251 Heap::kArgumentsLengthIndex);
1249 1252
1250 ASSERT(result->map()->inobject_properties() > Heap::kArgumentsLengthIndex); 1253 ASSERT(result->map()->inobject_properties() > Heap::kArgumentsLengthIndex);
1251 1254
1252 // Check the state of the object. 1255 // Check the state of the object.
1253 ASSERT(result->HasFastProperties()); 1256 ASSERT(result->HasFastProperties());
1254 ASSERT(result->HasFastObjectElements()); 1257 ASSERT(result->HasFastObjectElements());
1255 #endif 1258 #endif
1256 } 1259 }
1257 1260
1258 { // --- context extension 1261 { // --- context extension
(...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after
2410 Handle<JSObject> to) { 2413 Handle<JSObject> to) {
2411 if (from->HasFastProperties()) { 2414 if (from->HasFastProperties()) {
2412 Handle<DescriptorArray> descs = 2415 Handle<DescriptorArray> descs =
2413 Handle<DescriptorArray>(from->map()->instance_descriptors()); 2416 Handle<DescriptorArray>(from->map()->instance_descriptors());
2414 for (int i = 0; i < from->map()->NumberOfOwnDescriptors(); i++) { 2417 for (int i = 0; i < from->map()->NumberOfOwnDescriptors(); i++) {
2415 PropertyDetails details = descs->GetDetails(i); 2418 PropertyDetails details = descs->GetDetails(i);
2416 switch (details.type()) { 2419 switch (details.type()) {
2417 case FIELD: { 2420 case FIELD: {
2418 HandleScope inner(isolate()); 2421 HandleScope inner(isolate());
2419 Handle<Name> key = Handle<Name>(descs->GetKey(i)); 2422 Handle<Name> key = Handle<Name>(descs->GetKey(i));
2420 int index = descs->GetFieldIndex(i); 2423 FieldIndex index = FieldIndex::ForDescriptor(from->map(), i);
2421 ASSERT(!descs->GetDetails(i).representation().IsDouble()); 2424 ASSERT(!descs->GetDetails(i).representation().IsDouble());
2422 Handle<Object> value = Handle<Object>(from->RawFastPropertyAt(index), 2425 Handle<Object> value = Handle<Object>(from->RawFastPropertyAt(index),
2423 isolate()); 2426 isolate());
2424 JSObject::SetOwnPropertyIgnoreAttributes( 2427 JSObject::SetOwnPropertyIgnoreAttributes(
2425 to, key, value, details.attributes()).Check(); 2428 to, key, value, details.attributes()).Check();
2426 break; 2429 break;
2427 } 2430 }
2428 case CONSTANT: { 2431 case CONSTANT: {
2429 HandleScope inner(isolate()); 2432 HandleScope inner(isolate());
2430 Handle<Name> key = Handle<Name>(descs->GetKey(i)); 2433 Handle<Name> key = Handle<Name>(descs->GetKey(i));
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
2710 return from + sizeof(NestingCounterType); 2713 return from + sizeof(NestingCounterType);
2711 } 2714 }
2712 2715
2713 2716
2714 // Called when the top-level V8 mutex is destroyed. 2717 // Called when the top-level V8 mutex is destroyed.
2715 void Bootstrapper::FreeThreadResources() { 2718 void Bootstrapper::FreeThreadResources() {
2716 ASSERT(!IsActive()); 2719 ASSERT(!IsActive());
2717 } 2720 }
2718 2721
2719 } } // namespace v8::internal 2722 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm64/stub-cache-arm64.cc ('k') | src/code-stubs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698