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

Side by Side Diff: src/runtime.cc

Issue 234893003: Revert "Handlify GetProperty." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/objects-inl.h ('k') | test/cctest/test-api.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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 6029 matching lines...) Expand 10 before | Expand all | Expand 10 after
6040 // Try to convert the key to an index. If successful and within 6040 // Try to convert the key to an index. If successful and within
6041 // index return the the argument from the frame. 6041 // index return the the argument from the frame.
6042 uint32_t index; 6042 uint32_t index;
6043 if (args[0]->ToArrayIndex(&index) && index < n) { 6043 if (args[0]->ToArrayIndex(&index) && index < n) {
6044 return frame->GetParameter(index); 6044 return frame->GetParameter(index);
6045 } 6045 }
6046 6046
6047 HandleScope scope(isolate); 6047 HandleScope scope(isolate);
6048 if (args[0]->IsSymbol()) { 6048 if (args[0]->IsSymbol()) {
6049 // Lookup in the initial Object.prototype object. 6049 // Lookup in the initial Object.prototype object.
6050 Handle<Object> result; 6050 Handle<Object> result = Object::GetProperty(
6051 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 6051 isolate->initial_object_prototype(), args.at<Symbol>(0));
6052 isolate, result, 6052 RETURN_IF_EMPTY_HANDLE(isolate, result);
6053 Object::GetProperty(
6054 isolate->initial_object_prototype(), args.at<Symbol>(0)));
6055 return *result; 6053 return *result;
6056 } 6054 }
6057 6055
6058 // Convert the key to a string. 6056 // Convert the key to a string.
6059 Handle<Object> converted; 6057 Handle<Object> converted;
6060 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 6058 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
6061 isolate, converted, Execution::ToString(isolate, args.at<Object>(0))); 6059 isolate, converted, Execution::ToString(isolate, args.at<Object>(0)));
6062 Handle<String> key = Handle<String>::cast(converted); 6060 Handle<String> key = Handle<String>::cast(converted);
6063 6061
6064 // Try to convert the string key into an array index. 6062 // Try to convert the string key into an array index.
(...skipping 17 matching lines...) Expand all
6082 if (String::Equals(isolate->factory()->callee_string(), key)) { 6080 if (String::Equals(isolate->factory()->callee_string(), key)) {
6083 JSFunction* function = frame->function(); 6081 JSFunction* function = frame->function();
6084 if (function->shared()->strict_mode() == STRICT) { 6082 if (function->shared()->strict_mode() == STRICT) {
6085 return isolate->Throw(*isolate->factory()->NewTypeError( 6083 return isolate->Throw(*isolate->factory()->NewTypeError(
6086 "strict_arguments_callee", HandleVector<Object>(NULL, 0))); 6084 "strict_arguments_callee", HandleVector<Object>(NULL, 0)));
6087 } 6085 }
6088 return function; 6086 return function;
6089 } 6087 }
6090 6088
6091 // Lookup in the initial Object.prototype object. 6089 // Lookup in the initial Object.prototype object.
6092 Handle<Object> result; 6090 Handle<Object> result = Object::GetProperty(
6093 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 6091 isolate->initial_object_prototype(), key);
6094 isolate, result, 6092 RETURN_IF_EMPTY_HANDLE(isolate, result);
6095 Object::GetProperty(isolate->initial_object_prototype(), key));
6096 return *result; 6093 return *result;
6097 } 6094 }
6098 6095
6099 6096
6100 RUNTIME_FUNCTION(MaybeObject*, Runtime_ToFastProperties) { 6097 RUNTIME_FUNCTION(MaybeObject*, Runtime_ToFastProperties) {
6101 HandleScope scope(isolate); 6098 HandleScope scope(isolate);
6102 ASSERT(args.length() == 1); 6099 ASSERT(args.length() == 1);
6103 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); 6100 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
6104 if (object->IsJSObject() && !object->IsGlobalObject()) { 6101 if (object->IsJSObject() && !object->IsGlobalObject()) {
6105 JSObject::TransformToFastProperties(Handle<JSObject>::cast(object), 0); 6102 JSObject::TransformToFastProperties(Handle<JSObject>::cast(object), 0);
(...skipping 3198 matching lines...) Expand 10 before | Expand all | Expand 10 after
9304 // GetProperty below can cause GC. 9301 // GetProperty below can cause GC.
9305 Handle<Object> receiver_handle( 9302 Handle<Object> receiver_handle(
9306 object->IsGlobalObject() 9303 object->IsGlobalObject()
9307 ? Object::cast(isolate->heap()->undefined_value()) 9304 ? Object::cast(isolate->heap()->undefined_value())
9308 : object->IsJSProxy() ? static_cast<Object*>(*object) 9305 : object->IsJSProxy() ? static_cast<Object*>(*object)
9309 : ComputeReceiverForNonGlobal(isolate, JSObject::cast(*object)), 9306 : ComputeReceiverForNonGlobal(isolate, JSObject::cast(*object)),
9310 isolate); 9307 isolate);
9311 9308
9312 // No need to unhole the value here. This is taken care of by the 9309 // No need to unhole the value here. This is taken care of by the
9313 // GetProperty function. 9310 // GetProperty function.
9314 Handle<Object> value; 9311 Handle<Object> value = Object::GetProperty(object, name);
9315 ASSIGN_RETURN_ON_EXCEPTION_VALUE( 9312 RETURN_IF_EMPTY_HANDLE_VALUE(
9316 isolate, value, 9313 isolate, value, MakePair(Failure::Exception(), NULL));
9317 Object::GetProperty(object, name),
9318 MakePair(Failure::Exception(), NULL));
9319 return MakePair(*value, *receiver_handle); 9314 return MakePair(*value, *receiver_handle);
9320 } 9315 }
9321 9316
9322 if (throw_error) { 9317 if (throw_error) {
9323 // The property doesn't exist - throw exception. 9318 // The property doesn't exist - throw exception.
9324 Handle<Object> reference_error = 9319 Handle<Object> reference_error =
9325 isolate->factory()->NewReferenceError("not_defined", 9320 isolate->factory()->NewReferenceError("not_defined",
9326 HandleVector(&name, 1)); 9321 HandleVector(&name, 1));
9327 return MakePair(isolate->Throw(*reference_error), NULL); 9322 return MakePair(isolate->Throw(*reference_error), NULL);
9328 } else { 9323 } else {
(...skipping 5843 matching lines...) Expand 10 before | Expand all | Expand 10 after
15172 } 15167 }
15173 } 15168 }
15174 15169
15175 15170
15176 void Runtime::OutOfMemory() { 15171 void Runtime::OutOfMemory() {
15177 Heap::FatalProcessOutOfMemory("CALL_AND_RETRY_LAST", true); 15172 Heap::FatalProcessOutOfMemory("CALL_AND_RETRY_LAST", true);
15178 UNREACHABLE(); 15173 UNREACHABLE();
15179 } 15174 }
15180 15175
15181 } } // namespace v8::internal 15176 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698