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

Unified Diff: src/factory.cc

Issue 581993002: Introduce TypeFeedbackVector, as FixedArray grew constrictive. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Initial patch. Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/factory.h ('k') | src/full-codegen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 5303dd0cc25f6e1bf63f8dda30f833f5d0562af9..e4c106e8c250512dad82896f2b1f2ccaa9a2dbea 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1886,25 +1886,27 @@ void Factory::BecomeJSFunction(Handle<JSProxy> proxy) {
}
-Handle<FixedArray> Factory::NewTypeFeedbackVector(int slot_count) {
+Handle<TypeFeedbackVector> Factory::NewTypeFeedbackVector(int slot_count) {
// Ensure we can skip the write barrier
DCHECK_EQ(isolate()->heap()->uninitialized_symbol(),
*TypeFeedbackInfo::UninitializedSentinel(isolate()));
- CALL_HEAP_FUNCTION(
- isolate(),
- isolate()->heap()->AllocateFixedArrayWithFiller(
- slot_count,
- TENURED,
- *TypeFeedbackInfo::UninitializedSentinel(isolate())),
- FixedArray);
+ if (slot_count == 0) {
+ return Handle<TypeFeedbackVector>::cast(empty_fixed_array());
+ }
+
+ CALL_HEAP_FUNCTION(isolate(),
+ isolate()->heap()->AllocateFixedArrayWithFiller(
+ slot_count, TENURED,
+ *TypeFeedbackInfo::UninitializedSentinel(isolate())),
+ TypeFeedbackVector);
}
Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo(
Handle<String> name, int number_of_literals, FunctionKind kind,
Handle<Code> code, Handle<ScopeInfo> scope_info,
- Handle<FixedArray> feedback_vector) {
+ Handle<TypeFeedbackVector> feedback_vector) {
DCHECK(IsValidFunctionKind(kind));
Handle<SharedFunctionInfo> shared = NewSharedFunctionInfo(name, code);
shared->set_scope_info(*scope_info);
@@ -1972,7 +1974,7 @@ Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo(
share->set_script(*undefined_value(), SKIP_WRITE_BARRIER);
share->set_debug_info(*undefined_value(), SKIP_WRITE_BARRIER);
share->set_inferred_name(*empty_string(), SKIP_WRITE_BARRIER);
- share->set_feedback_vector(*empty_fixed_array(), SKIP_WRITE_BARRIER);
+ share->set_feedback_vector(*NewTypeFeedbackVector(0), SKIP_WRITE_BARRIER);
share->set_profiler_ticks(0);
share->set_ast_node_count(0);
share->set_counters(0);
« no previous file with comments | « src/factory.h ('k') | src/full-codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698