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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 // FastCloneShallowObjectStub doesn't copy elements, and object literals don't | 423 // FastCloneShallowObjectStub doesn't copy elements, and object literals don't |
424 // support copy-on-write (COW) elements for now. | 424 // support copy-on-write (COW) elements for now. |
425 // TODO(mvstanton): make object literals support COW elements. | 425 // TODO(mvstanton): make object literals support COW elements. |
426 return expr->may_store_doubles() || expr->depth() > 1 || | 426 return masm()->serializer_enabled() || |
427 masm()->serializer_enabled() || | 427 expr->ComputeFlags() != ObjectLiteral::kShallowProperties || |
titzer
2015/04/21 14:02:26
Is ComputeFlags() expensive enough to need a cache
Michael Starzinger
2015/04/21 14:35:41
Done.
| |
428 expr->ComputeFlags() != ObjectLiteral::kFastElements || | 428 expr->ComputeFlags() != ObjectLiteral::kFastElements || |
429 expr->has_elements() || | |
430 expr->properties_count() > | 429 expr->properties_count() > |
431 FastCloneShallowObjectStub::kMaximumClonedProperties; | 430 FastCloneShallowObjectStub::kMaximumClonedProperties; |
432 } | 431 } |
433 | 432 |
434 | 433 |
435 bool FullCodeGenerator::MustCreateArrayLiteralWithRuntime( | 434 bool FullCodeGenerator::MustCreateArrayLiteralWithRuntime( |
436 ArrayLiteral* expr) const { | 435 ArrayLiteral* expr) const { |
437 return expr->depth() > 1 || | 436 return expr->depth() > 1 || |
438 expr->values()->length() > JSObject::kInitialMaxFastElementArray; | 437 expr->values()->length() > JSObject::kInitialMaxFastElementArray; |
439 } | 438 } |
(...skipping 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1851 } | 1850 } |
1852 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); | 1851 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); |
1853 codegen_->scope_ = saved_scope_; | 1852 codegen_->scope_ = saved_scope_; |
1854 } | 1853 } |
1855 | 1854 |
1856 | 1855 |
1857 #undef __ | 1856 #undef __ |
1858 | 1857 |
1859 | 1858 |
1860 } } // namespace v8::internal | 1859 } } // namespace v8::internal |
OLD | NEW |