- 22 Nov, 2012 1 commit
-
-
rossberg@chromium.org authored
Modules now have their own local scope, represented by their own context. Module instance objects have an accessor for every export that forwards access to the respective slot from the module's context. (Exports that are modules themselves, however, are simple data properties.) All modules have a _hosting_ scope/context, which (currently) is the (innermost) enclosing global scope. To deal with recursion, nested modules are hosted by the same scope as global ones. For every (global or nested) module literal, the hosting context has an internal slot that points directly to the respective module context. This enables quick access to (statically resolved) module members by 2-dimensional access through the hosting context. For example, module A { let x; module B { let y; } } module C { let z; } allocates contexts as follows: [header| .A | .B | .C | A | C ] (global) | | | | | +-- [header| z ] (module) | | | +------- [header| y ] (module) | +------------ [header| x | B ] (module) Here, .A, .B, .C are the internal slots pointing to the hosted module contexts, whereas A, B, C hold the actual instance objects (note that every module context also points to the respective instance object through its extension slot in the header). To deal with arbitrary recursion and aliases between modules, they are created and initialized in several stages. Each stage applies to all modules in the hosting global scope, including nested ones. 1. Allocate: for each module _literal_, allocate the module contexts and respective instance object and wire them up. This happens in the PushModuleContext runtime function, as generated by AllocateModules (invoked by VisitDeclarations in the hosting scope). 2. Bind: for each module _declaration_ (i.e. literals as well as aliases), assign the respective instance object to respective local variables. This happens in VisitModuleDeclaration, and uses the instance objects created in the previous stage. For each module _literal_, this phase also constructs a module descriptor for the next stage. This happens in VisitModuleLiteral. 3. Populate: invoke the DeclareModules runtime function to populate each _instance_ object with accessors for it exports. This is generated by DeclareModules (invoked by VisitDeclarations in the hosting scope again), and uses the descriptors generated in the previous stage. 4. Initialize: execute the module bodies (and other code) in sequence. This happens by the separate statements generated for module bodies. To reenter the module scopes properly, the parser inserted ModuleStatements. R=mstarzinger@chromium.org,svenpanne@chromium.org BUG= Review URL: https://codereview.chromium.org/11093074 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13033 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
- 03 Nov, 2011 2 commits
-
-
keuchel@chromium.org authored
This depends on http://codereview.chromium.org/8352039/ . Review URL: http://codereview.chromium.org/8423005 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9869 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
keuchel@chromium.org authored
Both classes have been merged into a single ScopeInfo class that implements the functionality from both. This CL does not adapt the broken gdb-jit interface. Review URL: http://codereview.chromium.org/8352039 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9868 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
- 21 Oct, 2011 1 commit
-
-
keuchel@chromium.org authored
This also includes the two fixes from r9674 and r9675. Here's the diff to the previous CL. --- a/src/runtime.cc +++ b/src/runtime.cc @@ -11133,17 +11133,26 @@ class ScopeIterator { context_(Context::cast(frame->context())), nested_scope_chain_(4) { + // Catch the case when the debugger stops in an internal function. + Handle<SharedFunctionInfo> shared_info(function_->shared()); + if (shared_info->script() == isolate->heap()->undefined_value()) { + if (shared_info->scope_info()->HasContext()) Next(); + return; + } + // Check whether we are in global code or function code. If there is a stack // slot for .result then this function has been created for evaluating // global code and it is not a real function. // Checking for the existence of .result seems fragile, but the scope info // saved with the code object does not otherwise have that information. - int index = function_->shared()->scope_info()-> + int index = shared_info->scope_info()-> StackSlotIndex(isolate_->heap()->result_symbol()); // Reparse the code and analyze the scopes. ZoneScope zone_scope(isolate, DELETE_ON_EXIT); - Handle<SharedFunctionInfo> shared_info(function_->shared()); Handle<Script> script(Script::cast(shared_info->script())); Scope* scope; if (index >= 0) { Review URL: http://codereview.chromium.org/8344046 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9734 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
- 19 Oct, 2011 1 commit
-
-
keuchel@chromium.org authored
This reverts commits r9673: "Scope tree serialization and ScopeIterator cleanup." r9674: "Use OS::SNPrintF instead of snprintf." r9675: "Use int instead of size_t, StrLength instead of strlen." Review URL: http://codereview.chromium.org/8353003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9703 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
- 18 Oct, 2011 1 commit
-
-
keuchel@chromium.org authored
The intention is to store enough scope information for the debugger to handle stack allocation of block scoped variables introduced by http://codereview.chromium.org/7860045/ . This CL is based on http://codereview.chromium.org/7904008/ . Review URL: http://codereview.chromium.org/7979001 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9673 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
- 11 Oct, 2011 1 commit
-
-
fschneider@chromium.org authored
This eliminates compile-errors when assigning Handle<SerializedScopeInfo> to Handle<Object> in a place where the declaration was not available because variables.h was not included. As a result I had to also move the enum Variable::Mode to v8globals.h and rename it to VariableMode. Review URL: http://codereview.chromium.org/8221004 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9575 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
- 08 Sep, 2011 1 commit
-
-
ricow@chromium.org authored
This is all blank line before/after linting errors. Review URL: http://codereview.chromium.org/7754022 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9204 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
- 11 Aug, 2011 1 commit
-
-
keuchel@chromium.org authored
BUG= TEST= Review URL: http://codereview.chromium.org/7549008 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8911 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
- 16 Jun, 2011 2 commits
-
-
karlklose@chromium.org authored
Review URL: http://codereview.chromium.org/7187007 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8315 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
karlklose@chromium.org authored
This reverts commit ceb31498b9d69edca3260820fb4047045891ce6d. TBR=kmillikin@chromium.org Review URL: http://codereview.chromium.org/7172030 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8308 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
- 15 Jun, 2011 1 commit
-
-
karlklose@chromium.org authored
Review URL: http://codereview.chromium.org/7167006 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8300 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
- 11 May, 2011 1 commit
-
-
ager@chromium.org authored
R=kmillikin@chromium.org BUG= TEST=mjsunit/compiler/eval-introduced-closure.js Review URL: http://codereview.chromium.org/6993008 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7853 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
- 06 May, 2011 1 commit
-
-
svenpanne@chromium.org authored
header which uses BASE_EMBEDDED and/or AllStatic. Note that still only 45 out of 135 headers in src/ can be used stand-alone, but at least this is a little bit more than before... Review URL: http://codereview.chromium.org/6931031 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7798 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
- 11 Apr, 2011 1 commit
-
-
mikhail.naganov@gmail.com authored
There is currently a bug in cpplint.py hiding this problem. R=sgjesse@chromium.org BUG=1304 TEST=none Review URL: http://codereview.chromium.org/6820028 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7567 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
- 18 Mar, 2011 3 commits
-
-
vitalyr@chromium.org authored
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7271 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
vitalyr@chromium.org authored
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7269 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
vitalyr@chromium.org authored
Review URL: http://codereview.chromium.org/6685088 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7268 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
- 07 Dec, 2010 3 commits
-
-
kasperl@chromium.org authored
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5922 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
kasperl@chromium.org authored
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5921 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
kasperl@chromium.org authored
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5920 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
- 24 Sep, 2010 1 commit
-
-
kmillikin@chromium.org authored
I noticed we sometimes had extra spaces before and after the "const" keyword. Probably the result of a search and replace gone wrong. This is a whitespace only change. Review URL: http://codereview.chromium.org/3427021 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5519 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
- 14 Jul, 2010 1 commit
-
-
kaznacheev@chromium.org authored
The static ScopeInfo members moved into this class. The new class is named ScopeInfoObject which I am not proud of, better ideas are very welcome. Also got rid of the sentinels in the serialized scope info which saves 3 words per function and is not slower. Review URL: http://codereview.chromium.org/2908009 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5067 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
- 13 Jul, 2010 1 commit
-
-
kaznacheev@chromium.org authored
The scope info is now stored in a FixedArray referenced from SharedFunctionInfo. Review URL: http://codereview.chromium.org/2918001 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5056 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
- 23 Jun, 2010 1 commit
-
-
ricow@chromium.org authored
When flushing code we can potentially flush code with a scopeinfo that we later need to resolve variables. This makes an explicit check that there are heap allocated locals in the scopeinfo. Review URL: http://codereview.chromium.org/2836021 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4921 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
- 09 Mar, 2010 1 commit
-
-
kmillikin@chromium.org authored
Remove messages.h from v8.h and include it explicitly in only the few places it is needed. Many files relied on getting handles-inl.h implicitly from messages.h through v8.h, so include handles-inl.h explicitly in v8.h instead. Remove zone-inl.h from header files where it is not needed, can be replaced by a forward declaration, or can be replaced by zone.h (specifically, factory.h and heap.h). Include zone.h or zone-inl.h in header files where it was implicitly included via heap.h or factory.h. Prefer zone.h over zone-inl.h in header files where possible by including zone-inl.h in .cc files. Review URL: http://codereview.chromium.org/668248 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4058 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
- 22 Jun, 2009 1 commit
-
-
bak@chromium.org authored
Review URL: http://codereview.chromium.org/141038 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2230 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
- 25 May, 2009 1 commit
-
-
mikhail.naganov@gmail.com authored
This issue was raised by Brett Wilson while reviewing my changelist for readability. Craig Silverstein (one of C++ SG maintainers) confirmed that we should declare one namespace per line. Our way of namespaces closing seems not violating style guides (there is no clear agreement on it), so I left it intact. Review URL: http://codereview.chromium.org/115756 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2038 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
- 18 May, 2009 1 commit
-
-
bak@chromium.org authored
Yields a 2% speedup when running compiler-benchmark. Review URL: http://codereview.chromium.org/113519 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1985 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
- 24 Feb, 2009 1 commit
-
-
ager@chromium.org authored
surrounding context to figure out if the variable could be global. If the variable could be global we check context extension objects at runtime and use a global LoadIC if no variables have been introduced by eval. Fix crash bug when loading function arguments from inside eval. The shadowed variable in the DYNAMIC_LOCAL case does not rewrite to a slot in that case. Review URL: http://codereview.chromium.org/28027 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1348 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
- 05 Feb, 2009 1 commit
-
-
ager@chromium.org authored
to eval is aliased. Now that we correctly track eval aliasing, we do not need this code. Review URL: http://codereview.chromium.org/20078 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1228 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
- 09 Sep, 2008 1 commit
-
-
christian.plesner.hansen@gmail.com authored
Added presubmit step to check copyright. git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@242 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-
- 03 Jul, 2008 1 commit
-
-
christian.plesner.hansen authored
git-svn-id: http://v8.googlecode.com/svn/trunk@2 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-