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

Side by Side Diff: src/ast/ast.cc

Issue 2396353002: Revert "Add Smi::Zero and replace all Smi::FromInt(0) calls" (Closed)
Patch Set: Created 4 years, 2 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 | « src/arm64/macro-assembler-arm64.cc ('k') | src/ast/scopeinfo.cc » ('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/ast.h" 5 #include "src/ast/ast.h"
6 6
7 #include <cmath> // For isfinite. 7 #include <cmath> // For isfinite.
8 8
9 #include "src/ast/compile-time-value.h" 9 #include "src/ast/compile-time-value.h"
10 #include "src/ast/prettyprinter.h" 10 #include "src/ast/prettyprinter.h"
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 605
606 // New handle scope here, needs to be after BuildContants(). 606 // New handle scope here, needs to be after BuildContants().
607 HandleScope scope(isolate); 607 HandleScope scope(isolate);
608 Handle<Object> boilerplate_value = GetBoilerplateValue(element, isolate); 608 Handle<Object> boilerplate_value = GetBoilerplateValue(element, isolate);
609 if (boilerplate_value->IsTheHole(isolate)) { 609 if (boilerplate_value->IsTheHole(isolate)) {
610 is_holey = true; 610 is_holey = true;
611 continue; 611 continue;
612 } 612 }
613 613
614 if (boilerplate_value->IsUninitialized(isolate)) { 614 if (boilerplate_value->IsUninitialized(isolate)) {
615 boilerplate_value = handle(Smi::kZero, isolate); 615 boilerplate_value = handle(Smi::FromInt(0), isolate);
616 is_simple = false; 616 is_simple = false;
617 } 617 }
618 618
619 JSObject::AddDataElement(array, array_index, boilerplate_value, NONE) 619 JSObject::AddDataElement(array, array_index, boilerplate_value, NONE)
620 .Assert(); 620 .Assert();
621 } 621 }
622 622
623 JSObject::ValidateElements(array); 623 JSObject::ValidateElements(array);
624 Handle<FixedArrayBase> element_values(array->elements()); 624 Handle<FixedArrayBase> element_values(array->elements());
625 625
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
960 // static 960 // static
961 bool Literal::Match(void* literal1, void* literal2) { 961 bool Literal::Match(void* literal1, void* literal2) {
962 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); 962 const AstValue* x = static_cast<Literal*>(literal1)->raw_value();
963 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); 963 const AstValue* y = static_cast<Literal*>(literal2)->raw_value();
964 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || 964 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) ||
965 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); 965 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber());
966 } 966 }
967 967
968 } // namespace internal 968 } // namespace internal
969 } // namespace v8 969 } // namespace v8
OLDNEW
« no previous file with comments | « src/arm64/macro-assembler-arm64.cc ('k') | src/ast/scopeinfo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698