Update comment and add assert.

Fix typo where underscore is used instead of a dash.
Review URL: http://codereview.chromium.org/16238

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1019 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
ager@chromium.org 2008-12-23 08:58:56 +00:00
parent 3f383346aa
commit 5f1ef9cbf8
2 changed files with 8 additions and 6 deletions

View File

@ -3875,6 +3875,8 @@ void Reference::GetValue(TypeofState typeof_state) {
// distinction between expressions in a typeof and not in a // distinction between expressions in a typeof and not in a
// typeof. // typeof.
Variable* var = expression_->AsVariableProxy()->AsVariable(); Variable* var = expression_->AsVariableProxy()->AsVariable();
bool is_global = var != NULL;
ASSERT(!is_global || var->is_global());
// Inline array load code if inside of a loop. We do not know // Inline array load code if inside of a loop. We do not know
// the receiver map yet, so we initially generate the code with // the receiver map yet, so we initially generate the code with
// a check against an invalid map. In the inline cache code, we // a check against an invalid map. In the inline cache code, we
@ -3882,11 +3884,12 @@ void Reference::GetValue(TypeofState typeof_state) {
if (cgen_->loop_nesting() > 0) { if (cgen_->loop_nesting() > 0) {
Comment cmnt(masm, "[ Inlined array index load"); Comment cmnt(masm, "[ Inlined array index load");
DeferredReferenceGetKeyedValue* deferred = DeferredReferenceGetKeyedValue* deferred =
new DeferredReferenceGetKeyedValue(cgen_, var != NULL); new DeferredReferenceGetKeyedValue(cgen_, is_global);
// Load receiver and check that it is not a smi (only needed // Load receiver and check that it is not a smi (only needed
// if not contextual) and that it has the expected map. // if this is not a load from the global context) and that it
// has the expected map.
__ mov(edx, Operand(esp, kPointerSize)); __ mov(edx, Operand(esp, kPointerSize));
if (var == NULL) { if (!is_global) {
__ test(edx, Immediate(kSmiTagMask)); __ test(edx, Immediate(kSmiTagMask));
__ j(zero, deferred->enter(), not_taken); __ j(zero, deferred->enter(), not_taken);
} }
@ -3921,8 +3924,7 @@ void Reference::GetValue(TypeofState typeof_state) {
} else { } else {
Comment cmnt(masm, "[ Load from keyed Property"); Comment cmnt(masm, "[ Load from keyed Property");
Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize)); Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
if (var != NULL) { if (is_global) {
ASSERT(var->is_global());
__ call(ic, RelocInfo::CODE_TARGET_CONTEXT); __ call(ic, RelocInfo::CODE_TARGET_CONTEXT);
} else { } else {
__ call(ic, RelocInfo::CODE_TARGET); __ call(ic, RelocInfo::CODE_TARGET);

View File

@ -48,7 +48,7 @@
// - GlobalObject // - GlobalObject
// - JSGlobalObject // - JSGlobalObject
// - JSBuiltinsObject // - JSBuiltinsObject
// _ JSGlobalProxy // - JSGlobalProxy
// - JSValue // - JSValue
// - Script // - Script
// - Array // - Array