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

Side by Side Diff: src/runtime.cc

Issue 151146: Treat the builtins object like other global objects (with... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 5 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/property.h ('k') | src/stub-cache.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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 2591 matching lines...) Expand 10 before | Expand all | Expand 10 after
2602 Object* value = receiver->FastPropertyAt(offset); 2602 Object* value = receiver->FastPropertyAt(offset);
2603 return value->IsTheHole() ? Heap::undefined_value() : value; 2603 return value->IsTheHole() ? Heap::undefined_value() : value;
2604 } 2604 }
2605 } else { 2605 } else {
2606 // Attempt dictionary lookup. 2606 // Attempt dictionary lookup.
2607 Dictionary* dictionary = receiver->property_dictionary(); 2607 Dictionary* dictionary = receiver->property_dictionary();
2608 int entry = dictionary->FindStringEntry(key); 2608 int entry = dictionary->FindStringEntry(key);
2609 if ((entry != Dictionary::kNotFound) && 2609 if ((entry != Dictionary::kNotFound) &&
2610 (dictionary->DetailsAt(entry).type() == NORMAL)) { 2610 (dictionary->DetailsAt(entry).type() == NORMAL)) {
2611 Object* value = dictionary->ValueAt(entry); 2611 Object* value = dictionary->ValueAt(entry);
2612 if (receiver->IsJSGlobalObject()) { 2612 if (receiver->IsGlobalObject()) {
2613 value = JSGlobalPropertyCell::cast(value)->value(); 2613 value = JSGlobalPropertyCell::cast(value)->value();
2614 } 2614 }
2615 return value; 2615 return value;
2616 } 2616 }
2617 } 2617 }
2618 } 2618 }
2619 2619
2620 // Fall back to GetObjectProperty. 2620 // Fall back to GetObjectProperty.
2621 return Runtime::GetObjectProperty(args.at<Object>(0), 2621 return Runtime::GetObjectProperty(args.at<Object>(0),
2622 args.at<Object>(1)); 2622 args.at<Object>(1));
(...skipping 4913 matching lines...) Expand 10 before | Expand all | Expand 10 after
7536 } else { 7536 } else {
7537 // Handle last resort GC and make sure to allow future allocations 7537 // Handle last resort GC and make sure to allow future allocations
7538 // to grow the heap without causing GCs (if possible). 7538 // to grow the heap without causing GCs (if possible).
7539 Counters::gc_last_resort_from_js.Increment(); 7539 Counters::gc_last_resort_from_js.Increment();
7540 Heap::CollectAllGarbage(); 7540 Heap::CollectAllGarbage();
7541 } 7541 }
7542 } 7542 }
7543 7543
7544 7544
7545 } } // namespace v8::internal 7545 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/property.h ('k') | src/stub-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698