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

Side by Side Diff: src/stub-cache.cc

Issue 23601031: Handlify JSReceiver::SetProperty and friends. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Toon Verwaest. Created 7 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.cc ('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 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after
1388 MaybeObject* result = LoadWithInterceptor(&args, &attr); 1388 MaybeObject* result = LoadWithInterceptor(&args, &attr);
1389 RETURN_IF_SCHEDULED_EXCEPTION(isolate); 1389 RETURN_IF_SCHEDULED_EXCEPTION(isolate);
1390 // This is call IC. In this case, we simply return the undefined result which 1390 // This is call IC. In this case, we simply return the undefined result which
1391 // will lead to an exception when trying to invoke the result as a 1391 // will lead to an exception when trying to invoke the result as a
1392 // function. 1392 // function.
1393 return result; 1393 return result;
1394 } 1394 }
1395 1395
1396 1396
1397 RUNTIME_FUNCTION(MaybeObject*, StoreInterceptorProperty) { 1397 RUNTIME_FUNCTION(MaybeObject*, StoreInterceptorProperty) {
1398 HandleScope scope(isolate);
1398 ASSERT(args.length() == 4); 1399 ASSERT(args.length() == 4);
1399 JSObject* recv = JSObject::cast(args[0]); 1400 Handle<JSObject> recv(JSObject::cast(args[0]));
1400 Name* name = Name::cast(args[1]); 1401 Handle<Name> name(Name::cast(args[1]));
1401 Object* value = args[2]; 1402 Handle<Object> value(args[2], isolate);
1402 ASSERT(args.smi_at(3) == kStrictMode || args.smi_at(3) == kNonStrictMode); 1403 ASSERT(args.smi_at(3) == kStrictMode || args.smi_at(3) == kNonStrictMode);
1403 StrictModeFlag strict_mode = static_cast<StrictModeFlag>(args.smi_at(3)); 1404 StrictModeFlag strict_mode = static_cast<StrictModeFlag>(args.smi_at(3));
1404 ASSERT(recv->HasNamedInterceptor()); 1405 ASSERT(recv->HasNamedInterceptor());
1405 PropertyAttributes attr = NONE; 1406 PropertyAttributes attr = NONE;
1406 MaybeObject* result = recv->SetPropertyWithInterceptor( 1407 Handle<Object> result = JSObject::SetPropertyWithInterceptor(
1407 name, value, attr, strict_mode); 1408 recv, name, value, attr, strict_mode);
1408 return result; 1409 RETURN_IF_EMPTY_HANDLE(isolate, result);
1410 return *result;
1409 } 1411 }
1410 1412
1411 1413
1412 RUNTIME_FUNCTION(MaybeObject*, KeyedLoadPropertyWithInterceptor) { 1414 RUNTIME_FUNCTION(MaybeObject*, KeyedLoadPropertyWithInterceptor) {
1413 JSObject* receiver = JSObject::cast(args[0]); 1415 JSObject* receiver = JSObject::cast(args[0]);
1414 ASSERT(args.smi_at(1) >= 0); 1416 ASSERT(args.smi_at(1) >= 0);
1415 uint32_t index = args.smi_at(1); 1417 uint32_t index = args.smi_at(1);
1416 return receiver->GetElementWithInterceptor(receiver, index); 1418 return receiver->GetElementWithInterceptor(receiver, index);
1417 } 1419 }
1418 1420
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after
2252 Handle<FunctionTemplateInfo>( 2254 Handle<FunctionTemplateInfo>(
2253 FunctionTemplateInfo::cast(signature->receiver())); 2255 FunctionTemplateInfo::cast(signature->receiver()));
2254 } 2256 }
2255 } 2257 }
2256 2258
2257 is_simple_api_call_ = true; 2259 is_simple_api_call_ = true;
2258 } 2260 }
2259 2261
2260 2262
2261 } } // namespace v8::internal 2263 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698