OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 "src/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/ast/prettyprinter.h" | 8 #include "src/ast/prettyprinter.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 DCHECK(args.length() == 1); | 361 DCHECK(args.length() == 1); |
362 CONVERT_ARG_CHECKED(String, name, 0); | 362 CONVERT_ARG_CHECKED(String, name, 0); |
363 | 363 |
364 if (FLAG_native_code_counters) { | 364 if (FLAG_native_code_counters) { |
365 StatsCounter(isolate, name->ToCString().get()).Increment(); | 365 StatsCounter(isolate, name->ToCString().get()).Increment(); |
366 } | 366 } |
367 return isolate->heap()->undefined_value(); | 367 return isolate->heap()->undefined_value(); |
368 } | 368 } |
369 | 369 |
370 | 370 |
371 RUNTIME_FUNCTION(Runtime_HarmonyToString) { | |
372 // TODO(caitp): Delete this runtime method when removing --harmony-tostring | |
373 return isolate->heap()->ToBoolean(FLAG_harmony_tostring); | |
374 } | |
375 | |
376 | |
377 namespace { | 371 namespace { |
378 | 372 |
379 bool ComputeLocation(Isolate* isolate, MessageLocation* target) { | 373 bool ComputeLocation(Isolate* isolate, MessageLocation* target) { |
380 JavaScriptFrameIterator it(isolate); | 374 JavaScriptFrameIterator it(isolate); |
381 if (!it.done()) { | 375 if (!it.done()) { |
382 JavaScriptFrame* frame = it.frame(); | 376 JavaScriptFrame* frame = it.frame(); |
383 JSFunction* fun = frame->function(); | 377 JSFunction* fun = frame->function(); |
384 Object* script = fun->shared()->script(); | 378 Object* script = fun->shared()->script(); |
385 if (script->IsScript() && | 379 if (script->IsScript() && |
386 !(Script::cast(script)->source()->IsUndefined())) { | 380 !(Script::cast(script)->source()->IsUndefined())) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 HandleScope scope(isolate); | 432 HandleScope scope(isolate); |
439 DCHECK_EQ(1, args.length()); | 433 DCHECK_EQ(1, args.length()); |
440 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); | 434 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); |
441 Handle<String> callsite = RenderCallSite(isolate, object); | 435 Handle<String> callsite = RenderCallSite(isolate, object); |
442 THROW_NEW_ERROR_RETURN_FAILURE( | 436 THROW_NEW_ERROR_RETURN_FAILURE( |
443 isolate, NewTypeError(MessageTemplate::kNotConstructor, callsite)); | 437 isolate, NewTypeError(MessageTemplate::kNotConstructor, callsite)); |
444 } | 438 } |
445 | 439 |
446 } // namespace internal | 440 } // namespace internal |
447 } // namespace v8 | 441 } // namespace v8 |
OLD | NEW |