| OLD | NEW |
| 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 5521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5532 | 5532 |
| 5533 | 5533 |
| 5534 RUNTIME_FUNCTION(Runtime_DebugPromiseHandleEpilogue) { | 5534 RUNTIME_FUNCTION(Runtime_DebugPromiseHandleEpilogue) { |
| 5535 ASSERT(args.length() == 0); | 5535 ASSERT(args.length() == 0); |
| 5536 SealHandleScope shs(isolate); | 5536 SealHandleScope shs(isolate); |
| 5537 isolate->debug()->PromiseHandleEpilogue(); | 5537 isolate->debug()->PromiseHandleEpilogue(); |
| 5538 return isolate->heap()->undefined_value(); | 5538 return isolate->heap()->undefined_value(); |
| 5539 } | 5539 } |
| 5540 | 5540 |
| 5541 | 5541 |
| 5542 // Set an own property, even if it is READ_ONLY. If the property does not | |
| 5543 // exist, it will be added with attributes NONE. | |
| 5544 RUNTIME_FUNCTION(Runtime_IgnoreAttributesAndSetProperty) { | |
| 5545 HandleScope scope(isolate); | |
| 5546 RUNTIME_ASSERT(args.length() == 3 || args.length() == 4); | |
| 5547 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); | |
| 5548 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1); | |
| 5549 CONVERT_ARG_HANDLE_CHECKED(Object, value, 2); | |
| 5550 // Compute attributes. | |
| 5551 PropertyAttributes attributes = NONE; | |
| 5552 if (args.length() == 4) { | |
| 5553 CONVERT_SMI_ARG_CHECKED(unchecked_value, 3); | |
| 5554 // Only attribute bits should be set. | |
| 5555 RUNTIME_ASSERT( | |
| 5556 (unchecked_value & ~(READ_ONLY | DONT_ENUM | DONT_DELETE)) == 0); | |
| 5557 attributes = static_cast<PropertyAttributes>(unchecked_value); | |
| 5558 } | |
| 5559 Handle<Object> result; | |
| 5560 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | |
| 5561 isolate, result, | |
| 5562 JSObject::SetOwnPropertyIgnoreAttributes( | |
| 5563 object, name, value, attributes)); | |
| 5564 return *result; | |
| 5565 } | |
| 5566 | |
| 5567 | |
| 5568 RUNTIME_FUNCTION(Runtime_DeleteProperty) { | 5542 RUNTIME_FUNCTION(Runtime_DeleteProperty) { |
| 5569 HandleScope scope(isolate); | 5543 HandleScope scope(isolate); |
| 5570 ASSERT(args.length() == 3); | 5544 ASSERT(args.length() == 3); |
| 5571 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, object, 0); | 5545 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, object, 0); |
| 5572 CONVERT_ARG_HANDLE_CHECKED(Name, key, 1); | 5546 CONVERT_ARG_HANDLE_CHECKED(Name, key, 1); |
| 5573 CONVERT_STRICT_MODE_ARG_CHECKED(strict_mode, 2); | 5547 CONVERT_STRICT_MODE_ARG_CHECKED(strict_mode, 2); |
| 5574 JSReceiver::DeleteMode delete_mode = strict_mode == STRICT | 5548 JSReceiver::DeleteMode delete_mode = strict_mode == STRICT |
| 5575 ? JSReceiver::STRICT_DELETION : JSReceiver::NORMAL_DELETION; | 5549 ? JSReceiver::STRICT_DELETION : JSReceiver::NORMAL_DELETION; |
| 5576 Handle<Object> result; | 5550 Handle<Object> result; |
| 5577 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 5551 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| (...skipping 9545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15123 } | 15097 } |
| 15124 return NULL; | 15098 return NULL; |
| 15125 } | 15099 } |
| 15126 | 15100 |
| 15127 | 15101 |
| 15128 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15102 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
| 15129 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15103 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
| 15130 } | 15104 } |
| 15131 | 15105 |
| 15132 } } // namespace v8::internal | 15106 } } // namespace v8::internal |
| OLD | NEW |