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

Side by Side Diff: src/factory.cc

Issue 2581683003: Introduce {ConstantElementsPair} struct for type safety. (Closed)
Patch Set: Re-cemment bytecode tests. Created 4 years 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
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/accessors.h" 7 #include "src/accessors.h"
8 #include "src/allocation-site-scopes.h" 8 #include "src/allocation-site-scopes.h"
9 #include "src/ast/ast.h" 9 #include "src/ast/ast.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 122
123 Handle<ContextExtension> Factory::NewContextExtension( 123 Handle<ContextExtension> Factory::NewContextExtension(
124 Handle<ScopeInfo> scope_info, Handle<Object> extension) { 124 Handle<ScopeInfo> scope_info, Handle<Object> extension) {
125 Handle<ContextExtension> result = 125 Handle<ContextExtension> result =
126 Handle<ContextExtension>::cast(NewStruct(CONTEXT_EXTENSION_TYPE)); 126 Handle<ContextExtension>::cast(NewStruct(CONTEXT_EXTENSION_TYPE));
127 result->set_scope_info(*scope_info); 127 result->set_scope_info(*scope_info);
128 result->set_extension(*extension); 128 result->set_extension(*extension);
129 return result; 129 return result;
130 } 130 }
131 131
132 Handle<ConstantElementsPair> Factory::NewConstantElementsPair(
133 ElementsKind elements_kind, Handle<FixedArrayBase> constant_values) {
134 Handle<ConstantElementsPair> result = Handle<ConstantElementsPair>::cast(
135 NewStruct(CONSTANT_ELEMENTS_PAIR_TYPE));
136 result->set_elements_kind(elements_kind);
137 result->set_constant_values(*constant_values);
138 return result;
139 }
140
132 Handle<Oddball> Factory::NewOddball(Handle<Map> map, const char* to_string, 141 Handle<Oddball> Factory::NewOddball(Handle<Map> map, const char* to_string,
133 Handle<Object> to_number, 142 Handle<Object> to_number,
134 const char* type_of, byte kind) { 143 const char* type_of, byte kind) {
135 Handle<Oddball> oddball = New<Oddball>(map, OLD_SPACE); 144 Handle<Oddball> oddball = New<Oddball>(map, OLD_SPACE);
136 Oddball::Initialize(isolate(), oddball, to_string, to_number, type_of, kind); 145 Oddball::Initialize(isolate(), oddball, to_string, to_number, type_of, kind);
137 return oddball; 146 return oddball;
138 } 147 }
139 148
140 149
141 Handle<FixedArray> Factory::NewFixedArray(int size, PretenureFlag pretenure) { 150 Handle<FixedArray> Factory::NewFixedArray(int size, PretenureFlag pretenure) {
(...skipping 2638 matching lines...) Expand 10 before | Expand all | Expand 10 after
2780 Handle<JSFixedArrayIterator>::cast(NewJSObjectFromMap(map)); 2789 Handle<JSFixedArrayIterator>::cast(NewJSObjectFromMap(map));
2781 iterator->set_initial_next(*next); 2790 iterator->set_initial_next(*next);
2782 iterator->set_array(*array); 2791 iterator->set_array(*array);
2783 iterator->set_index(0); 2792 iterator->set_index(0);
2784 iterator->InObjectPropertyAtPut(JSFixedArrayIterator::kNextIndex, *next); 2793 iterator->InObjectPropertyAtPut(JSFixedArrayIterator::kNextIndex, *next);
2785 return iterator; 2794 return iterator;
2786 } 2795 }
2787 2796
2788 } // namespace internal 2797 } // namespace internal
2789 } // namespace v8 2798 } // namespace v8
OLDNEW
« no previous file with comments | « src/factory.h ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | src/objects-printer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698