| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/full-codegen/full-codegen.h" | 5 #include "src/full-codegen/full-codegen.h" |
| 6 | 6 |
| 7 #include "src/ast/ast.h" | 7 #include "src/ast/ast.h" |
| 8 #include "src/ast/ast-numbering.h" | 8 #include "src/ast/ast-numbering.h" |
| 9 #include "src/ast/prettyprinter.h" | 9 #include "src/ast/prettyprinter.h" |
| 10 #include "src/ast/scopeinfo.h" | 10 #include "src/ast/scopeinfo.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 bool FullCodeGenerator::MustCreateArrayLiteralWithRuntime( | 158 bool FullCodeGenerator::MustCreateArrayLiteralWithRuntime( |
| 159 ArrayLiteral* expr) const { | 159 ArrayLiteral* expr) const { |
| 160 // TODO(rossberg): Teach strong mode to FastCloneShallowArrayStub. | 160 // TODO(rossberg): Teach strong mode to FastCloneShallowArrayStub. |
| 161 return expr->depth() > 1 || expr->is_strong() || | 161 return expr->depth() > 1 || expr->is_strong() || |
| 162 expr->values()->length() > JSArray::kInitialMaxFastElementArray; | 162 expr->values()->length() > JSArray::kInitialMaxFastElementArray; |
| 163 } | 163 } |
| 164 | 164 |
| 165 | 165 |
| 166 void FullCodeGenerator::Initialize() { | 166 void FullCodeGenerator::Initialize() { |
| 167 InitializeAstVisitor(info_->isolate()); | 167 InitializeAstVisitor(info_->isolate()); |
| 168 // The generation of debug code must match between the snapshot code and the | 168 masm_->set_emit_debug_code(FLAG_debug_code); |
| 169 // code that is generated later. This is assumed by the debugger when it is | |
| 170 // calculating PC offsets after generating a debug version of code. Therefore | |
| 171 // we disable the production of debug code in the full compiler if we are | |
| 172 // either generating a snapshot or we booted from a snapshot. | |
| 173 generate_debug_code_ = FLAG_debug_code && !masm_->serializer_enabled() && | |
| 174 !info_->isolate()->snapshot_available(); | |
| 175 masm_->set_emit_debug_code(generate_debug_code_); | |
| 176 masm_->set_predictable_code_size(true); | 169 masm_->set_predictable_code_size(true); |
| 177 } | 170 } |
| 178 | 171 |
| 179 | 172 |
| 180 void FullCodeGenerator::PrepareForBailout(Expression* node, State state) { | 173 void FullCodeGenerator::PrepareForBailout(Expression* node, State state) { |
| 181 PrepareForBailoutForId(node->id(), state); | 174 PrepareForBailoutForId(node->id(), state); |
| 182 } | 175 } |
| 183 | 176 |
| 184 | 177 |
| 185 void FullCodeGenerator::CallLoadIC(TypeofMode typeof_mode, | 178 void FullCodeGenerator::CallLoadIC(TypeofMode typeof_mode, |
| (...skipping 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1791 return var->mode() == CONST_LEGACY || var->scope()->is_nonlinear() || | 1784 return var->mode() == CONST_LEGACY || var->scope()->is_nonlinear() || |
| 1792 var->initializer_position() >= proxy->position(); | 1785 var->initializer_position() >= proxy->position(); |
| 1793 } | 1786 } |
| 1794 | 1787 |
| 1795 | 1788 |
| 1796 #undef __ | 1789 #undef __ |
| 1797 | 1790 |
| 1798 | 1791 |
| 1799 } // namespace internal | 1792 } // namespace internal |
| 1800 } // namespace v8 | 1793 } // namespace v8 |
| OLD | NEW |