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

Side by Side Diff: src/bootstrapper.cc

Issue 14576005: Adapt hydrogen-based Array constructor to also support InternalArray and function call (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Refactoring and restored flag for now Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/builtins.cc » ('j') | src/builtins.cc » ('J')
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 // 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 1582 matching lines...) Expand 10 before | Expand all | Expand 10 after
1593 name, 1593 name,
1594 JS_ARRAY_TYPE, 1594 JS_ARRAY_TYPE,
1595 JSArray::kSize, 1595 JSArray::kSize,
1596 isolate()->initial_object_prototype(), 1596 isolate()->initial_object_prototype(),
1597 Builtins::kInternalArrayCode, 1597 Builtins::kInternalArrayCode,
1598 true, true); 1598 true, true);
1599 Handle<JSObject> prototype = 1599 Handle<JSObject> prototype =
1600 factory()->NewJSObject(isolate()->object_function(), TENURED); 1600 factory()->NewJSObject(isolate()->object_function(), TENURED);
1601 SetPrototype(array_function, prototype); 1601 SetPrototype(array_function, prototype);
1602 1602
1603 array_function->shared()->set_construct_stub( 1603 if (FLAG_optimize_constructed_arrays) {
1604 isolate()->builtins()->builtin(Builtins::kCommonArrayConstructCode)); 1604 InternalArrayConstructorStub internal_array_constructor_stub(isolate());
1605 Handle<Code> code = internal_array_constructor_stub.GetCode(isolate());
1606 array_function->shared()->set_construct_stub(*code);
1607 } else {
1608 array_function->shared()->set_construct_stub(
1609 isolate()->builtins()->builtin(Builtins::kCommonArrayConstructCode));
1610 }
1605 1611
1606 array_function->shared()->DontAdaptArguments(); 1612 array_function->shared()->DontAdaptArguments();
1607 1613
1608 MaybeObject* maybe_map = array_function->initial_map()->Copy(); 1614 MaybeObject* maybe_map = array_function->initial_map()->Copy();
1609 Map* new_map; 1615 Map* new_map;
1610 if (!maybe_map->To(&new_map)) return Handle<JSFunction>::null(); 1616 if (!maybe_map->To(&new_map)) return Handle<JSFunction>::null();
1611 new_map->set_elements_kind(elements_kind); 1617 new_map->set_elements_kind(elements_kind);
1612 array_function->set_initial_map(new_map); 1618 array_function->set_initial_map(new_map);
1613 1619
1614 // Make "length" magic on instances. 1620 // Make "length" magic on instances.
(...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after
2626 return from + sizeof(NestingCounterType); 2632 return from + sizeof(NestingCounterType);
2627 } 2633 }
2628 2634
2629 2635
2630 // Called when the top-level V8 mutex is destroyed. 2636 // Called when the top-level V8 mutex is destroyed.
2631 void Bootstrapper::FreeThreadResources() { 2637 void Bootstrapper::FreeThreadResources() {
2632 ASSERT(!IsActive()); 2638 ASSERT(!IsActive());
2633 } 2639 }
2634 2640
2635 } } // namespace v8::internal 2641 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/builtins.cc » ('j') | src/builtins.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698