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

Side by Side Diff: src/scopeinfo.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/scopeinfo.h ('k') | src/scopes.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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 template<class Allocator> 306 template<class Allocator>
307 Handle<SerializedScopeInfo> ScopeInfo<Allocator>::Serialize() { 307 Handle<SerializedScopeInfo> ScopeInfo<Allocator>::Serialize() {
308 // function name, calls eval, is_strict_mode, length for 3 tables: 308 // function name, calls eval, is_strict_mode, length for 3 tables:
309 const int extra_slots = 1 + 1 + 1 + 3; 309 const int extra_slots = 1 + 1 + 1 + 3;
310 int length = extra_slots + 310 int length = extra_slots +
311 context_slots_.length() * 2 + 311 context_slots_.length() * 2 +
312 parameters_.length() + 312 parameters_.length() +
313 stack_slots_.length(); 313 stack_slots_.length();
314 314
315 Handle<SerializedScopeInfo> data( 315 Handle<SerializedScopeInfo> data(
316 SerializedScopeInfo::cast(*FACTORY->NewFixedArray(length, TENURED))); 316 SerializedScopeInfo::cast(*FACTORY->NewSerializedScopeInfo(length)));
317 AssertNoAllocation nogc; 317 AssertNoAllocation nogc;
318 318
319 Object** p0 = data->data_start(); 319 Object** p0 = data->data_start();
320 Object** p = p0; 320 Object** p = p0;
321 p = WriteSymbol(p, function_name_); 321 p = WriteSymbol(p, function_name_);
322 p = WriteBool(p, calls_eval_); 322 p = WriteBool(p, calls_eval_);
323 p = WriteBool(p, is_strict_mode_); 323 p = WriteBool(p, is_strict_mode_);
324 p = WriteList(p, &context_slots_, &context_modes_); 324 p = WriteList(p, &context_slots_, &context_modes_);
325 p = WriteList(p, &parameters_); 325 p = WriteList(p, &parameters_);
326 p = WriteList(p, &stack_slots_); 326 p = WriteList(p, &stack_slots_);
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 } 639 }
640 #endif // DEBUG 640 #endif // DEBUG
641 641
642 642
643 // Make sure the classes get instantiated by the template system. 643 // Make sure the classes get instantiated by the template system.
644 template class ScopeInfo<FreeStoreAllocationPolicy>; 644 template class ScopeInfo<FreeStoreAllocationPolicy>;
645 template class ScopeInfo<PreallocatedStorage>; 645 template class ScopeInfo<PreallocatedStorage>;
646 template class ScopeInfo<ZoneListAllocationPolicy>; 646 template class ScopeInfo<ZoneListAllocationPolicy>;
647 647
648 } } // namespace v8::internal 648 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/scopeinfo.h ('k') | src/scopes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698