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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 void FullCodeGenerator::PopulateTypeFeedbackInfo(Handle<Code> code) { | 413 void FullCodeGenerator::PopulateTypeFeedbackInfo(Handle<Code> code) { |
414 Handle<TypeFeedbackInfo> info = isolate()->factory()->NewTypeFeedbackInfo(); | 414 Handle<TypeFeedbackInfo> info = isolate()->factory()->NewTypeFeedbackInfo(); |
415 info->set_ic_total_count(ic_total_count_); | 415 info->set_ic_total_count(ic_total_count_); |
416 DCHECK(!isolate()->heap()->InNewSpace(*info)); | 416 DCHECK(!isolate()->heap()->InNewSpace(*info)); |
417 code->set_type_feedback_info(*info); | 417 code->set_type_feedback_info(*info); |
418 } | 418 } |
419 | 419 |
420 | 420 |
421 bool FullCodeGenerator::MustCreateObjectLiteralWithRuntime( | 421 bool FullCodeGenerator::MustCreateObjectLiteralWithRuntime( |
422 ObjectLiteral* expr) const { | 422 ObjectLiteral* expr) const { |
| 423 int literal_flags = expr->ComputeFlags(); |
423 // FastCloneShallowObjectStub doesn't copy elements, and object literals don't | 424 // FastCloneShallowObjectStub doesn't copy elements, and object literals don't |
424 // support copy-on-write (COW) elements for now. | 425 // support copy-on-write (COW) elements for now. |
425 // TODO(mvstanton): make object literals support COW elements. | 426 // TODO(mvstanton): make object literals support COW elements. |
426 return expr->may_store_doubles() || expr->depth() > 1 || | 427 return masm()->serializer_enabled() || |
427 masm()->serializer_enabled() || | 428 literal_flags != ObjectLiteral::kShallowProperties || |
428 expr->ComputeFlags() != ObjectLiteral::kFastElements || | 429 literal_flags != ObjectLiteral::kFastElements || |
429 expr->has_elements() || | |
430 expr->properties_count() > | 430 expr->properties_count() > |
431 FastCloneShallowObjectStub::kMaximumClonedProperties; | 431 FastCloneShallowObjectStub::kMaximumClonedProperties; |
432 } | 432 } |
433 | 433 |
434 | 434 |
435 bool FullCodeGenerator::MustCreateArrayLiteralWithRuntime( | 435 bool FullCodeGenerator::MustCreateArrayLiteralWithRuntime( |
436 ArrayLiteral* expr) const { | 436 ArrayLiteral* expr) const { |
437 return expr->depth() > 1 || | 437 return expr->depth() > 1 || |
438 expr->values()->length() > JSObject::kInitialMaxFastElementArray; | 438 expr->values()->length() > JSObject::kInitialMaxFastElementArray; |
439 } | 439 } |
(...skipping 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1851 } | 1851 } |
1852 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); | 1852 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); |
1853 codegen_->scope_ = saved_scope_; | 1853 codegen_->scope_ = saved_scope_; |
1854 } | 1854 } |
1855 | 1855 |
1856 | 1856 |
1857 #undef __ | 1857 #undef __ |
1858 | 1858 |
1859 | 1859 |
1860 } } // namespace v8::internal | 1860 } } // namespace v8::internal |
OLD | NEW |