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

Side by Side Diff: src/runtime.cc

Issue 527963002: Implement loads and calls from 'super' (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased before landing Created 6 years, 3 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
« no previous file with comments | « src/runtime.h ('k') | src/x64/full-codegen-x64.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 <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 2062 matching lines...) Expand 10 before | Expand all | Expand 10 after
2073 return *clone; 2073 return *clone;
2074 } 2074 }
2075 2075
2076 2076
2077 RUNTIME_FUNCTION(Runtime_HomeObjectSymbol) { 2077 RUNTIME_FUNCTION(Runtime_HomeObjectSymbol) {
2078 DCHECK(args.length() == 0); 2078 DCHECK(args.length() == 0);
2079 return isolate->heap()->home_object_symbol(); 2079 return isolate->heap()->home_object_symbol();
2080 } 2080 }
2081 2081
2082 2082
2083 RUNTIME_FUNCTION(Runtime_LoadFromSuper) {
2084 HandleScope scope(isolate);
2085 DCHECK(args.length() == 3);
2086 CONVERT_ARG_HANDLE_CHECKED(JSObject, home_object, 0);
2087 CONVERT_ARG_HANDLE_CHECKED(Object, receiver, 1);
2088 CONVERT_ARG_HANDLE_CHECKED(Name, name, 2);
2089
2090 if (home_object->IsAccessCheckNeeded() &&
2091 !isolate->MayNamedAccess(home_object, name, v8::ACCESS_GET)) {
2092 isolate->ReportFailedAccessCheck(home_object, v8::ACCESS_GET);
2093 RETURN_FAILURE_IF_SCHEDULED_EXCEPTION(isolate);
2094 }
2095
2096 PrototypeIterator iter(isolate, home_object);
2097 Handle<Object> proto = PrototypeIterator::GetCurrent(iter);
2098 if (!proto->IsJSReceiver()) return isolate->heap()->undefined_value();
2099
2100 LookupIterator it(receiver, name, Handle<JSReceiver>::cast(proto));
2101 Handle<Object> result;
2102 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, Object::GetProperty(&it));
2103 return *result;
2104 }
2105
2106
2083 RUNTIME_FUNCTION(Runtime_IsExtensible) { 2107 RUNTIME_FUNCTION(Runtime_IsExtensible) {
2084 SealHandleScope shs(isolate); 2108 SealHandleScope shs(isolate);
2085 DCHECK(args.length() == 1); 2109 DCHECK(args.length() == 1);
2086 CONVERT_ARG_CHECKED(JSObject, obj, 0); 2110 CONVERT_ARG_CHECKED(JSObject, obj, 0);
2087 if (obj->IsJSGlobalProxy()) { 2111 if (obj->IsJSGlobalProxy()) {
2088 PrototypeIterator iter(isolate, obj); 2112 PrototypeIterator iter(isolate, obj);
2089 if (iter.IsAtEnd()) return isolate->heap()->false_value(); 2113 if (iter.IsAtEnd()) return isolate->heap()->false_value();
2090 DCHECK(iter.GetCurrent()->IsJSGlobalObject()); 2114 DCHECK(iter.GetCurrent()->IsJSGlobalObject());
2091 obj = JSObject::cast(iter.GetCurrent()); 2115 obj = JSObject::cast(iter.GetCurrent());
2092 } 2116 }
(...skipping 7444 matching lines...) Expand 10 before | Expand all | Expand 10 after
9537 9561
9538 RUNTIME_FUNCTION(Runtime_ThrowReferenceError) { 9562 RUNTIME_FUNCTION(Runtime_ThrowReferenceError) {
9539 HandleScope scope(isolate); 9563 HandleScope scope(isolate);
9540 DCHECK(args.length() == 1); 9564 DCHECK(args.length() == 1);
9541 CONVERT_ARG_HANDLE_CHECKED(Object, name, 0); 9565 CONVERT_ARG_HANDLE_CHECKED(Object, name, 0);
9542 THROW_NEW_ERROR_RETURN_FAILURE( 9566 THROW_NEW_ERROR_RETURN_FAILURE(
9543 isolate, NewReferenceError("not_defined", HandleVector(&name, 1))); 9567 isolate, NewReferenceError("not_defined", HandleVector(&name, 1)));
9544 } 9568 }
9545 9569
9546 9570
9571 RUNTIME_FUNCTION(Runtime_ThrowNonMethodError) {
9572 HandleScope scope(isolate);
9573 DCHECK(args.length() == 0);
9574 THROW_NEW_ERROR_RETURN_FAILURE(
9575 isolate, NewReferenceError("non_method", HandleVector<Object>(NULL, 0)));
9576 }
9577
9578
9579 RUNTIME_FUNCTION(Runtime_ThrowUnsupportedSuperError) {
9580 HandleScope scope(isolate);
9581 DCHECK(args.length() == 0);
9582 THROW_NEW_ERROR_RETURN_FAILURE(
9583 isolate,
9584 NewReferenceError("unsupported_super", HandleVector<Object>(NULL, 0)));
9585 }
9586
9587
9547 RUNTIME_FUNCTION(Runtime_ThrowNotDateError) { 9588 RUNTIME_FUNCTION(Runtime_ThrowNotDateError) {
9548 HandleScope scope(isolate); 9589 HandleScope scope(isolate);
9549 DCHECK(args.length() == 0); 9590 DCHECK(args.length() == 0);
9550 THROW_NEW_ERROR_RETURN_FAILURE( 9591 THROW_NEW_ERROR_RETURN_FAILURE(
9551 isolate, NewTypeError("not_date_object", HandleVector<Object>(NULL, 0))); 9592 isolate, NewTypeError("not_date_object", HandleVector<Object>(NULL, 0)));
9552 } 9593 }
9553 9594
9554 9595
9555 RUNTIME_FUNCTION(Runtime_StackGuard) { 9596 RUNTIME_FUNCTION(Runtime_StackGuard) {
9556 SealHandleScope shs(isolate); 9597 SealHandleScope shs(isolate);
(...skipping 6145 matching lines...) Expand 10 before | Expand all | Expand 10 after
15702 } 15743 }
15703 return NULL; 15744 return NULL;
15704 } 15745 }
15705 15746
15706 15747
15707 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { 15748 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) {
15708 return &(kIntrinsicFunctions[static_cast<int>(id)]); 15749 return &(kIntrinsicFunctions[static_cast<int>(id)]);
15709 } 15750 }
15710 15751
15711 } } // namespace v8::internal 15752 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.h ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698