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

Side by Side Diff: src/hydrogen.cc

Issue 1358423002: [es6] Introduce spec compliant IsConstructor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix stupid fuzzer failure (constructor bit set on sloppy/strict arguments). Fix MIPS/MIPS64 typos, … Created 5 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/globals.h ('k') | src/ia32/builtins-ia32.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/hydrogen.h" 5 #include "src/hydrogen.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/allocation-site-scopes.h" 9 #include "src/allocation-site-scopes.h"
10 #include "src/ast-numbering.h" 10 #include "src/ast-numbering.h"
(...skipping 6400 matching lines...) Expand 10 before | Expand all | Expand 10 after
6411 InstanceType instance_type = map_->instance_type(); 6411 InstanceType instance_type = map_->instance_type();
6412 return instance_type == JS_TYPED_ARRAY_TYPE && name_->IsString() && 6412 return instance_type == JS_TYPED_ARRAY_TYPE && name_->IsString() &&
6413 IsSpecialIndex(isolate()->unicode_cache(), String::cast(*name_)); 6413 IsSpecialIndex(isolate()->unicode_cache(), String::cast(*name_));
6414 } 6414 }
6415 6415
6416 6416
6417 bool HOptimizedGraphBuilder::PropertyAccessInfo::CanAccessMonomorphic() { 6417 bool HOptimizedGraphBuilder::PropertyAccessInfo::CanAccessMonomorphic() {
6418 if (!CanInlinePropertyAccess(map_)) return false; 6418 if (!CanInlinePropertyAccess(map_)) return false;
6419 if (IsJSObjectFieldAccessor()) return IsLoad(); 6419 if (IsJSObjectFieldAccessor()) return IsLoad();
6420 if (IsJSArrayBufferViewFieldAccessor()) return IsLoad(); 6420 if (IsJSArrayBufferViewFieldAccessor()) return IsLoad();
6421 if (map_->function_with_prototype() && !map_->has_non_instance_prototype() && 6421 if (map_->IsJSFunctionMap() && map_->is_constructor() &&
6422 !map_->has_non_instance_prototype() &&
6422 name_.is_identical_to(isolate()->factory()->prototype_string())) { 6423 name_.is_identical_to(isolate()->factory()->prototype_string())) {
6423 return IsLoad(); 6424 return IsLoad();
6424 } 6425 }
6425 if (!LookupDescriptor()) return false; 6426 if (!LookupDescriptor()) return false;
6426 if (IsFound()) return IsLoad() || !IsReadOnly(); 6427 if (IsFound()) return IsLoad() || !IsReadOnly();
6427 if (IsIntegerIndexedExotic()) return false; 6428 if (IsIntegerIndexedExotic()) return false;
6428 if (!LookupInPrototypes()) return false; 6429 if (!LookupInPrototypes()) return false;
6429 if (IsLoad()) return true; 6430 if (IsLoad()) return true;
6430 6431
6431 if (IsAccessorConstant()) return true; 6432 if (IsAccessorConstant()) return true;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
6525 return New<HLoadNamedField>(object, checked_object, access); 6526 return New<HLoadNamedField>(object, checked_object, access);
6526 } 6527 }
6527 6528
6528 if (info->GetJSArrayBufferViewFieldAccess(&access)) { 6529 if (info->GetJSArrayBufferViewFieldAccess(&access)) {
6529 DCHECK(info->IsLoad()); 6530 DCHECK(info->IsLoad());
6530 checked_object = Add<HCheckArrayBufferNotNeutered>(checked_object); 6531 checked_object = Add<HCheckArrayBufferNotNeutered>(checked_object);
6531 return New<HLoadNamedField>(object, checked_object, access); 6532 return New<HLoadNamedField>(object, checked_object, access);
6532 } 6533 }
6533 6534
6534 if (info->name().is_identical_to(isolate()->factory()->prototype_string()) && 6535 if (info->name().is_identical_to(isolate()->factory()->prototype_string()) &&
6535 info->map()->function_with_prototype()) { 6536 info->map()->IsJSFunctionMap() && info->map()->is_constructor()) {
6536 DCHECK(!info->map()->has_non_instance_prototype()); 6537 DCHECK(!info->map()->has_non_instance_prototype());
6537 return New<HLoadFunctionPrototype>(checked_object); 6538 return New<HLoadFunctionPrototype>(checked_object);
6538 } 6539 }
6539 6540
6540 HValue* checked_holder = checked_object; 6541 HValue* checked_holder = checked_object;
6541 if (info->has_holder()) { 6542 if (info->has_holder()) {
6542 Handle<JSObject> prototype(JSObject::cast(info->map()->prototype())); 6543 Handle<JSObject> prototype(JSObject::cast(info->map()->prototype()));
6543 checked_holder = BuildCheckPrototypeMaps(prototype, info->holder()); 6544 checked_holder = BuildCheckPrototypeMaps(prototype, info->holder());
6544 } 6545 }
6545 6546
(...skipping 7051 matching lines...) Expand 10 before | Expand all | Expand 10 after
13597 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13598 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
13598 } 13599 }
13599 13600
13600 #ifdef DEBUG 13601 #ifdef DEBUG
13601 graph_->Verify(false); // No full verify. 13602 graph_->Verify(false); // No full verify.
13602 #endif 13603 #endif
13603 } 13604 }
13604 13605
13605 } // namespace internal 13606 } // namespace internal
13606 } // namespace v8 13607 } // namespace v8
OLDNEW
« no previous file with comments | « src/globals.h ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698