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 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 for (int n = values()->length(); array_index < n; array_index++) { | 518 for (int n = values()->length(); array_index < n; array_index++) { |
519 Expression* element = values()->at(array_index); | 519 Expression* element = values()->at(array_index); |
520 if (element->IsSpread()) break; | 520 if (element->IsSpread()) break; |
521 MaterializedLiteral* m_literal = element->AsMaterializedLiteral(); | 521 MaterializedLiteral* m_literal = element->AsMaterializedLiteral(); |
522 if (m_literal != NULL) { | 522 if (m_literal != NULL) { |
523 m_literal->BuildConstants(isolate); | 523 m_literal->BuildConstants(isolate); |
524 if (m_literal->depth() + 1 > depth_acc) { | 524 if (m_literal->depth() + 1 > depth_acc) { |
525 depth_acc = m_literal->depth() + 1; | 525 depth_acc = m_literal->depth() + 1; |
526 } | 526 } |
527 } | 527 } |
| 528 |
| 529 // New handle scope here, needs to be after BuildContants(). |
| 530 HandleScope scope(isolate); |
528 Handle<Object> boilerplate_value = GetBoilerplateValue(element, isolate); | 531 Handle<Object> boilerplate_value = GetBoilerplateValue(element, isolate); |
529 | |
530 if (boilerplate_value->IsTheHole()) { | 532 if (boilerplate_value->IsTheHole()) { |
531 is_holey = true; | 533 is_holey = true; |
532 continue; | 534 continue; |
533 } | 535 } |
534 | 536 |
535 if (boilerplate_value->IsUninitialized()) { | 537 if (boilerplate_value->IsUninitialized()) { |
536 boilerplate_value = handle(Smi::FromInt(0), isolate); | 538 boilerplate_value = handle(Smi::FromInt(0), isolate); |
537 is_simple = false; | 539 is_simple = false; |
538 } | 540 } |
539 | 541 |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1143 bool Literal::Match(void* literal1, void* literal2) { | 1145 bool Literal::Match(void* literal1, void* literal2) { |
1144 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); | 1146 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); |
1145 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); | 1147 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); |
1146 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || | 1148 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || |
1147 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); | 1149 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); |
1148 } | 1150 } |
1149 | 1151 |
1150 | 1152 |
1151 } // namespace internal | 1153 } // namespace internal |
1152 } // namespace v8 | 1154 } // namespace v8 |
OLD | NEW |