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

Unified Diff: src/bootstrapper.cc

Issue 113068: The ARM assembler tests don't install the standard JS natives. When... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
===================================================================
--- src/bootstrapper.cc (revision 1886)
+++ src/bootstrapper.cc (working copy)
@@ -1483,14 +1483,19 @@
JSFunction::cast(global->GetProperty(Heap::Array_symbol())));
Handle<JSObject> visible_prototype =
Handle<JSObject>(JSObject::cast(function->prototype()));
- // Remember to skip the hidden prototype:
- Handle<JSObject> hidden_prototype =
- Handle<JSObject>(JSObject::cast(visible_prototype->GetPrototype()));
- AddSpecialFunction(hidden_prototype, "pop",
+ // Remember to put push and pop on the hidden prototype if it's there.
+ Handle<JSObject> push_and_pop_prototype;
+ Handle<Object> superproto(visible_prototype->GetPrototype());
+ if (superproto->IsJSObject() &&
+ JSObject::cast(*superproto)->map()->is_hidden_prototype()) {
+ push_and_pop_prototype = Handle<JSObject>::cast(superproto);
+ } else {
+ push_and_pop_prototype = visible_prototype;
+ }
+ AddSpecialFunction(push_and_pop_prototype, "pop",
Handle<Code>(Builtins::builtin(Builtins::ArrayPop)));
- AddSpecialFunction(hidden_prototype, "push",
+ AddSpecialFunction(push_and_pop_prototype, "push",
Handle<Code>(Builtins::builtin(Builtins::ArrayPush)));
- ASSERT(hidden_prototype->map()->is_hidden_prototype());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698