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

Side by Side Diff: src/factory.cc

Issue 7549008: Preliminary code for block scopes and block contexts. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Next iteration Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « src/factory.h ('k') | src/flag-definitions.h » ('j') | src/heap.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 16 matching lines...) Expand all
27 27
28 #include "v8.h" 28 #include "v8.h"
29 29
30 #include "api.h" 30 #include "api.h"
31 #include "debug.h" 31 #include "debug.h"
32 #include "execution.h" 32 #include "execution.h"
33 #include "factory.h" 33 #include "factory.h"
34 #include "macro-assembler.h" 34 #include "macro-assembler.h"
35 #include "objects.h" 35 #include "objects.h"
36 #include "objects-visiting.h" 36 #include "objects-visiting.h"
37 #include "scopeinfo.h"
37 38
38 namespace v8 { 39 namespace v8 {
39 namespace internal { 40 namespace internal {
40 41
41 42
42 Handle<FixedArray> Factory::NewFixedArray(int size, PretenureFlag pretenure) { 43 Handle<FixedArray> Factory::NewFixedArray(int size, PretenureFlag pretenure) {
43 ASSERT(0 <= size); 44 ASSERT(0 <= size);
44 CALL_HEAP_FUNCTION( 45 CALL_HEAP_FUNCTION(
45 isolate(), 46 isolate(),
46 isolate()->heap()->AllocateFixedArray(size, pretenure), 47 isolate()->heap()->AllocateFixedArray(size, pretenure),
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 Handle<Context> Factory::NewWithContext(Handle<JSFunction> function, 285 Handle<Context> Factory::NewWithContext(Handle<JSFunction> function,
285 Handle<Context> previous, 286 Handle<Context> previous,
286 Handle<JSObject> extension) { 287 Handle<JSObject> extension) {
287 CALL_HEAP_FUNCTION( 288 CALL_HEAP_FUNCTION(
288 isolate(), 289 isolate(),
289 isolate()->heap()->AllocateWithContext(*function, *previous, *extension), 290 isolate()->heap()->AllocateWithContext(*function, *previous, *extension),
290 Context); 291 Context);
291 } 292 }
292 293
293 294
295 Handle<Context> Factory::NewBlockContext(Handle<JSFunction> function,
296 Handle<Context> previous,
297 Handle<SerializedScopeInfo> scope_info) {
298 CALL_HEAP_FUNCTION(
299 isolate(),
300 isolate()->heap()->AllocateBlockContext(*function,
301 *previous,
302 *scope_info),
303 Context);
304 }
305
306
294 Handle<Struct> Factory::NewStruct(InstanceType type) { 307 Handle<Struct> Factory::NewStruct(InstanceType type) {
295 CALL_HEAP_FUNCTION( 308 CALL_HEAP_FUNCTION(
296 isolate(), 309 isolate(),
297 isolate()->heap()->AllocateStruct(type), 310 isolate()->heap()->AllocateStruct(type),
298 Struct); 311 Struct);
299 } 312 }
300 313
301 314
302 Handle<AccessorInfo> Factory::NewAccessorInfo() { 315 Handle<AccessorInfo> Factory::NewAccessorInfo() {
303 Handle<AccessorInfo> info = 316 Handle<AccessorInfo> info =
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 Handle<JSFunction> function = NewFunctionWithoutPrototype(name, 740 Handle<JSFunction> function = NewFunctionWithoutPrototype(name,
728 kNonStrictMode); 741 kNonStrictMode);
729 function->shared()->set_code(*code); 742 function->shared()->set_code(*code);
730 function->set_code(*code); 743 function->set_code(*code);
731 ASSERT(!function->has_initial_map()); 744 ASSERT(!function->has_initial_map());
732 ASSERT(!function->has_prototype()); 745 ASSERT(!function->has_prototype());
733 return function; 746 return function;
734 } 747 }
735 748
736 749
750 Handle<SerializedScopeInfo> Factory::NewSerializedScopeInfo(int length) {
751 CALL_HEAP_FUNCTION(
752 isolate(),
753 isolate()->heap()->AllocateSerializedScopeInfo(length),
754 SerializedScopeInfo);
755 }
756
757
737 Handle<Code> Factory::NewCode(const CodeDesc& desc, 758 Handle<Code> Factory::NewCode(const CodeDesc& desc,
738 Code::Flags flags, 759 Code::Flags flags,
739 Handle<Object> self_ref, 760 Handle<Object> self_ref,
740 bool immovable) { 761 bool immovable) {
741 CALL_HEAP_FUNCTION(isolate(), 762 CALL_HEAP_FUNCTION(isolate(),
742 isolate()->heap()->CreateCode( 763 isolate()->heap()->CreateCode(
743 desc, flags, self_ref, immovable), 764 desc, flags, self_ref, immovable),
744 Code); 765 Code);
745 } 766 }
746 767
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
1262 Execution::ConfigureInstance(instance, 1283 Execution::ConfigureInstance(instance,
1263 instance_template, 1284 instance_template,
1264 pending_exception); 1285 pending_exception);
1265 } else { 1286 } else {
1266 *pending_exception = false; 1287 *pending_exception = false;
1267 } 1288 }
1268 } 1289 }
1269 1290
1270 1291
1271 } } // namespace v8::internal 1292 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/factory.h ('k') | src/flag-definitions.h » ('j') | src/heap.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698