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

Side by Side Diff: src/factory.cc

Issue 1302173007: [es6] Introduce a dedicated JSIteratorResult type. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
« no previous file with comments | « src/factory.h ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/factory.h" 5 #include "src/factory.h"
6 6
7 #include "src/allocation-site-scopes.h" 7 #include "src/allocation-site-scopes.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/conversions.h" 10 #include "src/conversions.h"
(...skipping 1662 matching lines...) Expand 10 before | Expand all | Expand 10 after
1673 1673
1674 1674
1675 Handle<JSSetIterator> Factory::NewJSSetIterator() { 1675 Handle<JSSetIterator> Factory::NewJSSetIterator() {
1676 Handle<Map> map(isolate()->native_context()->set_iterator_map()); 1676 Handle<Map> map(isolate()->native_context()->set_iterator_map());
1677 CALL_HEAP_FUNCTION(isolate(), 1677 CALL_HEAP_FUNCTION(isolate(),
1678 isolate()->heap()->AllocateJSObjectFromMap(*map), 1678 isolate()->heap()->AllocateJSObjectFromMap(*map),
1679 JSSetIterator); 1679 JSSetIterator);
1680 } 1680 }
1681 1681
1682 1682
1683 Handle<JSIteratorResult> Factory::NewJSIteratorResult(Handle<Object> value,
1684 Handle<Object> done) {
1685 Handle<JSIteratorResult> result = Handle<JSIteratorResult>::cast(
1686 NewJSObjectFromMap(isolate()->iterator_result_map()));
1687 result->set_value(*value);
1688 result->set_done(*done);
1689 return result;
1690 }
1691
1692
1683 namespace { 1693 namespace {
1684 1694
1685 ElementsKind GetExternalArrayElementsKind(ExternalArrayType type) { 1695 ElementsKind GetExternalArrayElementsKind(ExternalArrayType type) {
1686 switch (type) { 1696 switch (type) {
1687 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ 1697 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \
1688 case kExternal##Type##Array: \ 1698 case kExternal##Type##Array: \
1689 return TYPE##_ELEMENTS; 1699 return TYPE##_ELEMENTS;
1690 TYPED_ARRAYS(TYPED_ARRAY_CASE) 1700 TYPED_ARRAYS(TYPED_ARRAY_CASE)
1691 } 1701 }
1692 UNREACHABLE(); 1702 UNREACHABLE();
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
2349 } 2359 }
2350 2360
2351 2361
2352 Handle<Object> Factory::ToBoolean(bool value) { 2362 Handle<Object> Factory::ToBoolean(bool value) {
2353 return value ? true_value() : false_value(); 2363 return value ? true_value() : false_value();
2354 } 2364 }
2355 2365
2356 2366
2357 } // namespace internal 2367 } // namespace internal
2358 } // namespace v8 2368 } // namespace v8
OLDNEW
« no previous file with comments | « src/factory.h ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698