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

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: Small fix: set harmony flag properly 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') | no next file with comments »
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(
296 Handle<JSFunction> function,
297 Handle<Context> previous,
298 Handle<SerializedScopeInfo> scope_info) {
299 CALL_HEAP_FUNCTION(
300 isolate(),
301 isolate()->heap()->AllocateBlockContext(*function,
302 *previous,
303 *scope_info),
304 Context);
305 }
306
307
294 Handle<Struct> Factory::NewStruct(InstanceType type) { 308 Handle<Struct> Factory::NewStruct(InstanceType type) {
295 CALL_HEAP_FUNCTION( 309 CALL_HEAP_FUNCTION(
296 isolate(), 310 isolate(),
297 isolate()->heap()->AllocateStruct(type), 311 isolate()->heap()->AllocateStruct(type),
298 Struct); 312 Struct);
299 } 313 }
300 314
301 315
302 Handle<AccessorInfo> Factory::NewAccessorInfo() { 316 Handle<AccessorInfo> Factory::NewAccessorInfo() {
303 Handle<AccessorInfo> info = 317 Handle<AccessorInfo> info =
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 Handle<JSFunction> function = NewFunctionWithoutPrototype(name, 741 Handle<JSFunction> function = NewFunctionWithoutPrototype(name,
728 kNonStrictMode); 742 kNonStrictMode);
729 function->shared()->set_code(*code); 743 function->shared()->set_code(*code);
730 function->set_code(*code); 744 function->set_code(*code);
731 ASSERT(!function->has_initial_map()); 745 ASSERT(!function->has_initial_map());
732 ASSERT(!function->has_prototype()); 746 ASSERT(!function->has_prototype());
733 return function; 747 return function;
734 } 748 }
735 749
736 750
751 Handle<SerializedScopeInfo> Factory::NewSerializedScopeInfo(int length) {
752 CALL_HEAP_FUNCTION(
753 isolate(),
754 isolate()->heap()->AllocateSerializedScopeInfo(length),
755 SerializedScopeInfo);
756 }
757
758
737 Handle<Code> Factory::NewCode(const CodeDesc& desc, 759 Handle<Code> Factory::NewCode(const CodeDesc& desc,
738 Code::Flags flags, 760 Code::Flags flags,
739 Handle<Object> self_ref, 761 Handle<Object> self_ref,
740 bool immovable) { 762 bool immovable) {
741 CALL_HEAP_FUNCTION(isolate(), 763 CALL_HEAP_FUNCTION(isolate(),
742 isolate()->heap()->CreateCode( 764 isolate()->heap()->CreateCode(
743 desc, flags, self_ref, immovable), 765 desc, flags, self_ref, immovable),
744 Code); 766 Code);
745 } 767 }
746 768
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
1262 Execution::ConfigureInstance(instance, 1284 Execution::ConfigureInstance(instance,
1263 instance_template, 1285 instance_template,
1264 pending_exception); 1286 pending_exception);
1265 } else { 1287 } else {
1266 *pending_exception = false; 1288 *pending_exception = false;
1267 } 1289 }
1268 } 1290 }
1269 1291
1270 1292
1271 } } // namespace v8::internal 1293 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/factory.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698