OLD | NEW |
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 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 symbol = isolate->factory()->NewPrivateSymbol(); | 648 symbol = isolate->factory()->NewPrivateSymbol(); |
649 Handle<Symbol>::cast(symbol)->set_name(*name); | 649 Handle<Symbol>::cast(symbol)->set_name(*name); |
650 JSObject::SetProperty(Handle<JSObject>::cast(privates), | 650 JSObject::SetProperty(Handle<JSObject>::cast(privates), |
651 name, symbol, NONE, STRICT).Assert(); | 651 name, symbol, NONE, STRICT).Assert(); |
652 } | 652 } |
653 return *symbol; | 653 return *symbol; |
654 } | 654 } |
655 | 655 |
656 | 656 |
657 RUNTIME_FUNCTION(MaybeObject*, Runtime_NewSymbolWrapper) { | 657 RUNTIME_FUNCTION(MaybeObject*, Runtime_NewSymbolWrapper) { |
| 658 HandleScope scope(isolate); |
658 ASSERT(args.length() == 1); | 659 ASSERT(args.length() == 1); |
659 CONVERT_ARG_CHECKED(Symbol, symbol, 0); | 660 CONVERT_ARG_HANDLE_CHECKED(Symbol, symbol, 0); |
660 return symbol->ToObject(isolate); | 661 return *Object::ToObject(isolate, symbol); |
661 } | 662 } |
662 | 663 |
663 | 664 |
664 RUNTIME_FUNCTION(MaybeObject*, Runtime_SymbolDescription) { | 665 RUNTIME_FUNCTION(MaybeObject*, Runtime_SymbolDescription) { |
665 SealHandleScope shs(isolate); | 666 SealHandleScope shs(isolate); |
666 ASSERT(args.length() == 1); | 667 ASSERT(args.length() == 1); |
667 CONVERT_ARG_CHECKED(Symbol, symbol, 0); | 668 CONVERT_ARG_CHECKED(Symbol, symbol, 0); |
668 return symbol->name(); | 669 return symbol->name(); |
669 } | 670 } |
670 | 671 |
(...skipping 6171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6842 for (int i = 0; i < length; ++i) { | 6843 for (int i = 0; i < length; ++i) { |
6843 ASSERT(String::cast(elements->get(i))->length() == 1); | 6844 ASSERT(String::cast(elements->get(i))->length() == 1); |
6844 } | 6845 } |
6845 #endif | 6846 #endif |
6846 | 6847 |
6847 return *isolate->factory()->NewJSArrayWithElements(elements); | 6848 return *isolate->factory()->NewJSArrayWithElements(elements); |
6848 } | 6849 } |
6849 | 6850 |
6850 | 6851 |
6851 RUNTIME_FUNCTION(MaybeObject*, Runtime_NewStringWrapper) { | 6852 RUNTIME_FUNCTION(MaybeObject*, Runtime_NewStringWrapper) { |
6852 SealHandleScope shs(isolate); | 6853 HandleScope scope(isolate); |
6853 ASSERT(args.length() == 1); | 6854 ASSERT(args.length() == 1); |
6854 CONVERT_ARG_CHECKED(String, value, 0); | 6855 CONVERT_ARG_HANDLE_CHECKED(String, value, 0); |
6855 return value->ToObject(isolate); | 6856 return *Object::ToObject(isolate, value); |
6856 } | 6857 } |
6857 | 6858 |
6858 | 6859 |
6859 bool Runtime::IsUpperCaseChar(RuntimeState* runtime_state, uint16_t ch) { | 6860 bool Runtime::IsUpperCaseChar(RuntimeState* runtime_state, uint16_t ch) { |
6860 unibrow::uchar chars[unibrow::ToUppercase::kMaxWidth]; | 6861 unibrow::uchar chars[unibrow::ToUppercase::kMaxWidth]; |
6861 int char_length = runtime_state->to_upper_mapping()->get(ch, 0, chars); | 6862 int char_length = runtime_state->to_upper_mapping()->get(ch, 0, chars); |
6862 return char_length == 0; | 6863 return char_length == 0; |
6863 } | 6864 } |
6864 | 6865 |
6865 | 6866 |
(...skipping 2080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8946 | 8947 |
8947 | 8948 |
8948 RUNTIME_FUNCTION(MaybeObject*, RuntimeHidden_PushWithContext) { | 8949 RUNTIME_FUNCTION(MaybeObject*, RuntimeHidden_PushWithContext) { |
8949 HandleScope scope(isolate); | 8950 HandleScope scope(isolate); |
8950 ASSERT(args.length() == 2); | 8951 ASSERT(args.length() == 2); |
8951 Handle<JSReceiver> extension_object; | 8952 Handle<JSReceiver> extension_object; |
8952 if (args[0]->IsJSReceiver()) { | 8953 if (args[0]->IsJSReceiver()) { |
8953 extension_object = args.at<JSReceiver>(0); | 8954 extension_object = args.at<JSReceiver>(0); |
8954 } else { | 8955 } else { |
8955 // Convert the object to a proper JavaScript object. | 8956 // Convert the object to a proper JavaScript object. |
8956 Handle<Object> object = isolate->factory()->ToObject(args.at<Object>(0)); | 8957 Handle<Object> object = Object::ToObject(isolate, args.at<Object>(0)); |
8957 if (object.is_null()) { | 8958 if (object.is_null()) { |
8958 Handle<Object> handle = args.at<Object>(0); | 8959 Handle<Object> handle = args.at<Object>(0); |
8959 Handle<Object> result = | 8960 Handle<Object> result = |
8960 isolate->factory()->NewTypeError("with_expression", | 8961 isolate->factory()->NewTypeError("with_expression", |
8961 HandleVector(&handle, 1)); | 8962 HandleVector(&handle, 1)); |
8962 return isolate->Throw(*result); | 8963 return isolate->Throw(*result); |
8963 } | 8964 } |
8964 extension_object = Handle<JSReceiver>::cast(object); | 8965 extension_object = Handle<JSReceiver>::cast(object); |
8965 } | 8966 } |
8966 | 8967 |
(...skipping 2392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11359 // by creating correct wrapper object based on the calling frame's | 11360 // by creating correct wrapper object based on the calling frame's |
11360 // native context. | 11361 // native context. |
11361 it.Advance(); | 11362 it.Advance(); |
11362 if (receiver->IsUndefined()) { | 11363 if (receiver->IsUndefined()) { |
11363 Context* context = function->context(); | 11364 Context* context = function->context(); |
11364 receiver = handle(context->global_object()->global_receiver()); | 11365 receiver = handle(context->global_object()->global_receiver()); |
11365 } else { | 11366 } else { |
11366 ASSERT(!receiver->IsNull()); | 11367 ASSERT(!receiver->IsNull()); |
11367 Context* context = Context::cast(it.frame()->context()); | 11368 Context* context = Context::cast(it.frame()->context()); |
11368 Handle<Context> native_context(Context::cast(context->native_context())); | 11369 Handle<Context> native_context(Context::cast(context->native_context())); |
11369 receiver = isolate->factory()->ToObject(receiver, native_context); | 11370 receiver = Object::ToObject(isolate, receiver, native_context); |
11370 } | 11371 } |
11371 } | 11372 } |
11372 details->set(kFrameDetailsReceiverIndex, *receiver); | 11373 details->set(kFrameDetailsReceiverIndex, *receiver); |
11373 | 11374 |
11374 ASSERT_EQ(details_size, details_index); | 11375 ASSERT_EQ(details_size, details_index); |
11375 return *isolate->factory()->NewJSArrayWithElements(details); | 11376 return *isolate->factory()->NewJSArrayWithElements(details); |
11376 } | 11377 } |
11377 | 11378 |
11378 | 11379 |
11379 static bool ParameterIsShadowedByContextLocal(Handle<ScopeInfo> info, | 11380 static bool ParameterIsShadowedByContextLocal(Handle<ScopeInfo> info, |
(...skipping 3772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15152 } | 15153 } |
15153 } | 15154 } |
15154 | 15155 |
15155 | 15156 |
15156 void Runtime::OutOfMemory() { | 15157 void Runtime::OutOfMemory() { |
15157 Heap::FatalProcessOutOfMemory("CALL_AND_RETRY_LAST", true); | 15158 Heap::FatalProcessOutOfMemory("CALL_AND_RETRY_LAST", true); |
15158 UNREACHABLE(); | 15159 UNREACHABLE(); |
15159 } | 15160 } |
15160 | 15161 |
15161 } } // namespace v8::internal | 15162 } } // namespace v8::internal |
OLD | NEW |