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

Side by Side Diff: src/bootstrapper.cc

Issue 193125: Handle array construction on native code (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 3 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/builtins-arm.cc ('k') | src/builtins.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-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 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 647
648 // Install global Function object 648 // Install global Function object
649 InstallFunction(global, "Function", JS_FUNCTION_TYPE, JSFunction::kSize, 649 InstallFunction(global, "Function", JS_FUNCTION_TYPE, JSFunction::kSize,
650 empty_function, Builtins::Illegal, true); // ECMA native. 650 empty_function, Builtins::Illegal, true); // ECMA native.
651 651
652 { // --- A r r a y --- 652 { // --- A r r a y ---
653 Handle<JSFunction> array_function = 653 Handle<JSFunction> array_function =
654 InstallFunction(global, "Array", JS_ARRAY_TYPE, JSArray::kSize, 654 InstallFunction(global, "Array", JS_ARRAY_TYPE, JSArray::kSize,
655 Top::initial_object_prototype(), Builtins::ArrayCode, 655 Top::initial_object_prototype(), Builtins::ArrayCode,
656 true); 656 true);
657 array_function->shared()->set_construct_stub(
658 Builtins::builtin(Builtins::ArrayConstructCode));
657 array_function->shared()->DontAdaptArguments(); 659 array_function->shared()->DontAdaptArguments();
658 660
659 // This seems a bit hackish, but we need to make sure Array.length 661 // This seems a bit hackish, but we need to make sure Array.length
660 // is 1. 662 // is 1.
661 array_function->shared()->set_length(1); 663 array_function->shared()->set_length(1);
662 Handle<DescriptorArray> array_descriptors = 664 Handle<DescriptorArray> array_descriptors =
663 Factory::CopyAppendProxyDescriptor( 665 Factory::CopyAppendProxyDescriptor(
664 Factory::empty_descriptor_array(), 666 Factory::empty_descriptor_array(),
665 Factory::length_symbol(), 667 Factory::length_symbol(),
666 Factory::NewProxy(&Accessors::ArrayLength), 668 Factory::NewProxy(&Accessors::ArrayLength),
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
1598 } 1600 }
1599 1601
1600 1602
1601 // Restore statics that are thread local. 1603 // Restore statics that are thread local.
1602 char* Genesis::RestoreState(char* from) { 1604 char* Genesis::RestoreState(char* from) {
1603 current_ = *reinterpret_cast<Genesis**>(from); 1605 current_ = *reinterpret_cast<Genesis**>(from);
1604 return from + sizeof(current_); 1606 return from + sizeof(current_);
1605 } 1607 }
1606 1608
1607 } } // namespace v8::internal 1609 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/builtins-arm.cc ('k') | src/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698