OLD | NEW |
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 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1435 // must not destroy the current value. | 1435 // must not destroy the current value. |
1436 if (node->mode() == Variable::CONST) { | 1436 if (node->mode() == Variable::CONST) { |
1437 __ mov(r0, Operand(Factory::the_hole_value())); | 1437 __ mov(r0, Operand(Factory::the_hole_value())); |
1438 __ push(r0); | 1438 __ push(r0); |
1439 } else if (node->fun() != NULL) { | 1439 } else if (node->fun() != NULL) { |
1440 Load(node->fun()); | 1440 Load(node->fun()); |
1441 } else { | 1441 } else { |
1442 __ mov(r0, Operand(0)); // no initial value! | 1442 __ mov(r0, Operand(0)); // no initial value! |
1443 __ push(r0); | 1443 __ push(r0); |
1444 } | 1444 } |
1445 __ CallRuntime(Runtime::kDeclareContextSlot, 5); | 1445 __ CallRuntime(Runtime::kDeclareContextSlot, 4); |
1446 __ push(r0); | 1446 // Ignore the return value (declarations are statements). |
1447 | |
1448 return; | 1447 return; |
1449 } | 1448 } |
1450 | 1449 |
1451 ASSERT(!var->is_global()); | 1450 ASSERT(!var->is_global()); |
1452 | 1451 |
1453 // If we have a function or a constant, we need to initialize the variable. | 1452 // If we have a function or a constant, we need to initialize the variable. |
1454 Expression* val = NULL; | 1453 Expression* val = NULL; |
1455 if (node->mode() == Variable::CONST) { | 1454 if (node->mode() == Variable::CONST) { |
1456 val = new Literal(Factory::the_hole_value()); | 1455 val = new Literal(Factory::the_hole_value()); |
1457 } else { | 1456 } else { |
(...skipping 3109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4567 bool is_eval) { | 4566 bool is_eval) { |
4568 Handle<Code> code = ArmCodeGenerator::MakeCode(fun, script, is_eval); | 4567 Handle<Code> code = ArmCodeGenerator::MakeCode(fun, script, is_eval); |
4569 if (!code.is_null()) { | 4568 if (!code.is_null()) { |
4570 Counters::total_compiled_code_size.Increment(code->instruction_size()); | 4569 Counters::total_compiled_code_size.Increment(code->instruction_size()); |
4571 } | 4570 } |
4572 return code; | 4571 return code; |
4573 } | 4572 } |
4574 | 4573 |
4575 | 4574 |
4576 } } // namespace v8::internal | 4575 } } // namespace v8::internal |
OLD | NEW |