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

Side by Side Diff: src/codegen-ia32.cc

Issue 20453: ARM side of load optimization in the presence of eval. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 10 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/codegen-arm.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 return Operand(eax); 448 return Operand(eax);
449 } 449 }
450 } 450 }
451 451
452 452
453 Operand CodeGenerator::ContextSlotOperandCheckExtensions(Slot* slot, 453 Operand CodeGenerator::ContextSlotOperandCheckExtensions(Slot* slot,
454 Register tmp, 454 Register tmp,
455 Label* slow) { 455 Label* slow) {
456 ASSERT(slot->type() == Slot::CONTEXT); 456 ASSERT(slot->type() == Slot::CONTEXT);
457 int index = slot->index(); 457 int index = slot->index();
458 __ mov(tmp, Operand(esi)); 458 Register context = esi;
459 for (Scope* s = scope(); s != slot->var()->scope(); s = s->outer_scope()) { 459 for (Scope* s = scope(); s != slot->var()->scope(); s = s->outer_scope()) {
460 if (s->num_heap_slots() > 0) { 460 if (s->num_heap_slots() > 0) {
461 if (s->calls_eval()) { 461 if (s->calls_eval()) {
462 // Check that extension is NULL. 462 // Check that extension is NULL.
463 __ cmp(ContextOperand(tmp, Context::EXTENSION_INDEX), Immediate(0)); 463 __ cmp(ContextOperand(context, Context::EXTENSION_INDEX), Immediate(0));
464 __ j(not_equal, slow, not_taken); 464 __ j(not_equal, slow, not_taken);
465 } 465 }
466 __ mov(tmp, ContextOperand(tmp, Context::CLOSURE_INDEX)); 466 __ mov(tmp, ContextOperand(context, Context::CLOSURE_INDEX));
467 __ mov(tmp, FieldOperand(tmp, JSFunction::kContextOffset)); 467 __ mov(tmp, FieldOperand(tmp, JSFunction::kContextOffset));
468 context = tmp;
468 } 469 }
469 } 470 }
470 // Check that last extension is NULL. 471 // Check that last extension is NULL.
471 __ cmp(ContextOperand(tmp, Context::EXTENSION_INDEX), Immediate(0)); 472 __ cmp(ContextOperand(tmp, Context::EXTENSION_INDEX), Immediate(0));
472 __ j(not_equal, slow, not_taken); 473 __ j(not_equal, slow, not_taken);
473 __ mov(tmp, ContextOperand(tmp, Context::FCONTEXT_INDEX)); 474 __ mov(tmp, ContextOperand(tmp, Context::FCONTEXT_INDEX));
474 return ContextOperand(tmp, index); 475 return ContextOperand(tmp, index);
475 } 476 }
476 477
477 478
(...skipping 1927 matching lines...) Expand 10 before | Expand all | Expand 10 after
2405 } 2406 }
2406 } 2407 }
2407 2408
2408 2409
2409 void CodeGenerator::LoadFromGlobalSlotCheckExtensions(Slot* slot, 2410 void CodeGenerator::LoadFromGlobalSlotCheckExtensions(Slot* slot,
2410 TypeofState typeof_state, 2411 TypeofState typeof_state,
2411 Register tmp, 2412 Register tmp,
2412 Label* slow) { 2413 Label* slow) {
2413 // Check that no extension objects have been created by calls to 2414 // Check that no extension objects have been created by calls to
2414 // eval from the current scope to the global scope. 2415 // eval from the current scope to the global scope.
2415 __ mov(tmp, Operand(esi)); 2416 Register context = esi;
2416 for (Scope* s = scope(); s != NULL; s = s->outer_scope()) { 2417 for (Scope* s = scope(); s != NULL; s = s->outer_scope()) {
2417 if (s->num_heap_slots() > 0) { 2418 if (s->num_heap_slots() > 0) {
2418 if (s->calls_eval()) { 2419 if (s->calls_eval()) {
2419 // Check that extension is NULL. 2420 // Check that extension is NULL.
2420 __ cmp(ContextOperand(tmp, Context::EXTENSION_INDEX), Immediate(0)); 2421 __ cmp(ContextOperand(context, Context::EXTENSION_INDEX), Immediate(0));
2421 __ j(not_equal, slow, not_taken); 2422 __ j(not_equal, slow, not_taken);
2422 } 2423 }
2423 // Load next context in chain. 2424 // Load next context in chain.
2424 __ mov(tmp, ContextOperand(tmp, Context::CLOSURE_INDEX)); 2425 __ mov(tmp, ContextOperand(context, Context::CLOSURE_INDEX));
2425 __ mov(tmp, FieldOperand(tmp, JSFunction::kContextOffset)); 2426 __ mov(tmp, FieldOperand(tmp, JSFunction::kContextOffset));
2427 context = tmp;
2426 } 2428 }
2427 // If no outer scope calls eval, we do not need to check more 2429 // If no outer scope calls eval, we do not need to check more
2428 // context extensions. 2430 // context extensions.
2429 if (!s->outer_scope_calls_eval()) break; 2431 if (!s->outer_scope_calls_eval()) break;
2430 } 2432 }
2431 2433
2432 // All extension objects were empty and it is safe to use a global 2434 // All extension objects were empty and it is safe to use a global
2433 // load IC call. 2435 // load IC call.
2434 Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize)); 2436 Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
2435 // Load the global object. 2437 // Load the global object.
(...skipping 2984 matching lines...) Expand 10 before | Expand all | Expand 10 after
5420 5422
5421 // Slow-case: Go through the JavaScript implementation. 5423 // Slow-case: Go through the JavaScript implementation.
5422 __ bind(&slow); 5424 __ bind(&slow);
5423 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); 5425 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION);
5424 } 5426 }
5425 5427
5426 5428
5427 #undef __ 5429 #undef __
5428 5430
5429 } } // namespace v8::internal 5431 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/codegen-arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698