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

Side by Side Diff: src/builtins.cc

Issue 371913002: Revert "Only create arguments-maps in the bootstrapper, remove now obsolete ValueType flag." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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/bootstrapper.cc ('k') | src/contexts.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/arguments.h" 8 #include "src/arguments.h"
9 #include "src/base/once.h" 9 #include "src/base/once.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 636
637 if (!array->HasFastElements()) { 637 if (!array->HasFastElements()) {
638 AllowHeapAllocation allow_allocation; 638 AllowHeapAllocation allow_allocation;
639 return CallJsBuiltin(isolate, "ArraySlice", args); 639 return CallJsBuiltin(isolate, "ArraySlice", args);
640 } 640 }
641 641
642 len = Smi::cast(array->length())->value(); 642 len = Smi::cast(array->length())->value();
643 } else { 643 } else {
644 // Array.slice(arguments, ...) is quite a common idiom (notably more 644 // Array.slice(arguments, ...) is quite a common idiom (notably more
645 // than 50% of invocations in Web apps). Treat it in C++ as well. 645 // than 50% of invocations in Web apps). Treat it in C++ as well.
646 Map* arguments_map = 646 Map* arguments_map = isolate->context()->native_context()->
647 isolate->context()->native_context()->sloppy_arguments_map(); 647 sloppy_arguments_boilerplate()->map();
648 648
649 bool is_arguments_object_with_fast_elements = 649 bool is_arguments_object_with_fast_elements =
650 receiver->IsJSObject() && 650 receiver->IsJSObject() &&
651 JSObject::cast(*receiver)->map() == arguments_map; 651 JSObject::cast(*receiver)->map() == arguments_map;
652 if (!is_arguments_object_with_fast_elements) { 652 if (!is_arguments_object_with_fast_elements) {
653 AllowHeapAllocation allow_allocation; 653 AllowHeapAllocation allow_allocation;
654 return CallJsBuiltin(isolate, "ArraySlice", args); 654 return CallJsBuiltin(isolate, "ArraySlice", args);
655 } 655 }
656 JSObject* object = JSObject::cast(*receiver); 656 JSObject* object = JSObject::cast(*receiver);
657 657
(...skipping 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after
1712 } 1712 }
1713 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) 1713 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C)
1714 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) 1714 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A)
1715 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) 1715 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H)
1716 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) 1716 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
1717 #undef DEFINE_BUILTIN_ACCESSOR_C 1717 #undef DEFINE_BUILTIN_ACCESSOR_C
1718 #undef DEFINE_BUILTIN_ACCESSOR_A 1718 #undef DEFINE_BUILTIN_ACCESSOR_A
1719 1719
1720 1720
1721 } } // namespace v8::internal 1721 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | src/contexts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698