Chromium Code Reviews| 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/ast.h" | 7 #include "src/ast.h" |
| 8 #include "src/ast-numbering.h" | 8 #include "src/ast-numbering.h" |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 408 | 408 |
| 409 | 409 |
| 410 void FullCodeGenerator::PopulateTypeFeedbackInfo(Handle<Code> code) { | 410 void FullCodeGenerator::PopulateTypeFeedbackInfo(Handle<Code> code) { |
| 411 Handle<TypeFeedbackInfo> info = isolate()->factory()->NewTypeFeedbackInfo(); | 411 Handle<TypeFeedbackInfo> info = isolate()->factory()->NewTypeFeedbackInfo(); |
| 412 info->set_ic_total_count(ic_total_count_); | 412 info->set_ic_total_count(ic_total_count_); |
| 413 DCHECK(!isolate()->heap()->InNewSpace(*info)); | 413 DCHECK(!isolate()->heap()->InNewSpace(*info)); |
| 414 code->set_type_feedback_info(*info); | 414 code->set_type_feedback_info(*info); |
| 415 } | 415 } |
| 416 | 416 |
| 417 | 417 |
| 418 bool FullCodeGenerator::MustCreateObjectLiteralWithRuntime( | |
| 419 ObjectLiteral* expr) const { | |
| 420 return expr->may_store_doubles() || expr->depth() > 1 || | |
| 421 masm()->serializer_enabled() || | |
| 422 expr->ComputeFlags() != ObjectLiteral::kFastElements || | |
| 423 expr->has_elements() || | |
|
Toon Verwaest
2015/03/30 08:42:20
Add a comment that fast-clone-shallow-object doesn
mvstanton
2015/03/30 08:59:38
Done.
| |
| 424 expr->properties_count() > | |
| 425 FastCloneShallowObjectStub::kMaximumClonedProperties; | |
| 426 } | |
| 427 | |
| 428 | |
| 429 bool FullCodeGenerator::MustCreateArrayLiteralWithRuntime( | |
| 430 ArrayLiteral* expr) const { | |
| 431 return expr->depth() > 1 || | |
| 432 expr->values()->length() > JSObject::kInitialMaxFastElementArray; | |
| 433 } | |
| 434 | |
| 435 | |
| 418 void FullCodeGenerator::Initialize() { | 436 void FullCodeGenerator::Initialize() { |
| 419 InitializeAstVisitor(info_->isolate(), info_->zone()); | 437 InitializeAstVisitor(info_->isolate(), info_->zone()); |
| 420 // The generation of debug code must match between the snapshot code and the | 438 // The generation of debug code must match between the snapshot code and the |
| 421 // code that is generated later. This is assumed by the debugger when it is | 439 // code that is generated later. This is assumed by the debugger when it is |
| 422 // calculating PC offsets after generating a debug version of code. Therefore | 440 // calculating PC offsets after generating a debug version of code. Therefore |
| 423 // we disable the production of debug code in the full compiler if we are | 441 // we disable the production of debug code in the full compiler if we are |
| 424 // either generating a snapshot or we booted from a snapshot. | 442 // either generating a snapshot or we booted from a snapshot. |
| 425 generate_debug_code_ = FLAG_debug_code && !masm_->serializer_enabled() && | 443 generate_debug_code_ = FLAG_debug_code && !masm_->serializer_enabled() && |
| 426 !info_->isolate()->snapshot_available(); | 444 !info_->isolate()->snapshot_available(); |
| 427 masm_->set_emit_debug_code(generate_debug_code_); | 445 masm_->set_emit_debug_code(generate_debug_code_); |
| (...skipping 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1823 } | 1841 } |
| 1824 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); | 1842 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); |
| 1825 codegen_->scope_ = saved_scope_; | 1843 codegen_->scope_ = saved_scope_; |
| 1826 } | 1844 } |
| 1827 | 1845 |
| 1828 | 1846 |
| 1829 #undef __ | 1847 #undef __ |
| 1830 | 1848 |
| 1831 | 1849 |
| 1832 } } // namespace v8::internal | 1850 } } // namespace v8::internal |
| OLD | NEW |