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/runtime/runtime.cc

Issue 622523004: Support for super keyed loads where key is a name. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: CR feedback Created 6 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 | Annotate | Revision Log
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 <stdlib.h> 5 #include <stdlib.h>
6 #include <limits> 6 #include <limits>
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/accessors.h" 10 #include "src/accessors.h"
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 if (object->IsString() || object->IsNumber() || object->IsBoolean()) { 456 if (object->IsString() || object->IsNumber() || object->IsBoolean()) {
457 PrototypeIterator iter(isolate, object); 457 PrototypeIterator iter(isolate, object);
458 return Object::GetElement(isolate, PrototypeIterator::GetCurrent(iter), 458 return Object::GetElement(isolate, PrototypeIterator::GetCurrent(iter),
459 index); 459 index);
460 } else { 460 } else {
461 return Object::GetElement(isolate, object, index); 461 return Object::GetElement(isolate, object, index);
462 } 462 }
463 } 463 }
464 464
465 465
466 MUST_USE_RESULT 466 MaybeHandle<Name> Runtime::ToName(Isolate* isolate, Handle<Object> key) {
467 static MaybeHandle<Name> ToName(Isolate* isolate, Handle<Object> key) {
468 if (key->IsName()) { 467 if (key->IsName()) {
469 return Handle<Name>::cast(key); 468 return Handle<Name>::cast(key);
470 } else { 469 } else {
471 Handle<Object> converted; 470 Handle<Object> converted;
472 ASSIGN_RETURN_ON_EXCEPTION(isolate, converted, 471 ASSIGN_RETURN_ON_EXCEPTION(isolate, converted,
473 Execution::ToString(isolate, key), Name); 472 Execution::ToString(isolate, key), Name);
474 return Handle<Name>::cast(converted); 473 return Handle<Name>::cast(converted);
475 } 474 }
476 } 475 }
477 476
(...skipping 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after
1735 1734
1736 RUNTIME_FUNCTION(Runtime_ThrowReferenceError) { 1735 RUNTIME_FUNCTION(Runtime_ThrowReferenceError) {
1737 HandleScope scope(isolate); 1736 HandleScope scope(isolate);
1738 DCHECK(args.length() == 1); 1737 DCHECK(args.length() == 1);
1739 CONVERT_ARG_HANDLE_CHECKED(Object, name, 0); 1738 CONVERT_ARG_HANDLE_CHECKED(Object, name, 0);
1740 THROW_NEW_ERROR_RETURN_FAILURE( 1739 THROW_NEW_ERROR_RETURN_FAILURE(
1741 isolate, NewReferenceError("not_defined", HandleVector(&name, 1))); 1740 isolate, NewReferenceError("not_defined", HandleVector(&name, 1)));
1742 } 1741 }
1743 1742
1744 1743
1745 RUNTIME_FUNCTION(Runtime_ThrowNonMethodError) {
1746 HandleScope scope(isolate);
1747 DCHECK(args.length() == 0);
1748 THROW_NEW_ERROR_RETURN_FAILURE(
1749 isolate, NewReferenceError("non_method", HandleVector<Object>(NULL, 0)));
1750 }
1751
1752
1753 RUNTIME_FUNCTION(Runtime_ThrowUnsupportedSuperError) {
1754 HandleScope scope(isolate);
1755 DCHECK(args.length() == 0);
1756 THROW_NEW_ERROR_RETURN_FAILURE(
1757 isolate,
1758 NewReferenceError("unsupported_super", HandleVector<Object>(NULL, 0)));
1759 }
1760
1761
1762 RUNTIME_FUNCTION(Runtime_PromiseRejectEvent) { 1744 RUNTIME_FUNCTION(Runtime_PromiseRejectEvent) {
1763 DCHECK(args.length() == 3); 1745 DCHECK(args.length() == 3);
1764 HandleScope scope(isolate); 1746 HandleScope scope(isolate);
1765 CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0); 1747 CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0);
1766 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); 1748 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1);
1767 CONVERT_BOOLEAN_ARG_CHECKED(debug_event, 2); 1749 CONVERT_BOOLEAN_ARG_CHECKED(debug_event, 2);
1768 if (debug_event) isolate->debug()->OnPromiseReject(promise, value); 1750 if (debug_event) isolate->debug()->OnPromiseReject(promise, value);
1769 Handle<Symbol> key = isolate->factory()->promise_has_handler_symbol(); 1751 Handle<Symbol> key = isolate->factory()->promise_has_handler_symbol();
1770 // Do not report if we actually have a handler. 1752 // Do not report if we actually have a handler.
1771 if (JSObject::GetDataProperty(promise, key)->IsUndefined()) { 1753 if (JSObject::GetDataProperty(promise, key)->IsUndefined()) {
(...skipping 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after
3331 } 3313 }
3332 return NULL; 3314 return NULL;
3333 } 3315 }
3334 3316
3335 3317
3336 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { 3318 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) {
3337 return &(kIntrinsicFunctions[static_cast<int>(id)]); 3319 return &(kIntrinsicFunctions[static_cast<int>(id)]);
3338 } 3320 }
3339 } 3321 }
3340 } // namespace v8::internal 3322 } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698