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

Side by Side Diff: src/bootstrapper.cc

Issue 329463005: Revert 21720: "Introduce FieldIndex to unify and abstract property/field offset" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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().property_index() == 1148 ASSERT(lookup.GetFieldIndex().field_index() == Heap::kArgumentsCalleeIndex);
1149 Heap::kArgumentsCalleeIndex);
1150 1149
1151 result->LookupOwn(factory->length_string(), &lookup); 1150 result->LookupOwn(factory->length_string(), &lookup);
1152 ASSERT(lookup.IsField()); 1151 ASSERT(lookup.IsField());
1153 ASSERT(lookup.GetFieldIndex().property_index() == 1152 ASSERT(lookup.GetFieldIndex().field_index() == Heap::kArgumentsLengthIndex);
1154 Heap::kArgumentsLengthIndex);
1155 1153
1156 ASSERT(result->map()->inobject_properties() > Heap::kArgumentsCalleeIndex); 1154 ASSERT(result->map()->inobject_properties() > Heap::kArgumentsCalleeIndex);
1157 ASSERT(result->map()->inobject_properties() > Heap::kArgumentsLengthIndex); 1155 ASSERT(result->map()->inobject_properties() > Heap::kArgumentsLengthIndex);
1158 1156
1159 // Check the state of the object. 1157 // Check the state of the object.
1160 ASSERT(result->HasFastProperties()); 1158 ASSERT(result->HasFastProperties());
1161 ASSERT(result->HasFastObjectElements()); 1159 ASSERT(result->HasFastObjectElements());
1162 #endif 1160 #endif
1163 } 1161 }
1164 1162
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
1240 1238
1241 // Add length property only for strict mode boilerplate. 1239 // Add length property only for strict mode boilerplate.
1242 JSObject::SetOwnPropertyIgnoreAttributes( 1240 JSObject::SetOwnPropertyIgnoreAttributes(
1243 result, factory->length_string(), 1241 result, factory->length_string(),
1244 factory->undefined_value(), DONT_ENUM).Check(); 1242 factory->undefined_value(), DONT_ENUM).Check();
1245 1243
1246 #ifdef DEBUG 1244 #ifdef DEBUG
1247 LookupResult lookup(isolate); 1245 LookupResult lookup(isolate);
1248 result->LookupOwn(factory->length_string(), &lookup); 1246 result->LookupOwn(factory->length_string(), &lookup);
1249 ASSERT(lookup.IsField()); 1247 ASSERT(lookup.IsField());
1250 ASSERT(lookup.GetFieldIndex().property_index() == 1248 ASSERT(lookup.GetFieldIndex().field_index() == Heap::kArgumentsLengthIndex);
1251 Heap::kArgumentsLengthIndex);
1252 1249
1253 ASSERT(result->map()->inobject_properties() > Heap::kArgumentsLengthIndex); 1250 ASSERT(result->map()->inobject_properties() > Heap::kArgumentsLengthIndex);
1254 1251
1255 // Check the state of the object. 1252 // Check the state of the object.
1256 ASSERT(result->HasFastProperties()); 1253 ASSERT(result->HasFastProperties());
1257 ASSERT(result->HasFastObjectElements()); 1254 ASSERT(result->HasFastObjectElements());
1258 #endif 1255 #endif
1259 } 1256 }
1260 1257
1261 { // --- context extension 1258 { // --- context extension
(...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after
2413 Handle<JSObject> to) { 2410 Handle<JSObject> to) {
2414 if (from->HasFastProperties()) { 2411 if (from->HasFastProperties()) {
2415 Handle<DescriptorArray> descs = 2412 Handle<DescriptorArray> descs =
2416 Handle<DescriptorArray>(from->map()->instance_descriptors()); 2413 Handle<DescriptorArray>(from->map()->instance_descriptors());
2417 for (int i = 0; i < from->map()->NumberOfOwnDescriptors(); i++) { 2414 for (int i = 0; i < from->map()->NumberOfOwnDescriptors(); i++) {
2418 PropertyDetails details = descs->GetDetails(i); 2415 PropertyDetails details = descs->GetDetails(i);
2419 switch (details.type()) { 2416 switch (details.type()) {
2420 case FIELD: { 2417 case FIELD: {
2421 HandleScope inner(isolate()); 2418 HandleScope inner(isolate());
2422 Handle<Name> key = Handle<Name>(descs->GetKey(i)); 2419 Handle<Name> key = Handle<Name>(descs->GetKey(i));
2423 FieldIndex index = FieldIndex::ForDescriptor(from->map(), i); 2420 int index = descs->GetFieldIndex(i);
2424 ASSERT(!descs->GetDetails(i).representation().IsDouble()); 2421 ASSERT(!descs->GetDetails(i).representation().IsDouble());
2425 Handle<Object> value = Handle<Object>(from->RawFastPropertyAt(index), 2422 Handle<Object> value = Handle<Object>(from->RawFastPropertyAt(index),
2426 isolate()); 2423 isolate());
2427 JSObject::SetOwnPropertyIgnoreAttributes( 2424 JSObject::SetOwnPropertyIgnoreAttributes(
2428 to, key, value, details.attributes()).Check(); 2425 to, key, value, details.attributes()).Check();
2429 break; 2426 break;
2430 } 2427 }
2431 case CONSTANT: { 2428 case CONSTANT: {
2432 HandleScope inner(isolate()); 2429 HandleScope inner(isolate());
2433 Handle<Name> key = Handle<Name>(descs->GetKey(i)); 2430 Handle<Name> key = Handle<Name>(descs->GetKey(i));
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
2713 return from + sizeof(NestingCounterType); 2710 return from + sizeof(NestingCounterType);
2714 } 2711 }
2715 2712
2716 2713
2717 // Called when the top-level V8 mutex is destroyed. 2714 // Called when the top-level V8 mutex is destroyed.
2718 void Bootstrapper::FreeThreadResources() { 2715 void Bootstrapper::FreeThreadResources() {
2719 ASSERT(!IsActive()); 2716 ASSERT(!IsActive());
2720 } 2717 }
2721 2718
2722 } } // namespace v8::internal 2719 } } // 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