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

Side by Side Diff: src/factory.cc

Issue 1376443002: Refactored interface of FeedbackVectorSpec and friends. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Created 5 years, 2 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/heap/heap.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 2040 matching lines...) Expand 10 before | Expand all | Expand 10 after
2051 ReinitializeJSProxy(proxy, JS_OBJECT_TYPE, JSObject::kHeaderSize); 2051 ReinitializeJSProxy(proxy, JS_OBJECT_TYPE, JSObject::kHeaderSize);
2052 } 2052 }
2053 2053
2054 2054
2055 void Factory::BecomeJSFunction(Handle<JSProxy> proxy) { 2055 void Factory::BecomeJSFunction(Handle<JSProxy> proxy) {
2056 ReinitializeJSProxy(proxy, JS_FUNCTION_TYPE, JSFunction::kSize); 2056 ReinitializeJSProxy(proxy, JS_FUNCTION_TYPE, JSFunction::kSize);
2057 } 2057 }
2058 2058
2059 2059
2060 template Handle<TypeFeedbackVector> Factory::NewTypeFeedbackVector( 2060 template Handle<TypeFeedbackVector> Factory::NewTypeFeedbackVector(
2061 const ZoneFeedbackVectorSpec* spec); 2061 const FeedbackVectorSpec* spec);
2062 template Handle<TypeFeedbackVector> Factory::NewTypeFeedbackVector( 2062 template Handle<TypeFeedbackVector> Factory::NewTypeFeedbackVector(
2063 const FeedbackVectorSpec* spec); 2063 const StaticFeedbackVectorSpec* spec);
2064 2064
2065 template <typename Spec> 2065 template <typename Spec>
2066 Handle<TypeFeedbackVector> Factory::NewTypeFeedbackVector(const Spec* spec) { 2066 Handle<TypeFeedbackVector> Factory::NewTypeFeedbackVector(const Spec* spec) {
2067 return TypeFeedbackVector::Allocate<Spec>(isolate(), spec); 2067 return TypeFeedbackVector::Allocate<Spec>(isolate(), spec);
2068 } 2068 }
2069 2069
2070 2070
2071 Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo( 2071 Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo(
2072 Handle<String> name, int number_of_literals, FunctionKind kind, 2072 Handle<String> name, int number_of_literals, FunctionKind kind,
2073 Handle<Code> code, Handle<ScopeInfo> scope_info, 2073 Handle<Code> code, Handle<ScopeInfo> scope_info,
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
2121 share->set_optimized_code_map(Smi::FromInt(0)); 2121 share->set_optimized_code_map(Smi::FromInt(0));
2122 share->set_scope_info(ScopeInfo::Empty(isolate())); 2122 share->set_scope_info(ScopeInfo::Empty(isolate()));
2123 Code* construct_stub = 2123 Code* construct_stub =
2124 isolate()->builtins()->builtin(Builtins::kJSConstructStubGeneric); 2124 isolate()->builtins()->builtin(Builtins::kJSConstructStubGeneric);
2125 share->set_construct_stub(construct_stub); 2125 share->set_construct_stub(construct_stub);
2126 share->set_instance_class_name(*Object_string()); 2126 share->set_instance_class_name(*Object_string());
2127 share->set_function_data(*undefined_value(), SKIP_WRITE_BARRIER); 2127 share->set_function_data(*undefined_value(), SKIP_WRITE_BARRIER);
2128 share->set_script(*undefined_value(), SKIP_WRITE_BARRIER); 2128 share->set_script(*undefined_value(), SKIP_WRITE_BARRIER);
2129 share->set_debug_info(*undefined_value(), SKIP_WRITE_BARRIER); 2129 share->set_debug_info(*undefined_value(), SKIP_WRITE_BARRIER);
2130 share->set_inferred_name(*empty_string(), SKIP_WRITE_BARRIER); 2130 share->set_inferred_name(*empty_string(), SKIP_WRITE_BARRIER);
2131 FeedbackVectorSpec empty_spec(0); 2131 StaticFeedbackVectorSpec empty_spec;
2132 Handle<TypeFeedbackVector> feedback_vector = 2132 Handle<TypeFeedbackVector> feedback_vector =
2133 NewTypeFeedbackVector(&empty_spec); 2133 NewTypeFeedbackVector(&empty_spec);
2134 share->set_feedback_vector(*feedback_vector, SKIP_WRITE_BARRIER); 2134 share->set_feedback_vector(*feedback_vector, SKIP_WRITE_BARRIER);
2135 #if TRACE_MAPS 2135 #if TRACE_MAPS
2136 share->set_unique_id(isolate()->GetNextUniqueSharedFunctionInfoId()); 2136 share->set_unique_id(isolate()->GetNextUniqueSharedFunctionInfoId());
2137 #endif 2137 #endif
2138 share->set_profiler_ticks(0); 2138 share->set_profiler_ticks(0);
2139 share->set_ast_node_count(0); 2139 share->set_ast_node_count(0);
2140 share->set_counters(0); 2140 share->set_counters(0);
2141 2141
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
2374 } 2374 }
2375 2375
2376 2376
2377 Handle<Object> Factory::ToBoolean(bool value) { 2377 Handle<Object> Factory::ToBoolean(bool value) {
2378 return value ? true_value() : false_value(); 2378 return value ? true_value() : false_value();
2379 } 2379 }
2380 2380
2381 2381
2382 } // namespace internal 2382 } // namespace internal
2383 } // namespace v8 2383 } // namespace v8
OLDNEW
« no previous file with comments | « src/factory.h ('k') | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698