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

Side by Side Diff: src/runtime/runtime-literals.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/runtime/runtime-i18n.cc ('k') | src/runtime/runtime-object.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/allocation-site-scopes.h" 7 #include "src/allocation-site-scopes.h"
8 #include "src/arguments.h" 8 #include "src/arguments.h"
9 #include "src/ast/ast.h" 9 #include "src/ast/ast.h"
10 #include "src/ast/compile-time-value.h" 10 #include "src/ast/compile-time-value.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 Handle<FixedArray> array = Handle<FixedArray>::cast(value); 79 Handle<FixedArray> array = Handle<FixedArray>::cast(value);
80 ASSIGN_RETURN_ON_EXCEPTION( 80 ASSIGN_RETURN_ON_EXCEPTION(
81 isolate, value, CreateLiteralBoilerplate(isolate, literals, array), 81 isolate, value, CreateLiteralBoilerplate(isolate, literals, array),
82 Object); 82 Object);
83 } 83 }
84 MaybeHandle<Object> maybe_result; 84 MaybeHandle<Object> maybe_result;
85 uint32_t element_index = 0; 85 uint32_t element_index = 0;
86 if (key->ToArrayIndex(&element_index)) { 86 if (key->ToArrayIndex(&element_index)) {
87 // Array index (uint32). 87 // Array index (uint32).
88 if (value->IsUninitialized(isolate)) { 88 if (value->IsUninitialized(isolate)) {
89 value = handle(Smi::kZero, isolate); 89 value = handle(Smi::FromInt(0), isolate);
90 } 90 }
91 maybe_result = JSObject::SetOwnElementIgnoreAttributes( 91 maybe_result = JSObject::SetOwnElementIgnoreAttributes(
92 boilerplate, element_index, value, NONE); 92 boilerplate, element_index, value, NONE);
93 } else { 93 } else {
94 Handle<String> name = Handle<String>::cast(key); 94 Handle<String> name = Handle<String>::cast(key);
95 DCHECK(!name->AsArrayIndex(&element_index)); 95 DCHECK(!name->AsArrayIndex(&element_index));
96 maybe_result = JSObject::SetOwnPropertyIgnoreAttributes(boilerplate, name, 96 maybe_result = JSObject::SetOwnPropertyIgnoreAttributes(boilerplate, name,
97 value, NONE); 97 value, NONE);
98 } 98 }
99 RETURN_ON_EXCEPTION(isolate, maybe_result, Object); 99 RETURN_ON_EXCEPTION(isolate, maybe_result, Object);
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 347
348 Handle<LiteralsArray> literals(closure->literals(), isolate); 348 Handle<LiteralsArray> literals(closure->literals(), isolate);
349 RETURN_RESULT_OR_FAILURE( 349 RETURN_RESULT_OR_FAILURE(
350 isolate, 350 isolate,
351 CreateArrayLiteralImpl(isolate, literals, literals_index, elements, 351 CreateArrayLiteralImpl(isolate, literals, literals_index, elements,
352 ArrayLiteral::kShallowElements)); 352 ArrayLiteral::kShallowElements));
353 } 353 }
354 354
355 } // namespace internal 355 } // namespace internal
356 } // namespace v8 356 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime-i18n.cc ('k') | src/runtime/runtime-object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698