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

Side by Side Diff: src/bootstrapper.cc

Issue 647015: Remove the LookupResult IsValid method because it is confusing.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 10 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/arm/stub-cache-arm.cc ('k') | src/fast-codegen.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 SetProperty(result, Factory::callee_symbol(), 716 SetProperty(result, Factory::callee_symbol(),
717 Factory::undefined_value(), 717 Factory::undefined_value(),
718 DONT_ENUM); 718 DONT_ENUM);
719 SetProperty(result, Factory::length_symbol(), 719 SetProperty(result, Factory::length_symbol(),
720 Factory::undefined_value(), 720 Factory::undefined_value(),
721 DONT_ENUM); 721 DONT_ENUM);
722 722
723 #ifdef DEBUG 723 #ifdef DEBUG
724 LookupResult lookup; 724 LookupResult lookup;
725 result->LocalLookup(Heap::callee_symbol(), &lookup); 725 result->LocalLookup(Heap::callee_symbol(), &lookup);
726 ASSERT(lookup.IsValid() && (lookup.type() == FIELD)); 726 ASSERT(lookup.IsProperty() && (lookup.type() == FIELD));
727 ASSERT(lookup.GetFieldIndex() == Heap::arguments_callee_index); 727 ASSERT(lookup.GetFieldIndex() == Heap::arguments_callee_index);
728 728
729 result->LocalLookup(Heap::length_symbol(), &lookup); 729 result->LocalLookup(Heap::length_symbol(), &lookup);
730 ASSERT(lookup.IsValid() && (lookup.type() == FIELD)); 730 ASSERT(lookup.IsProperty() && (lookup.type() == FIELD));
731 ASSERT(lookup.GetFieldIndex() == Heap::arguments_length_index); 731 ASSERT(lookup.GetFieldIndex() == Heap::arguments_length_index);
732 732
733 ASSERT(result->map()->inobject_properties() > Heap::arguments_callee_index); 733 ASSERT(result->map()->inobject_properties() > Heap::arguments_callee_index);
734 ASSERT(result->map()->inobject_properties() > Heap::arguments_length_index); 734 ASSERT(result->map()->inobject_properties() > Heap::arguments_length_index);
735 735
736 // Check the state of the object. 736 // Check the state of the object.
737 ASSERT(result->HasFastProperties()); 737 ASSERT(result->HasFastProperties());
738 ASSERT(result->HasFastElements()); 738 ASSERT(result->HasFastElements());
739 #endif 739 #endif
740 } 740 }
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
1345 Handle<String> key = Handle<String>(descs->GetKey(i)); 1345 Handle<String> key = Handle<String>(descs->GetKey(i));
1346 Handle<JSFunction> fun = 1346 Handle<JSFunction> fun =
1347 Handle<JSFunction>(descs->GetConstantFunction(i)); 1347 Handle<JSFunction>(descs->GetConstantFunction(i));
1348 SetProperty(to, key, fun, details.attributes()); 1348 SetProperty(to, key, fun, details.attributes());
1349 break; 1349 break;
1350 } 1350 }
1351 case CALLBACKS: { 1351 case CALLBACKS: {
1352 LookupResult result; 1352 LookupResult result;
1353 to->LocalLookup(descs->GetKey(i), &result); 1353 to->LocalLookup(descs->GetKey(i), &result);
1354 // If the property is already there we skip it 1354 // If the property is already there we skip it
1355 if (result.IsValid()) continue; 1355 if (result.IsProperty()) continue;
1356 HandleScope inner; 1356 HandleScope inner;
1357 Handle<DescriptorArray> inst_descs = 1357 Handle<DescriptorArray> inst_descs =
1358 Handle<DescriptorArray>(to->map()->instance_descriptors()); 1358 Handle<DescriptorArray>(to->map()->instance_descriptors());
1359 Handle<String> key = Handle<String>(descs->GetKey(i)); 1359 Handle<String> key = Handle<String>(descs->GetKey(i));
1360 Handle<Object> entry = Handle<Object>(descs->GetCallbacksObject(i)); 1360 Handle<Object> entry = Handle<Object>(descs->GetCallbacksObject(i));
1361 inst_descs = Factory::CopyAppendProxyDescriptor(inst_descs, 1361 inst_descs = Factory::CopyAppendProxyDescriptor(inst_descs,
1362 key, 1362 key,
1363 entry, 1363 entry,
1364 details.attributes()); 1364 details.attributes());
1365 to->map()->set_instance_descriptors(*inst_descs); 1365 to->map()->set_instance_descriptors(*inst_descs);
(...skipping 16 matching lines...) Expand all
1382 Handle<StringDictionary> properties = 1382 Handle<StringDictionary> properties =
1383 Handle<StringDictionary>(from->property_dictionary()); 1383 Handle<StringDictionary>(from->property_dictionary());
1384 int capacity = properties->Capacity(); 1384 int capacity = properties->Capacity();
1385 for (int i = 0; i < capacity; i++) { 1385 for (int i = 0; i < capacity; i++) {
1386 Object* raw_key(properties->KeyAt(i)); 1386 Object* raw_key(properties->KeyAt(i));
1387 if (properties->IsKey(raw_key)) { 1387 if (properties->IsKey(raw_key)) {
1388 ASSERT(raw_key->IsString()); 1388 ASSERT(raw_key->IsString());
1389 // If the property is already there we skip it. 1389 // If the property is already there we skip it.
1390 LookupResult result; 1390 LookupResult result;
1391 to->LocalLookup(String::cast(raw_key), &result); 1391 to->LocalLookup(String::cast(raw_key), &result);
1392 if (result.IsValid()) continue; 1392 if (result.IsProperty()) continue;
1393 // Set the property. 1393 // Set the property.
1394 Handle<String> key = Handle<String>(String::cast(raw_key)); 1394 Handle<String> key = Handle<String>(String::cast(raw_key));
1395 Handle<Object> value = Handle<Object>(properties->ValueAt(i)); 1395 Handle<Object> value = Handle<Object>(properties->ValueAt(i));
1396 if (value->IsJSGlobalPropertyCell()) { 1396 if (value->IsJSGlobalPropertyCell()) {
1397 value = Handle<Object>(JSGlobalPropertyCell::cast(*value)->value()); 1397 value = Handle<Object>(JSGlobalPropertyCell::cast(*value)->value());
1398 } 1398 }
1399 PropertyDetails details = properties->DetailsAt(i); 1399 PropertyDetails details = properties->DetailsAt(i);
1400 SetProperty(to, key, value, details.attributes()); 1400 SetProperty(to, key, value, details.attributes());
1401 } 1401 }
1402 } 1402 }
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
1578 } 1578 }
1579 1579
1580 1580
1581 // Restore statics that are thread local. 1581 // Restore statics that are thread local.
1582 char* Genesis::RestoreState(char* from) { 1582 char* Genesis::RestoreState(char* from) {
1583 current_ = *reinterpret_cast<Genesis**>(from); 1583 current_ = *reinterpret_cast<Genesis**>(from);
1584 return from + sizeof(current_); 1584 return from + sizeof(current_);
1585 } 1585 }
1586 1586
1587 } } // namespace v8::internal 1587 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/fast-codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698