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/ast.h" | 5 #include "src/ast.h" |
6 | 6 |
7 #include <cmath> // For isfinite. | 7 #include <cmath> // For isfinite. |
8 #include "src/builtins.h" | 8 #include "src/builtins.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/contexts.h" | 10 #include "src/contexts.h" |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 for (int n = values()->length(); array_index < n; array_index++) { | 533 for (int n = values()->length(); array_index < n; array_index++) { |
534 Expression* element = values()->at(array_index); | 534 Expression* element = values()->at(array_index); |
535 if (element->IsSpread()) break; | 535 if (element->IsSpread()) break; |
536 MaterializedLiteral* m_literal = element->AsMaterializedLiteral(); | 536 MaterializedLiteral* m_literal = element->AsMaterializedLiteral(); |
537 if (m_literal != NULL) { | 537 if (m_literal != NULL) { |
538 m_literal->BuildConstants(isolate); | 538 m_literal->BuildConstants(isolate); |
539 if (m_literal->depth() + 1 > depth_acc) { | 539 if (m_literal->depth() + 1 > depth_acc) { |
540 depth_acc = m_literal->depth() + 1; | 540 depth_acc = m_literal->depth() + 1; |
541 } | 541 } |
542 } | 542 } |
| 543 Handle<Object> boilerplate_value = GetBoilerplateValue(element, isolate); |
543 | 544 |
544 // New handle scope here, needs to be after BuildContants(). | |
545 HandleScope scope(isolate); | |
546 Handle<Object> boilerplate_value = GetBoilerplateValue(element, isolate); | |
547 if (boilerplate_value->IsTheHole()) { | 545 if (boilerplate_value->IsTheHole()) { |
548 is_holey = true; | 546 is_holey = true; |
549 continue; | 547 continue; |
550 } | 548 } |
551 | 549 |
552 if (boilerplate_value->IsUninitialized()) { | 550 if (boilerplate_value->IsUninitialized()) { |
553 boilerplate_value = handle(Smi::FromInt(0), isolate); | 551 boilerplate_value = handle(Smi::FromInt(0), isolate); |
554 is_simple = false; | 552 is_simple = false; |
555 } | 553 } |
556 | 554 |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1160 bool Literal::Match(void* literal1, void* literal2) { | 1158 bool Literal::Match(void* literal1, void* literal2) { |
1161 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); | 1159 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); |
1162 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); | 1160 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); |
1163 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || | 1161 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || |
1164 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); | 1162 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); |
1165 } | 1163 } |
1166 | 1164 |
1167 | 1165 |
1168 } // namespace internal | 1166 } // namespace internal |
1169 } // namespace v8 | 1167 } // namespace v8 |
OLD | NEW |