Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/ast.cc

Issue 1185633002: Additional HandleScopes to limit Handle consumption. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Refine comment. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/handles.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
544 // New handle scope here, needs to be after BuildContants().
545 HandleScope scope(isolate);
543 Handle<Object> boilerplate_value = GetBoilerplateValue(element, isolate); 546 Handle<Object> boilerplate_value = GetBoilerplateValue(element, isolate);
544
545 if (boilerplate_value->IsTheHole()) { 547 if (boilerplate_value->IsTheHole()) {
546 is_holey = true; 548 is_holey = true;
547 continue; 549 continue;
548 } 550 }
549 551
550 if (boilerplate_value->IsUninitialized()) { 552 if (boilerplate_value->IsUninitialized()) {
551 boilerplate_value = handle(Smi::FromInt(0), isolate); 553 boilerplate_value = handle(Smi::FromInt(0), isolate);
552 is_simple = false; 554 is_simple = false;
553 } 555 }
554 556
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
1158 bool Literal::Match(void* literal1, void* literal2) { 1160 bool Literal::Match(void* literal1, void* literal2) {
1159 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); 1161 const AstValue* x = static_cast<Literal*>(literal1)->raw_value();
1160 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); 1162 const AstValue* y = static_cast<Literal*>(literal2)->raw_value();
1161 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || 1163 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) ||
1162 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); 1164 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber());
1163 } 1165 }
1164 1166
1165 1167
1166 } // namespace internal 1168 } // namespace internal
1167 } // namespace v8 1169 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698