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

Side by Side Diff: src/factory.cc

Issue 1371893002: objects-inl.h: Remove ACCESSORS_TO_SMI macro (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: undo last_script_id storage change 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/debug/debug.cc ('k') | src/frames.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 833 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 } 844 }
845 845
846 846
847 Handle<Script> Factory::NewScript(Handle<String> source) { 847 Handle<Script> Factory::NewScript(Handle<String> source) {
848 // Create and initialize script object. 848 // Create and initialize script object.
849 Heap* heap = isolate()->heap(); 849 Heap* heap = isolate()->heap();
850 Handle<Script> script = Handle<Script>::cast(NewStruct(SCRIPT_TYPE)); 850 Handle<Script> script = Handle<Script>::cast(NewStruct(SCRIPT_TYPE));
851 script->set_source(*source); 851 script->set_source(*source);
852 script->set_name(heap->undefined_value()); 852 script->set_name(heap->undefined_value());
853 script->set_id(isolate()->heap()->NextScriptId()); 853 script->set_id(isolate()->heap()->NextScriptId());
854 script->set_line_offset(Smi::FromInt(0)); 854 script->set_line_offset(0);
855 script->set_column_offset(Smi::FromInt(0)); 855 script->set_column_offset(0);
856 script->set_context_data(heap->undefined_value()); 856 script->set_context_data(heap->undefined_value());
857 script->set_type(Smi::FromInt(Script::TYPE_NORMAL)); 857 script->set_type(Script::TYPE_NORMAL);
858 script->set_wrapper(heap->undefined_value()); 858 script->set_wrapper(heap->undefined_value());
859 script->set_line_ends(heap->undefined_value()); 859 script->set_line_ends(heap->undefined_value());
860 script->set_eval_from_shared(heap->undefined_value()); 860 script->set_eval_from_shared(heap->undefined_value());
861 script->set_eval_from_instructions_offset(Smi::FromInt(0)); 861 script->set_eval_from_instructions_offset(0);
862 script->set_shared_function_infos(Smi::FromInt(0)); 862 script->set_shared_function_infos(Smi::FromInt(0));
863 script->set_flags(Smi::FromInt(0)); 863 script->set_flags(0);
864 864
865 heap->set_script_list(*WeakFixedArray::Add(script_list(), script)); 865 heap->set_script_list(*WeakFixedArray::Add(script_list(), script));
866 return script; 866 return script;
867 } 867 }
868 868
869 869
870 Handle<Foreign> Factory::NewForeign(Address addr, PretenureFlag pretenure) { 870 Handle<Foreign> Factory::NewForeign(Address addr, PretenureFlag pretenure) {
871 CALL_HEAP_FUNCTION(isolate(), 871 CALL_HEAP_FUNCTION(isolate(),
872 isolate()->heap()->AllocateForeign(addr, pretenure), 872 isolate()->heap()->AllocateForeign(addr, pretenure),
873 Foreign); 873 Foreign);
(...skipping 1500 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/debug/debug.cc ('k') | src/frames.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698