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

Side by Side Diff: src/factory.cc

Issue 1211453002: Reland "Keep a canonical list of shared function infos." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix alwaysopt Created 5 years, 5 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/debug.cc ('k') | src/full-codegen.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 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 script->set_name(heap->undefined_value()); 837 script->set_name(heap->undefined_value());
838 script->set_id(isolate()->heap()->NextScriptId()); 838 script->set_id(isolate()->heap()->NextScriptId());
839 script->set_line_offset(Smi::FromInt(0)); 839 script->set_line_offset(Smi::FromInt(0));
840 script->set_column_offset(Smi::FromInt(0)); 840 script->set_column_offset(Smi::FromInt(0));
841 script->set_context_data(heap->undefined_value()); 841 script->set_context_data(heap->undefined_value());
842 script->set_type(Smi::FromInt(Script::TYPE_NORMAL)); 842 script->set_type(Smi::FromInt(Script::TYPE_NORMAL));
843 script->set_wrapper(heap->undefined_value()); 843 script->set_wrapper(heap->undefined_value());
844 script->set_line_ends(heap->undefined_value()); 844 script->set_line_ends(heap->undefined_value());
845 script->set_eval_from_shared(heap->undefined_value()); 845 script->set_eval_from_shared(heap->undefined_value());
846 script->set_eval_from_instructions_offset(Smi::FromInt(0)); 846 script->set_eval_from_instructions_offset(Smi::FromInt(0));
847 script->set_shared_function_infos(Smi::FromInt(0));
847 script->set_flags(Smi::FromInt(0)); 848 script->set_flags(Smi::FromInt(0));
848 849
849 return script; 850 return script;
850 } 851 }
851 852
852 853
853 Handle<Foreign> Factory::NewForeign(Address addr, PretenureFlag pretenure) { 854 Handle<Foreign> Factory::NewForeign(Address addr, PretenureFlag pretenure) {
854 CALL_HEAP_FUNCTION(isolate(), 855 CALL_HEAP_FUNCTION(isolate(),
855 isolate()->heap()->AllocateForeign(addr, pretenure), 856 isolate()->heap()->AllocateForeign(addr, pretenure),
856 Foreign); 857 Foreign);
(...skipping 1334 matching lines...) Expand 10 before | Expand all | Expand 10 after
2191 share->set_internal_formal_parameter_count(0); 2192 share->set_internal_formal_parameter_count(0);
2192 share->set_expected_nof_properties(0); 2193 share->set_expected_nof_properties(0);
2193 share->set_num_literals(0); 2194 share->set_num_literals(0);
2194 share->set_start_position_and_type(0); 2195 share->set_start_position_and_type(0);
2195 share->set_end_position(0); 2196 share->set_end_position(0);
2196 share->set_function_token_position(0); 2197 share->set_function_token_position(0);
2197 // All compiler hints default to false or 0. 2198 // All compiler hints default to false or 0.
2198 share->set_compiler_hints(0); 2199 share->set_compiler_hints(0);
2199 share->set_opt_count_and_bailout_reason(0); 2200 share->set_opt_count_and_bailout_reason(0);
2200 2201
2202 share->set_never_compiled(!share->is_compiled());
2201 return share; 2203 return share;
2202 } 2204 }
2203 2205
2204 2206
2205 static inline int NumberCacheHash(Handle<FixedArray> cache, 2207 static inline int NumberCacheHash(Handle<FixedArray> cache,
2206 Handle<Object> number) { 2208 Handle<Object> number) {
2207 int mask = (cache->length() >> 1) - 1; 2209 int mask = (cache->length() >> 1) - 1;
2208 if (number->IsSmi()) { 2210 if (number->IsSmi()) {
2209 return Handle<Smi>::cast(number)->value() & mask; 2211 return Handle<Smi>::cast(number)->value() & mask;
2210 } else { 2212 } else {
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
2430 } 2432 }
2431 2433
2432 2434
2433 Handle<Object> Factory::ToBoolean(bool value) { 2435 Handle<Object> Factory::ToBoolean(bool value) {
2434 return value ? true_value() : false_value(); 2436 return value ? true_value() : false_value();
2435 } 2437 }
2436 2438
2437 2439
2438 } // namespace internal 2440 } // namespace internal
2439 } // namespace v8 2441 } // namespace v8
OLDNEW
« no previous file with comments | « src/debug.cc ('k') | src/full-codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698