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

Side by Side Diff: src/ast.cc

Issue 1037273002: Ensure object literal element boilerplates aren't modified. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Added comment and REBASE. Created 5 years, 8 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/ast.h ('k') | src/compiler/ast-graph-builder.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.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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 } 361 }
362 362
363 // Add name, value pair to the fixed array. 363 // Add name, value pair to the fixed array.
364 constant_properties->set(position++, *key); 364 constant_properties->set(position++, *key);
365 constant_properties->set(position++, *value); 365 constant_properties->set(position++, *value);
366 } 366 }
367 367
368 constant_properties_ = constant_properties; 368 constant_properties_ = constant_properties;
369 fast_elements_ = 369 fast_elements_ =
370 (max_element_index <= 32) || ((2 * elements) >= max_element_index); 370 (max_element_index <= 32) || ((2 * elements) >= max_element_index);
371 has_elements_ = elements > 0;
371 set_is_simple(is_simple); 372 set_is_simple(is_simple);
372 set_depth(depth_acc); 373 set_depth(depth_acc);
373 } 374 }
374 375
375 376
376 void ArrayLiteral::BuildConstantElements(Isolate* isolate) { 377 void ArrayLiteral::BuildConstantElements(Isolate* isolate) {
377 if (!constant_elements_.is_null()) return; 378 if (!constant_elements_.is_null()) return;
378 379
379 // Allocate a fixed array to hold all the object literals. 380 // Allocate a fixed array to hold all the object literals.
380 Handle<JSArray> array = 381 Handle<JSArray> array =
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 // static 1003 // static
1003 bool Literal::Match(void* literal1, void* literal2) { 1004 bool Literal::Match(void* literal1, void* literal2) {
1004 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); 1005 const AstValue* x = static_cast<Literal*>(literal1)->raw_value();
1005 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); 1006 const AstValue* y = static_cast<Literal*>(literal2)->raw_value();
1006 return (x->IsString() && y->IsString() && *x->AsString() == *y->AsString()) || 1007 return (x->IsString() && y->IsString() && *x->AsString() == *y->AsString()) ||
1007 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); 1008 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber());
1008 } 1009 }
1009 1010
1010 1011
1011 } } // namespace v8::internal 1012 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/compiler/ast-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698