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

Unified Diff: src/objects.h

Issue 8423005: Remove some unnecessary binding initialization checks. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | src/parser.cc » ('j') | src/scopes.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 021ad4cc76fcad76c3e847d6804120fdd3c5068f..df7d95d722b0ceb39574f420c11aa460aa8a1053 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -3173,18 +3173,25 @@ class ScopeInfo : public FixedArray {
// Return the mode of the given context local.
VariableMode context_local_mode(int var);
+ // Return the initialization flag of the given context local.
+ InitializationFlag context_local_init_flag(int var);
+
// Lookup support for serialized scope info. Returns the
// the stack slot index for a given slot name if the slot is
// present; otherwise returns a value < 0. The name must be a symbol
// (canonicalized).
int StackSlotIndex(String* name);
- // Lookup support for serialized scope info. Returns the
- // context slot index for a given slot name if the slot is present; otherwise
- // returns a value < 0. The name must be a symbol (canonicalized).
- // If the slot is present and mode != NULL, sets *mode to the corresponding
- // mode for that variable.
- int ContextSlotIndex(String* name, VariableMode* mode = NULL);
+ // Lookup support for serialized scope info. Returns the context slot index
+ // for a given slot name if the slot is present; otherwise returns a
+ // value < 0. The name must be a symbol (canonicalized).
+ // If the slot is present
+ // 1. and mode != NULL, sets *mode to the mode of that variable.
+ // 2. and init_flag != NULL, sets *init_flag to the initialization flag of
+ // that variable.
+ int ContextSlotIndex(String* name,
+ VariableMode* mode = NULL,
+ InitializationFlag* init_flag = NULL);
// Lookup support for serialized scope info. Returns the
// parameter index for a given parameter name if the parameter is present;
@@ -3257,10 +3264,11 @@ class ScopeInfo : public FixedArray {
// index starting with Context::MIN_CONTEXT_SLOTS. One slot is used per
// context local, so in total this part occupies num_context_locals()
// slots in the array.
- // 4. ContextLocalModeEntries:
- // Contains the variable modes corresponding to the context locals in
- // ContextLocalNameEntries. One slot is used per context local, so in total
- // this part occupies num_context_locals() slots in the array.
+ // 4. ContextLocalInfoEntries:
+ // Contains the variable modes and initialization flags corresponding to
+ // the context locals in ContextLocalNameEntries. One slot is used per
+ // context local, so in total this part occupies num_context_locals()
+ // slots in the array.
// 5. FunctionNameEntryIndex:
// If the scope belongs to a named function expression this part contains
// information about the function variable. It always occupies two array
@@ -3269,7 +3277,7 @@ class ScopeInfo : public FixedArray {
int ParameterEntriesIndex();
int StackLocalEntriesIndex();
int ContextLocalNameEntriesIndex();
- int ContextLocalModeEntriesIndex();
+ int ContextLocalInfoEntriesIndex();
int FunctionNameEntryIndex();
// Location of the function variable for named function expressions.
@@ -3286,6 +3294,11 @@ class ScopeInfo : public FixedArray {
class StrictModeField: public BitField<bool, 4, 1> {};
class FunctionVariableField: public BitField<FunctionVariableInfo, 5, 2> {};
class FunctionVariableMode: public BitField<VariableMode, 7, 3> {};
+
+ // BitFields representing the encoded information for context locals in the
+ // ContextLocalInfoEntries part.
+ class ContextLocalMode: public BitField<VariableMode, 0, 3> {};
+ class ContextLocalInitFlag: public BitField<InitializationFlag, 3, 1> {};
};
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | src/parser.cc » ('j') | src/scopes.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698